mercurial/commands.py
changeset 4175 a2335e832e16
parent 4156 30857b5779f8
child 4177 ba51a8225a60
child 4190 e8ee8fdeddb1
child 4204 f9bbcebcacea
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2544,7 +2544,11 @@ def _lookup(repo, node, branch=None):
         else:
             raise util.Abort(_("branch %s not found") % branch)
     else:
-        node = node and repo.lookup(node) or repo.changelog.tip()
+        if node:
+            node = repo.lookup(node)
+        else:
+            wc = repo.workingctx()
+            node = repo.branchtags()[wc.branch()]
     return node
 
 def verify(ui, repo):