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