diff mercurial/context.py @ 18464:a2e9fe93d9ea stable

changectx: fix the handling of `tip` We can not use `len(repo,changelog)`, it may be a filtered revision. We now use `repo,changelog.tip()` to fetch this information. The `tip` command is also fixed and tested Thanks goes to Idan Kamara for the initial report.
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Tue, 22 Jan 2013 11:39:14 +0100
parents 5d6ee2494f63
children 3e92772d5383 50c922c1b514
line wrap: on
line diff
--- a/mercurial/context.py	Tue Jan 22 03:23:02 2013 +0100
+++ b/mercurial/context.py	Tue Jan 22 11:39:14 2013 +0100
@@ -44,8 +44,8 @@
             self._rev = nullrev
             return
         if changeid == 'tip':
-            self._rev = len(repo.changelog) - 1
-            self._node = repo.changelog.node(self._rev)
+            self._node = repo.changelog.tip()
+            self._rev = repo.changelog.rev(self._node)
             return
         if len(changeid) == 20:
             try: