Show More
@@ -506,7 +506,14 b' def histedit(ui, repo, *freeargs, **opts' | |||||
506 | (parentctxnode, rules, keep, topmost, replacements) = readstate(repo) |
|
506 | (parentctxnode, rules, keep, topmost, replacements) = readstate(repo) | |
507 | mapping, tmpnodes, leafs, _ntm = processreplacement(repo, replacements) |
|
507 | mapping, tmpnodes, leafs, _ntm = processreplacement(repo, replacements) | |
508 | ui.debug('restore wc to old parent %s\n' % node.short(topmost)) |
|
508 | ui.debug('restore wc to old parent %s\n' % node.short(topmost)) | |
509 | hg.clean(repo, topmost) |
|
509 | # check whether we should update away | |
|
510 | parentnodes = [c.node() for c in repo[None].parents()] | |||
|
511 | for n in leafs | set([parentctxnode]): | |||
|
512 | if n in parentnodes: | |||
|
513 | hg.clean(repo, topmost) | |||
|
514 | break | |||
|
515 | else: | |||
|
516 | pass | |||
510 | cleanupnode(ui, repo, 'created', tmpnodes) |
|
517 | cleanupnode(ui, repo, 'created', tmpnodes) | |
511 | cleanupnode(ui, repo, 'temp', leafs) |
|
518 | cleanupnode(ui, repo, 'temp', leafs) | |
512 | os.unlink(os.path.join(repo.path, 'histedit-state')) |
|
519 | os.unlink(os.path.join(repo.path, 'histedit-state')) |
@@ -169,13 +169,34 b' check state of working copy' | |||||
169 | o 0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b "a" |
|
169 | o 0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b "a" | |
170 |
|
170 | |||
171 |
|
171 | |||
172 | abort editing session |
|
172 | abort editing session, after first forcibly updating away | |
|
173 | $ hg up 0 | |||
|
174 | abort: histedit in progress | |||
|
175 | (use 'hg histedit --continue' or 'hg histedit --abort') | |||
|
176 | [255] | |||
|
177 | $ mv .hg/histedit-state .hg/histedit-state-ignore | |||
|
178 | $ hg up 0 | |||
|
179 | 0 files updated, 0 files merged, 3 files removed, 0 files unresolved | |||
|
180 | $ mv .hg/histedit-state-ignore .hg/histedit-state | |||
|
181 | $ hg sum | |||
|
182 | parent: 0:cb9a9f314b8b | |||
|
183 | a | |||
|
184 | branch: default | |||
|
185 | commit: 1 modified, 1 unknown (new branch head) | |||
|
186 | update: 6 new changesets (update) | |||
|
187 | hist: 2 remaining (histedit --continue) | |||
|
188 | ||||
173 | $ hg histedit --abort 2>&1 | fixbundle |
|
189 | $ hg histedit --abort 2>&1 | fixbundle | |
174 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
190 | [1] | |
|
191 | ||||
|
192 | modified files should survive the abort when we've moved away already | |||
|
193 | $ hg st | |||
|
194 | M e | |||
|
195 | ? edit.sh | |||
175 |
|
196 | |||
176 | $ graphlog "log after abort" |
|
197 | $ graphlog "log after abort" | |
177 | % log after abort |
|
198 | % log after abort | |
178 |
|
|
199 | o 5 652413bf663ef2a641cab26574e46d5f5a64a55a "f" | |
179 | | |
|
200 | | | |
180 | o 4 e860deea161a2f77de56603b340ebbb4536308ae "e" |
|
201 | o 4 e860deea161a2f77de56603b340ebbb4536308ae "e" | |
181 | | |
|
202 | | | |
@@ -185,7 +206,7 b' abort editing session' | |||||
185 | | |
|
206 | | | |
186 | o 1 d2ae7f538514cd87c17547b0de4cea71fe1af9fb "b" |
|
207 | o 1 d2ae7f538514cd87c17547b0de4cea71fe1af9fb "b" | |
187 | | |
|
208 | | | |
188 |
|
|
209 | @ 0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b "a" | |
189 |
|
|
210 | ||
190 |
|
211 | |||
191 | $ cd .. |
|
212 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now