Show More
@@ -343,10 +343,10 b' def ancestor(repo, subset, x):' | |||
|
343 | 343 | return baseset() |
|
344 | 344 | |
|
345 | 345 | def _ancestors(repo, subset, x, followfirst=False): |
|
346 |
|
|
|
347 |
if not |
|
|
346 | heads = getset(repo, spanset(repo), x) | |
|
347 | if not heads: | |
|
348 | 348 | return baseset() |
|
349 |
s = _revancestors(repo, |
|
|
349 | s = _revancestors(repo, heads, followfirst) | |
|
350 | 350 | return subset.filter(s.__contains__) |
|
351 | 351 | |
|
352 | 352 | def ancestors(repo, subset, x): |
@@ -656,14 +656,14 b' def desc(repo, subset, x):' | |||
|
656 | 656 | return subset.filter(matches) |
|
657 | 657 | |
|
658 | 658 | def _descendants(repo, subset, x, followfirst=False): |
|
659 |
|
|
|
660 |
if not |
|
|
659 | roots = getset(repo, spanset(repo), x) | |
|
660 | if not roots: | |
|
661 | 661 | return baseset() |
|
662 |
s = _revdescendants(repo, |
|
|
662 | s = _revdescendants(repo, roots, followfirst) | |
|
663 | 663 | |
|
664 | 664 | # Both sets need to be ascending in order to lazily return the union |
|
665 | 665 | # in the correct order. |
|
666 |
base = subset & |
|
|
666 | base = subset & roots | |
|
667 | 667 | desc = subset & s |
|
668 | 668 | result = base + desc |
|
669 | 669 | if subset.isascending(): |
@@ -692,15 +692,15 b' def destination(repo, subset, x):' | |||
|
692 | 692 | is the same as passing all(). |
|
693 | 693 | """ |
|
694 | 694 | if x is not None: |
|
695 |
|
|
|
695 | sources = getset(repo, spanset(repo), x) | |
|
696 | 696 | else: |
|
697 |
|
|
|
697 | sources = getall(repo, spanset(repo), x) | |
|
698 | 698 | |
|
699 | 699 | dests = set() |
|
700 | 700 | |
|
701 | 701 | # subset contains all of the possible destinations that can be returned, so |
|
702 | # iterate over them and see if their source(s) were provided in the args. | |
|
703 | # Even if the immediate src of r is not in the args, src's source (or | |
|
702 | # iterate over them and see if their source(s) were provided in the arg set. | |
|
703 | # Even if the immediate src of r is not in the arg set, src's source (or | |
|
704 | 704 | # further back) may be. Scanning back further than the immediate src allows |
|
705 | 705 | # transitive transplants and rebases to yield the same results as transitive |
|
706 | 706 | # grafts. |
@@ -720,7 +720,7 b' def destination(repo, subset, x):' | |||
|
720 | 720 | # different iteration over subset. Likewise, if the src was already |
|
721 | 721 | # selected, the current lineage can be selected without going back |
|
722 | 722 | # further. |
|
723 |
if src in |
|
|
723 | if src in sources or src in dests: | |
|
724 | 724 | dests.update(lineage) |
|
725 | 725 | break |
|
726 | 726 | |
@@ -1151,9 +1151,9 b' def origin(repo, subset, x):' | |||
|
1151 | 1151 | for the first operation is selected. |
|
1152 | 1152 | """ |
|
1153 | 1153 | if x is not None: |
|
1154 |
|
|
|
1154 | dests = getset(repo, spanset(repo), x) | |
|
1155 | 1155 | else: |
|
1156 |
|
|
|
1156 | dests = getall(repo, spanset(repo), x) | |
|
1157 | 1157 | |
|
1158 | 1158 | def _firstsrc(rev): |
|
1159 | 1159 | src = _getrevsource(repo, rev) |
@@ -1167,7 +1167,7 b' def origin(repo, subset, x):' | |||
|
1167 | 1167 | return src |
|
1168 | 1168 | src = prev |
|
1169 | 1169 | |
|
1170 |
o = set([_firstsrc(r) for r in |
|
|
1170 | o = set([_firstsrc(r) for r in dests]) | |
|
1171 | 1171 | o -= set([None]) |
|
1172 | 1172 | return subset & o |
|
1173 | 1173 |
General Comments 0
You need to be logged in to leave comments.
Login now