diff mercurial/scmutil.py @ 25739:3dabc9b7494a

changeset_printer: use node.wdirrev to calculate meaningful parentrevs Because we defined the working-directory revision is INT_MAX, it makes sense that "hg log -r 'wdir()'" displays the "parent:" field. This is the same for two revisions that are semantically contiguous but the intermediate revisions are hidden.
author Yuya Nishihara <yuya@tcha.org>
date Thu, 02 Jul 2015 22:03:06 +0900
parents 328739ea70c3
children 39de2e9cc6f4
line wrap: on
line diff
--- a/mercurial/scmutil.py	Mon Jun 22 22:05:10 2015 +0900
+++ b/mercurial/scmutil.py	Thu Jul 02 22:03:06 2015 +0900
@@ -6,7 +6,7 @@
 # GNU General Public License version 2 or any later version.
 
 from i18n import _
-from mercurial.node import nullrev
+from mercurial.node import nullrev, wdirrev
 import util, error, osutil, revset, similar, encoding, phases
 import pathutil
 import match as matchmod
@@ -662,11 +662,11 @@
             _rcpath = osrcpath()
     return _rcpath
 
-def intrev(repo, rev):
+def intrev(rev):
     """Return integer for a given revision that can be used in comparison or
     arithmetic operation"""
     if rev is None:
-        return len(repo)
+        return wdirrev
     return rev
 
 def revsingle(repo, revspec, default='.'):