Mercurial > hg > mercurial-crew-with-dirclash
comparison mercurial/revlog.py @ 902:c749ca37aed1
Add optional stop revision to revlog.heads
author | mason@suse.com |
---|---|
date | Sun, 14 Aug 2005 20:09:09 -0800 |
parents | 01215ad04283 |
children | 6d5a62a549fa |
comparison
equal
deleted
inserted
replaced
901:120cba94d5aa | 902:c749ca37aed1 |
---|---|
166 def start(self, rev): return self.index[rev][0] | 166 def start(self, rev): return self.index[rev][0] |
167 def length(self, rev): return self.index[rev][1] | 167 def length(self, rev): return self.index[rev][1] |
168 def end(self, rev): return self.start(rev) + self.length(rev) | 168 def end(self, rev): return self.start(rev) + self.length(rev) |
169 def base(self, rev): return self.index[rev][2] | 169 def base(self, rev): return self.index[rev][2] |
170 | 170 |
171 def heads(self): | 171 def heads(self, stop=None): |
172 p = {} | 172 p = {} |
173 h = [] | 173 h = [] |
174 stoprev = 0 | |
175 if stop and stop in self.nodemap: | |
176 stoprev = self.rev(stop) | |
177 | |
174 for r in range(self.count() - 1, -1, -1): | 178 for r in range(self.count() - 1, -1, -1): |
175 n = self.node(r) | 179 n = self.node(r) |
176 if n not in p: | 180 if n not in p: |
177 h.append(n) | 181 h.append(n) |
182 if n == stop: | |
183 break | |
184 if r < stoprev: | |
185 break | |
178 for pn in self.parents(n): | 186 for pn in self.parents(n): |
179 p[pn] = 1 | 187 p[pn] = 1 |
180 return h | 188 return h |
181 | 189 |
182 def children(self, node): | 190 def children(self, node): |