##// END OF EJS Templates
reachableroots: default to the C implementation...
Laurent Charignon -
r26006:1ffd97cb default
parent child Browse files
Show More
@@ -87,7 +87,7 def _revdescendants(repo, revs, followfi
87
87
88 return generatorset(iterate(), iterasc=True)
88 return generatorset(iterate(), iterasc=True)
89
89
90 def reachableroots(repo, roots, heads, includepath=False):
90 def reachablerootspure(repo, minroot, roots, heads, includepath):
91 """return (heads(::<roots> and ::<heads>))
91 """return (heads(::<roots> and ::<heads>))
92
92
93 If includepath is True, return (<roots>::<heads>)."""
93 If includepath is True, return (<roots>::<heads>)."""
@@ -97,10 +97,6 def reachableroots(repo, roots, heads, i
97 visit = list(heads)
97 visit = list(heads)
98 reachable = set()
98 reachable = set()
99 seen = {}
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 # prefetch all the things! (because python is slow)
100 # prefetch all the things! (because python is slow)
105 reached = reachable.add
101 reached = reachable.add
106 dovisit = visit.append
102 dovisit = visit.append
@@ -128,6 +124,22 def reachableroots(repo, roots, heads, i
128 reached(rev)
124 reached(rev)
129 return baseset(sorted(reachable))
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 elements = {
143 elements = {
132 # token-type: binding-strength, primary, prefix, infix, suffix
144 # token-type: binding-strength, primary, prefix, infix, suffix
133 "(": (21, None, ("group", 1, ")"), ("func", 1, ")"), None),
145 "(": (21, None, ("group", 1, ")"), ("func", 1, ")"), None),
General Comments 0
You need to be logged in to leave comments. Login now