diff mercurial/context.py @ 32680:a722c8e17363

localrepo: map integer and hex wdir identifiers to workingctx changectx.__init__() is slightly modified to take str(wdirrev) as a valid integer revision (and raise WdirUnsupported exception.) Test will be added by the next patch.
author Yuya Nishihara <yuya@tcha.org>
date Fri, 19 Aug 2016 18:40:35 +0900
parents 9929af2b09b4
children 3e8eb6d84a5c
line wrap: on
line diff
--- a/mercurial/context.py	Sat Aug 20 22:37:58 2016 +0900
+++ b/mercurial/context.py	Fri Aug 19 18:40:35 2016 +0900
@@ -23,6 +23,7 @@
     short,
     wdirid,
     wdirnodes,
+    wdirrev,
 )
 from . import (
     encoding,
@@ -471,7 +472,7 @@
                 l = len(repo.changelog)
                 if r < 0:
                     r += l
-                if r < 0 or r >= l:
+                if r < 0 or r >= l and r != wdirrev:
                     raise ValueError
                 self._rev = r
                 self._node = repo.changelog.node(r)