Show More
@@ -127,8 +127,7 b' class revnav(object):' | |||||
127 | The return is: |
|
127 | The return is: | |
128 | - a single element tuple |
|
128 | - a single element tuple | |
129 | - containing a dictionary with a `before` and `after` key |
|
129 | - containing a dictionary with a `before` and `after` key | |
130 | - values are generator functions taking arbitrary number of kwargs |
|
130 | - values are dictionaries with `label` and `node` keys | |
131 | - yield items are dictionaries with `label` and `node` keys |
|
|||
132 | """ |
|
131 | """ | |
133 | if not self: |
|
132 | if not self: | |
134 | # empty repo |
|
133 | # empty repo | |
@@ -143,22 +142,21 b' class revnav(object):' | |||||
143 | targets.sort() |
|
142 | targets.sort() | |
144 |
|
143 | |||
145 | first = self._first() |
|
144 | first = self._first() | |
146 |
navbefore = [ |
|
145 | navbefore = [{'label': '(%i)' % first, 'node': self.hex(first)}] | |
147 | navafter = [] |
|
146 | navafter = [] | |
148 | for rev in targets: |
|
147 | for rev in targets: | |
149 | if rev not in self._revlog: |
|
148 | if rev not in self._revlog: | |
150 | continue |
|
149 | continue | |
151 | if pos < rev < limit: |
|
150 | if pos < rev < limit: | |
152 |
navafter.append( |
|
151 | navafter.append({'label': '+%d' % abs(rev - pos), | |
|
152 | 'node': self.hex(rev)}) | |||
153 | if 0 < rev < pos: |
|
153 | if 0 < rev < pos: | |
154 |
navbefore.append( |
|
154 | navbefore.append({'label': '-%d' % abs(rev - pos), | |
155 |
|
155 | 'node': self.hex(rev)}) | ||
156 |
|
156 | |||
157 |
navafter.append( |
|
157 | navafter.append({'label': 'tip', 'node': 'tip'}) | |
158 |
|
158 | |||
159 | data = lambda i: {"label": i[0], "node": i[1]} |
|
159 | return ({'before': navbefore, 'after': navafter},) | |
160 | return ({'before': lambda **map: (data(i) for i in navbefore), |
|
|||
161 | 'after': lambda **map: (data(i) for i in navafter)},) |
|
|||
162 |
|
160 | |||
163 | class filerevnav(revnav): |
|
161 | class filerevnav(revnav): | |
164 |
|
162 |
General Comments 0
You need to be logged in to leave comments.
Login now