changeset 37097:7f025c9b7865

directaccess: do not abort by 'ff...' hash Since the 'ff...' hash should never be hidden, we can just ignore it.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 24 Mar 2018 17:19:32 +0900
parents db114320df7e
children e24802ea8dbd
files mercurial/scmutil.py tests/test-directaccess.t
diffstat 2 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/scmutil.py	Fri Mar 23 11:20:13 2018 -0700
+++ b/mercurial/scmutil.py	Sat Mar 24 17:19:32 2018 +0900
@@ -1419,7 +1419,7 @@
 
         try:
             s = pmatch(s)
-        except error.LookupError:
+        except (error.LookupError, error.WdirUnsupported):
             s = None
 
         if s is not None:
--- a/tests/test-directaccess.t	Fri Mar 23 11:20:13 2018 -0700
+++ b/tests/test-directaccess.t	Sat Mar 24 17:19:32 2018 +0900
@@ -179,6 +179,19 @@
    foo
   -bar
 
+Test special hash/rev
+
+  $ hg log -qr 'null:wdir() & 000000000000'
+  -1:000000000000
+  $ hg log -qr 'null:wdir() & ffffffffffff'
+  2147483647:ffffffffffff
+  $ hg log -qr 'null:wdir() & rev(-1)'
+  -1:000000000000
+  $ hg log -qr 'null:wdir() & rev(2147483647)'
+  2147483647:ffffffffffff
+  $ hg log -qr 'null:wdir() & 2147483647'
+  2147483647:ffffffffffff
+
 Commands with undefined cmdtype should not work right now
 
   $ hg phase -r 28ad74