##// END OF EJS Templates
revset: avoid demandimport bug...
Matt Mackall -
r16417:b4b0c693 default
parent child Browse files
Show More
@@ -7,7 +7,7 b''
7 7
8 8 import re
9 9 import parser, util, error, discovery, hbisect, phases
10 import node as nodemod
10 import node
11 11 import bookmarks as bookmarksmod
12 12 import match as matchmod
13 13 from i18n import _
@@ -18,7 +18,7 b' def _revancestors(repo, revs, followfirs'
18 18 cut = followfirst and 1 or None
19 19 cl = repo.changelog
20 20 visit = list(revs)
21 seen = set([nodemod.nullrev])
21 seen = set([node.nullrev])
22 22 while visit:
23 23 for parent in cl.parentrevs(visit.pop(0))[:cut]:
24 24 if parent not in seen:
@@ -31,7 +31,8 b' def _revdescendants(repo, revs, followfi'
31 31 cut = followfirst and 1 or None
32 32 cl = repo.changelog
33 33 first = min(revs)
34 if first == nodemod.nullrev:
34 nullrev = node.nullrev
35 if first == nullrev:
35 36 # Are there nodes with a null first parent and a non-null
36 37 # second one? Maybe. Do we care? Probably not.
37 38 for i in cl:
@@ -41,7 +42,7 b' def _revdescendants(repo, revs, followfi'
41 42 seen = set(revs)
42 43 for i in xrange(first + 1, len(cl)):
43 44 for x in cl.parentrevs(i)[:cut]:
44 if x != nodemod.nullrev and x in seen:
45 if x != nullrev and x in seen:
45 46 seen.add(i)
46 47 yield i
47 48 break
@@ -724,7 +725,7 b' def modifies(repo, subset, x):'
724 725 pat = getstring(x, _("modifies requires a pattern"))
725 726 return checkstatus(repo, subset, pat, 0)
726 727
727 def node(repo, subset, x):
728 def node_(repo, subset, x):
728 729 """``id(string)``
729 730 Revision non-ambiguously specified by the given hex string prefix.
730 731 """
@@ -1125,7 +1126,7 b' symbols = {'
1125 1126 "grep": grep,
1126 1127 "head": head,
1127 1128 "heads": heads,
1128 "id": node,
1129 "id": node_,
1129 1130 "keyword": keyword,
1130 1131 "last": last,
1131 1132 "limit": limit,
@@ -1399,7 +1400,7 b' def formatspec(expr, *args):'
1399 1400 parse(arg) # make sure syntax errors are confined
1400 1401 return '(%s)' % arg
1401 1402 elif c == 'n':
1402 return quote(nodemod.hex(arg))
1403 return quote(node.hex(arg))
1403 1404 elif c == 'b':
1404 1405 return quote(arg.branch())
1405 1406
@@ -1414,7 +1415,7 b' def formatspec(expr, *args):'
1414 1415 elif t == 's':
1415 1416 return "_list('%s')" % "\0".join(s)
1416 1417 elif t == 'n':
1417 return "_list('%s')" % "\0".join(nodemod.hex(a) for a in s)
1418 return "_list('%s')" % "\0".join(node.hex(a) for a in s)
1418 1419 elif t == 'b':
1419 1420 return "_list('%s')" % "\0".join(a.branch() for a in s)
1420 1421
General Comments 0
You need to be logged in to leave comments. Login now