hgext/rebase.py
changeset 10678 da2a0c9c895d
parent 10677 f2558a8228be
child 10763 68a7b9ed3c71
equal deleted inserted replaced
10677:f2558a8228be 10678:da2a0c9c895d
   346 
   346 
   347 def updatemq(repo, state, skipped, **opts):
   347 def updatemq(repo, state, skipped, **opts):
   348     'Update rebased mq patches - finalize and then import them'
   348     'Update rebased mq patches - finalize and then import them'
   349     mqrebase = {}
   349     mqrebase = {}
   350     for p in repo.mq.applied:
   350     for p in repo.mq.applied:
   351         if repo[p.rev].rev() in state:
   351         if repo[p.node].rev() in state:
   352             repo.ui.debug('revision %d is an mq patch (%s), finalize it.\n' %
   352             repo.ui.debug('revision %d is an mq patch (%s), finalize it.\n' %
   353                                         (repo[p.rev].rev(), p.name))
   353                                         (repo[p.node].rev(), p.name))
   354             mqrebase[repo[p.rev].rev()] = (p.name, isagitpatch(repo, p.name))
   354             mqrebase[repo[p.node].rev()] = (p.name, isagitpatch(repo, p.name))
   355 
   355 
   356     if mqrebase:
   356     if mqrebase:
   357         repo.mq.finish(repo, mqrebase.keys())
   357         repo.mq.finish(repo, mqrebase.keys())
   358 
   358 
   359         # We must start import from the newest revision
   359         # We must start import from the newest revision
   446         dest = repo[dest].rev()
   446         dest = repo[dest].rev()
   447 
   447 
   448     # This check isn't strictly necessary, since mq detects commits over an
   448     # This check isn't strictly necessary, since mq detects commits over an
   449     # applied patch. But it prevents messing up the working directory when
   449     # applied patch. But it prevents messing up the working directory when
   450     # a partially completed rebase is blocked by mq.
   450     # a partially completed rebase is blocked by mq.
   451     if 'qtip' in repo.tags() and (repo[dest].hex() in
   451     if 'qtip' in repo.tags() and (repo[dest].node() in
   452                             [s.rev for s in repo.mq.applied]):
   452                             [s.node for s in repo.mq.applied]):
   453         raise util.Abort(_('cannot rebase onto an applied mq patch'))
   453         raise util.Abort(_('cannot rebase onto an applied mq patch'))
   454 
   454 
   455     if src:
   455     if src:
   456         commonbase = repo[src].ancestor(repo[dest])
   456         commonbase = repo[src].ancestor(repo[dest])
   457         if commonbase == repo[src]:
   457         if commonbase == repo[src]: