##// END OF EJS Templates
histedit: extract a simpler function to process replacement on abort...
Pierre-Yves David -
r25898:4dcc9b5d default
parent child Browse files
Show More
@@ -778,7 +778,7 b' def _histedit(ui, repo, state, *freeargs'
778 return
778 return
779 elif goal == 'abort':
779 elif goal == 'abort':
780 state.read()
780 state.read()
781 mapping, tmpnodes, leafs, _ntm = processreplacement(state)
781 tmpnodes, leafs = newnodestoabort(state)
782 ui.debug('restore wc to old parent %s\n' % node.short(state.topmost))
782 ui.debug('restore wc to old parent %s\n' % node.short(state.topmost))
783
783
784 # Recover our old commits if necessary
784 # Recover our old commits if necessary
@@ -1009,6 +1009,25 b' def verifyrules(rules, repo, ctxs):'
1009 hint=_('do you want to use the drop action?'))
1009 hint=_('do you want to use the drop action?'))
1010 return parsed
1010 return parsed
1011
1011
1012 def newnodestoabort(state):
1013 """process the list of replacements to return
1014
1015 1) the list of final node
1016 2) the list of temporary node
1017
1018 This meant to be used on abort as less data are required in this case.
1019 """
1020 replacements = state.replacements
1021 allsuccs = set()
1022 replaced = set()
1023 for rep in replacements:
1024 allsuccs.update(rep[1])
1025 replaced.add(rep[0])
1026 newnodes = allsuccs - replaced
1027 tmpnodes = allsuccs & replaced
1028 return newnodes, tmpnodes
1029
1030
1012 def processreplacement(state):
1031 def processreplacement(state):
1013 """process the list of replacements to return
1032 """process the list of replacements to return
1014
1033
General Comments 0
You need to be logged in to leave comments. Login now