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