Show More
@@ -18,7 +18,6 b' from . import (' | |||
|
18 | 18 | encoding, |
|
19 | 19 | error, |
|
20 | 20 | revlog, |
|
21 | revset, | |
|
22 | 21 | util, |
|
23 | 22 | ) |
|
24 | 23 | |
@@ -186,10 +185,7 b' class changelog(revlog.revlog):' | |||
|
186 | 185 | return self._nodecache |
|
187 | 186 | |
|
188 | 187 | def reachableroots(self, minroot, heads, roots, includepath=False): |
|
189 |
r |
|
|
190 | rroots = revset.baseset(rroots) | |
|
191 | rroots.sort() | |
|
192 | return rroots | |
|
188 | return self.index.reachableroots2(minroot, heads, roots, includepath) | |
|
193 | 189 | |
|
194 | 190 | def headrevs(self): |
|
195 | 191 | if self.filteredrevs: |
@@ -92,7 +92,7 b' def reachablerootspure(repo, minroot, ro' | |||
|
92 | 92 | |
|
93 | 93 | If includepath is True, return (<roots>::<heads>).""" |
|
94 | 94 | if not roots: |
|
95 |
return |
|
|
95 | return [] | |
|
96 | 96 | parentrevs = repo.changelog.parentrevs |
|
97 | 97 | roots = set(roots) |
|
98 | 98 | visit = list(heads) |
@@ -123,8 +123,6 b' def reachablerootspure(repo, minroot, ro' | |||
|
123 | 123 | for parent in seen[rev]: |
|
124 | 124 | if parent in reachable: |
|
125 | 125 | reached(rev) |
|
126 | reachable = baseset(reachable) | |
|
127 | reachable.sort() | |
|
128 | 126 | return reachable |
|
129 | 127 | |
|
130 | 128 | def reachableroots(repo, roots, heads, includepath=False): |
@@ -137,9 +135,12 b' def reachableroots(repo, roots, heads, i' | |||
|
137 | 135 | roots = list(roots) |
|
138 | 136 | heads = list(heads) |
|
139 | 137 | try: |
|
140 |
re |
|
|
138 | revs = repo.changelog.reachableroots(minroot, heads, roots, includepath) | |
|
141 | 139 | except AttributeError: |
|
142 |
re |
|
|
140 | revs = reachablerootspure(repo, minroot, roots, heads, includepath) | |
|
141 | revs = baseset(revs) | |
|
142 | revs.sort() | |
|
143 | return revs | |
|
143 | 144 | |
|
144 | 145 | elements = { |
|
145 | 146 | # token-type: binding-strength, primary, prefix, infix, suffix |
@@ -96,9 +96,9 b' Test SEGV caused by bad revision passed ' | |||
|
96 | 96 | > print inst |
|
97 | 97 | > EOF |
|
98 | 98 | good heads: |
|
99 | 0: <baseset+ [0]> | |
|
100 | 1: <baseset+ [0]> | |
|
101 | -1: <baseset+ []> | |
|
99 | 0: [0] | |
|
100 | 1: [0] | |
|
101 | -1: [] | |
|
102 | 102 | bad heads: |
|
103 | 103 | 2: head out of range |
|
104 | 104 | 10000: head out of range |
@@ -106,14 +106,14 b' Test SEGV caused by bad revision passed ' | |||
|
106 | 106 | -10000: head out of range |
|
107 | 107 | None: an integer is required |
|
108 | 108 | good roots: |
|
109 | 0: <baseset+ [0]> | |
|
110 | 1: <baseset+ [1]> | |
|
111 |
-1: |
|
|
109 | 0: [0] | |
|
110 | 1: [1] | |
|
111 | -1: [-1] | |
|
112 | 112 | out-of-range roots are ignored: |
|
113 | 2: <baseset+ []> | |
|
114 |
10000: |
|
|
115 | -2: <baseset+ []> | |
|
116 |
-10000: |
|
|
113 | 2: [] | |
|
114 | 10000: [] | |
|
115 | -2: [] | |
|
116 | -10000: [] | |
|
117 | 117 | bad roots: |
|
118 | 118 | None: an integer is required |
|
119 | 119 |
General Comments 0
You need to be logged in to leave comments.
Login now