comparison hgext3rd/topic/__init__.py @ 3578:10c3e69bb5bf

branching: merge stable into default Some bugfix that we could use here (also getting ready for a release).
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 21 Mar 2018 15:24:51 +0100
parents 4a1dc4854648 cd4db75413a2
children 23f701c1cfcb
comparison
equal deleted inserted replaced
3577:279d8b610ac5 3578:10c3e69bb5bf
132 ) 132 )
133 133
134 from . import ( 134 from . import (
135 compat, 135 compat,
136 constants, 136 constants,
137 destination,
138 discovery,
139 evolvebits,
137 flow, 140 flow,
141 randomname,
138 revset as topicrevset, 142 revset as topicrevset,
139 destination,
140 stack, 143 stack,
141 topicmap, 144 topicmap,
142 discovery,
143 randomname
144 ) 145 )
145 146
146 if util.safehasattr(registrar, 'command'): 147 if util.safehasattr(registrar, 'command'):
147 commandfunc = registrar.command 148 commandfunc = registrar.command
148 else: # compat with hg < 4.3 149 else: # compat with hg < 4.3
238 # however t0 is related to 'currenttopic' which has no place here. 239 # however t0 is related to 'currenttopic' which has no place here.
239 return None 240 return None
240 revlist = stack.stack(self._repo, topic=topic) 241 revlist = stack.stack(self._repo, topic=topic)
241 try: 242 try:
242 return revlist.index(self.rev()) 243 return revlist.index(self.rev())
244 except ValueError:
245 if self.obsolete():
246 succ = evolvebits._singlesuccessor(self._repo, self)
247 if succ not in revlist:
248 return None
249 return revlist.index(succ)
243 except IndexError: 250 except IndexError:
244 # Lets move to the last ctx of the current topic 251 # Lets move to the last ctx of the current topic
245 return None 252 return None
246 context.basectx.topicidx = _contexttopicidx 253 context.basectx.topicidx = _contexttopicidx
247 254