--- a/hgext/directaccess.py Tue Nov 17 17:06:07 2015 -0800
+++ b/hgext/directaccess.py Wed Nov 18 13:47:26 2015 -0800
@@ -131,7 +131,7 @@
_listtuple = ('symbol', '_list')
-def gethashsymbols(tree):
+def gethashsymbols(tree, maxrev):
# Returns the list of symbols of the tree that look like hashes
# for example for the revset 3::abe3ff it will return ('abe3ff')
if not tree:
@@ -139,8 +139,12 @@
if len(tree) == 2 and tree[0] == "symbol":
try:
- int(tree[1])
- return []
+ n = int(tree[1])
+ # This isn't necessarily a rev number, could be a hash prefix
+ if n > maxrev:
+ return [tree[1]]
+ else:
+ return []
except ValueError as e:
if hashre.match(tree[1]):
return [tree[1]]
@@ -155,7 +159,7 @@
elif len(tree) >= 3:
results = []
for subtree in tree[1:]:
- results += gethashsymbols(subtree)
+ results += gethashsymbols(subtree, maxrev)
return results
else:
return []
@@ -171,8 +175,8 @@
if filternm is not None and filternm.startswith('visible-directaccess'):
prelength = len(repo._explicitaccess)
accessbefore = set(repo._explicitaccess)
- repo.symbols = gethashsymbols(tree)
cl = repo.unfiltered().changelog
+ repo.symbols = gethashsymbols(tree, len(cl))
for node in repo.symbols:
try:
node = cl._partialmatch(node)