Show More
@@ -181,16 +181,10 b' class filerevnav(revnav):' | |||
|
181 | 181 | def hex(self, rev): |
|
182 | 182 | return hex(self._changelog.node(self._revlog.linkrev(rev))) |
|
183 | 183 | |
|
184 | class _siblings(object): | |
|
185 | def __init__(self, siblings=None, hiderev=None): | |
|
186 | if siblings is None: | |
|
187 | siblings = [] | |
|
188 | self.siblings = [s for s in siblings if s.node() != nullid] | |
|
189 | if len(self.siblings) == 1 and self.siblings[0].rev() == hiderev: | |
|
190 | self.siblings = [] | |
|
191 | ||
|
192 | def __iter__(self): | |
|
193 | for s in self.siblings: | |
|
184 | # TODO: maybe this can be a wrapper class for changectx/filectx list, which | |
|
185 | # yields {'ctx': ctx} | |
|
186 | def _ctxsgen(ctxs): | |
|
187 | for s in ctxs: | |
|
194 | 188 |
|
|
195 | 189 |
|
|
196 | 190 |
|
@@ -203,6 +197,17 b' class _siblings(object):' | |||
|
203 | 197 |
|
|
204 | 198 |
|
|
205 | 199 | |
|
200 | class _siblings(object): | |
|
201 | def __init__(self, siblings=None, hiderev=None): | |
|
202 | if siblings is None: | |
|
203 | siblings = [] | |
|
204 | self.siblings = [s for s in siblings if s.node() != nullid] | |
|
205 | if len(self.siblings) == 1 and self.siblings[0].rev() == hiderev: | |
|
206 | self.siblings = [] | |
|
207 | ||
|
208 | def __iter__(self): | |
|
209 | return _ctxsgen(self.siblings) | |
|
210 | ||
|
206 | 211 | def __len__(self): |
|
207 | 212 | return len(self.siblings) |
|
208 | 213 |
General Comments 0
You need to be logged in to leave comments.
Login now