Show More
@@ -87,7 +87,7 def _revdescendants(repo, revs, followfi | |||
|
87 | 87 | |
|
88 | 88 | return generatorset(iterate(), iterasc=True) |
|
89 | 89 | |
|
90 |
def reachableroots(repo, roots, heads, includepath |
|
|
90 | def reachablerootspure(repo, minroot, roots, heads, includepath): | |
|
91 | 91 | """return (heads(::<roots> and ::<heads>)) |
|
92 | 92 | |
|
93 | 93 | If includepath is True, return (<roots>::<heads>).""" |
@@ -97,10 +97,6 def reachableroots(repo, roots, heads, i | |||
|
97 | 97 | visit = list(heads) |
|
98 | 98 | reachable = set() |
|
99 | 99 | seen = {} |
|
100 | # XXX this should be 'parentset.min()' assuming 'parentset' is a smartset | |
|
101 | # (and if it is not, it should.) | |
|
102 | minroot = min(roots) | |
|
103 | roots = set(roots) | |
|
104 | 100 | # prefetch all the things! (because python is slow) |
|
105 | 101 | reached = reachable.add |
|
106 | 102 | dovisit = visit.append |
@@ -128,6 +124,22 def reachableroots(repo, roots, heads, i | |||
|
128 | 124 | reached(rev) |
|
129 | 125 | return baseset(sorted(reachable)) |
|
130 | 126 | |
|
127 | def reachableroots(repo, roots, heads, includepath=False): | |
|
128 | """return (heads(::<roots> and ::<heads>)) | |
|
129 | ||
|
130 | If includepath is True, return (<roots>::<heads>).""" | |
|
131 | if not roots: | |
|
132 | return baseset() | |
|
133 | # XXX this should be 'parentset.min()' assuming 'parentset' is a smartset | |
|
134 | # (and if it is not, it should.) | |
|
135 | minroot = min(roots) | |
|
136 | roots = set(roots) | |
|
137 | heads = list(heads) | |
|
138 | try: | |
|
139 | return repo.changelog.reachableroots(minroot, heads, roots, includepath) | |
|
140 | except AttributeError: | |
|
141 | return reachablerootspure(repo, minroot, roots, heads, includepath) | |
|
142 | ||
|
131 | 143 | elements = { |
|
132 | 144 | # token-type: binding-strength, primary, prefix, infix, suffix |
|
133 | 145 | "(": (21, None, ("group", 1, ")"), ("func", 1, ")"), None), |
General Comments 0
You need to be logged in to leave comments.
Login now