comparison hgext/histedit.py @ 33350:b320ff822c7e

histedit: unify strip backup files on success (BC) Previously we wrote two different strip backup files on success. This patch unifies them. It will make scmutil.cleanupnodes migration more smooth.
author Jun Wu <quark@fb.com>
date Sat, 08 Jul 2017 16:50:31 -0700
parents 28f75a1695fb
children 154298576d44
comparison
equal deleted inserted replaced
33349:28f75a1695fb 33350:b320ff822c7e
1169 if len(succs) > 1: 1169 if len(succs) > 1:
1170 m = 'histedit: %s' 1170 m = 'histedit: %s'
1171 for n in succs[1:]: 1171 for n in succs[1:]:
1172 ui.debug(m % node.short(n)) 1172 ui.debug(m % node.short(n))
1173 1173
1174 safecleanupnode(ui, repo, tmpnodes)
1175
1176 if not state.keep: 1174 if not state.keep:
1177 if mapping: 1175 if mapping:
1178 movebookmarks(ui, repo, mapping, state.topmost, ntm) 1176 movebookmarks(ui, repo, mapping, state.topmost, ntm)
1179 # TODO update mq state 1177 # TODO update mq state
1180 safecleanupnode(ui, repo, mapping) 1178 else:
1179 mapping = {}
1180
1181 for n in tmpnodes:
1182 mapping[n] = ()
1183
1184 safecleanupnode(ui, repo, mapping)
1181 1185
1182 state.clear() 1186 state.clear()
1183 if os.path.exists(repo.sjoin('undo')): 1187 if os.path.exists(repo.sjoin('undo')):
1184 os.unlink(repo.sjoin('undo')) 1188 os.unlink(repo.sjoin('undo'))
1185 if repo.vfs.exists('histedit-last-edit.txt'): 1189 if repo.vfs.exists('histedit-last-edit.txt'):