Show More
@@ -181,6 +181,22 b' class filerevnav(revnav):' | |||||
181 | def hex(self, rev): |
|
181 | def hex(self, rev): | |
182 | return hex(self._changelog.node(self._revlog.linkrev(rev))) |
|
182 | return hex(self._changelog.node(self._revlog.linkrev(rev))) | |
183 |
|
183 | |||
|
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: | |||
|
188 | d = { | |||
|
189 | 'node': s.hex(), | |||
|
190 | 'rev': s.rev(), | |||
|
191 | 'user': s.user(), | |||
|
192 | 'date': s.date(), | |||
|
193 | 'description': s.description(), | |||
|
194 | 'branch': s.branch(), | |||
|
195 | } | |||
|
196 | if util.safehasattr(s, 'path'): | |||
|
197 | d['file'] = s.path() | |||
|
198 | yield d | |||
|
199 | ||||
184 | class _siblings(object): |
|
200 | class _siblings(object): | |
185 | def __init__(self, siblings=None, hiderev=None): |
|
201 | def __init__(self, siblings=None, hiderev=None): | |
186 | if siblings is None: |
|
202 | if siblings is None: | |
@@ -190,18 +206,7 b' class _siblings(object):' | |||||
190 | self.siblings = [] |
|
206 | self.siblings = [] | |
191 |
|
207 | |||
192 | def __iter__(self): |
|
208 | def __iter__(self): | |
193 |
|
|
209 | return _ctxsgen(self.siblings) | |
194 | d = { |
|
|||
195 | 'node': s.hex(), |
|
|||
196 | 'rev': s.rev(), |
|
|||
197 | 'user': s.user(), |
|
|||
198 | 'date': s.date(), |
|
|||
199 | 'description': s.description(), |
|
|||
200 | 'branch': s.branch(), |
|
|||
201 | } |
|
|||
202 | if util.safehasattr(s, 'path'): |
|
|||
203 | d['file'] = s.path() |
|
|||
204 | yield d |
|
|||
205 |
|
210 | |||
206 | def __len__(self): |
|
211 | def __len__(self): | |
207 | return len(self.siblings) |
|
212 | return len(self.siblings) |
General Comments 0
You need to be logged in to leave comments.
Login now