hgext/histedit.py
changeset 25360 7d24a41200d3
parent 25186 80c5b2666a96
parent 25330 8594d0b3018e
child 25411 d298805fb639
equal deleted inserted replaced
25359:724421cb4745 25360:7d24a41200d3
   743                 raise util.Abort(
   743                 raise util.Abort(
   744                     _('histedit requires exactly one ancestor revision'))
   744                     _('histedit requires exactly one ancestor revision'))
   745 
   745 
   746 
   746 
   747     replacements = []
   747     replacements = []
   748     keep = opts.get('keep', False)
   748     state.keep = opts.get('keep', False)
   749 
   749 
   750     # rebuild state
   750     # rebuild state
   751     if goal == 'continue':
   751     if goal == 'continue':
   752         state.read()
   752         state.read()
   753         state = bootstrapcontinue(ui, state, opts)
   753         state = bootstrapcontinue(ui, state, opts)
   812             if len(rr) != 1:
   812             if len(rr) != 1:
   813                 raise util.Abort(_('The specified revisions must have '
   813                 raise util.Abort(_('The specified revisions must have '
   814                     'exactly one common root'))
   814                     'exactly one common root'))
   815             root = rr[0].node()
   815             root = rr[0].node()
   816 
   816 
   817         revs = between(repo, root, topmost, keep)
   817         revs = between(repo, root, topmost, state.keep)
   818         if not revs:
   818         if not revs:
   819             raise util.Abort(_('%s is not an ancestor of working directory') %
   819             raise util.Abort(_('%s is not an ancestor of working directory') %
   820                              node.short(root))
   820                              node.short(root))
   821 
   821 
   822         ctxs = [repo[r] for r in revs]
   822         ctxs = [repo[r] for r in revs]
   836 
   836 
   837         parentctxnode = repo[root].parents()[0].node()
   837         parentctxnode = repo[root].parents()[0].node()
   838 
   838 
   839         state.parentctxnode = parentctxnode
   839         state.parentctxnode = parentctxnode
   840         state.rules = rules
   840         state.rules = rules
   841         state.keep = keep
       
   842         state.topmost = topmost
   841         state.topmost = topmost
   843         state.replacements = replacements
   842         state.replacements = replacements
   844 
   843 
   845         # Create a backup so we can always abort completely.
   844         # Create a backup so we can always abort completely.
   846         backupfile = None
   845         backupfile = None
   872                 if len(succs) > 1:
   871                 if len(succs) > 1:
   873                     m = 'histedit:                            %s'
   872                     m = 'histedit:                            %s'
   874                     for n in succs[1:]:
   873                     for n in succs[1:]:
   875                         ui.debug(m % node.short(n))
   874                         ui.debug(m % node.short(n))
   876 
   875 
   877     if not keep:
   876     if not state.keep:
   878         if mapping:
   877         if mapping:
   879             movebookmarks(ui, repo, mapping, state.topmost, ntm)
   878             movebookmarks(ui, repo, mapping, state.topmost, ntm)
   880             # TODO update mq state
   879             # TODO update mq state
   881         if obsolete.isenabled(repo, obsolete.createmarkersopt):
   880         if obsolete.isenabled(repo, obsolete.createmarkersopt):
   882             markers = []
   881             markers = []