Show More
@@ -87,9 +87,10 b' def _revdescendants(repo, revs, followfi' | |||||
87 |
|
87 | |||
88 | return generatorset(iterate(), iterasc=True) |
|
88 | return generatorset(iterate(), iterasc=True) | |
89 |
|
89 | |||
90 | def revsbetween(repo, roots, heads): |
|
90 | def reachableroots(repo, roots, heads, includepath=False): | |
91 | """Return all paths between roots and heads, inclusive of both endpoint |
|
91 | """return (heads(::<roots> and ::<heads>)) | |
92 | sets.""" |
|
92 | ||
|
93 | If includepath is True, return (<roots>::<heads>).""" | |||
93 | if not roots: |
|
94 | if not roots: | |
94 | return baseset() |
|
95 | return baseset() | |
95 | parentrevs = repo.changelog.parentrevs |
|
96 | parentrevs = repo.changelog.parentrevs | |
@@ -110,6 +111,8 b' def revsbetween(repo, roots, heads):' | |||||
110 | rev = nextvisit() |
|
111 | rev = nextvisit() | |
111 | if rev in roots: |
|
112 | if rev in roots: | |
112 | reached(rev) |
|
113 | reached(rev) | |
|
114 | if not includepath: | |||
|
115 | continue | |||
113 | parents = parentrevs(rev) |
|
116 | parents = parentrevs(rev) | |
114 | seen[rev] = parents |
|
117 | seen[rev] = parents | |
115 | for parent in parents: |
|
118 | for parent in parents: | |
@@ -117,6 +120,8 b' def revsbetween(repo, roots, heads):' | |||||
117 | dovisit(parent) |
|
120 | dovisit(parent) | |
118 | if not reachable: |
|
121 | if not reachable: | |
119 | return baseset() |
|
122 | return baseset() | |
|
123 | if not includepath: | |||
|
124 | return reachable | |||
120 | for rev in sorted(seen): |
|
125 | for rev in sorted(seen): | |
121 | for parent in seen[rev]: |
|
126 | for parent in seen[rev]: | |
122 | if parent in reachable: |
|
127 | if parent in reachable: | |
@@ -406,7 +411,8 b' def rangeset(repo, subset, x, y):' | |||||
406 |
|
411 | |||
407 | def dagrange(repo, subset, x, y): |
|
412 | def dagrange(repo, subset, x, y): | |
408 | r = fullreposet(repo) |
|
413 | r = fullreposet(repo) | |
409 |
xs = re |
|
414 | xs = reachableroots(repo, getset(repo, r, x), getset(repo, r, y), | |
|
415 | includepath=True) | |||
410 | # XXX We should combine with subset first: 'subset & baseset(...)'. This is |
|
416 | # XXX We should combine with subset first: 'subset & baseset(...)'. This is | |
411 | # necessary to ensure we preserve the order in subset. |
|
417 | # necessary to ensure we preserve the order in subset. | |
412 | return xs & subset |
|
418 | return xs & subset |
General Comments 0
You need to be logged in to leave comments.
Login now