mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
histedit: switch from util.Abort to util.InterventionRequired where appropriate (bc)
This commit is contained in:
parent
60b871ef75
commit
45ed657bf8
@ -301,8 +301,8 @@ def pick(ui, repo, ctx, ha, opts):
|
||||
hg.update(repo, ctx.node())
|
||||
stats = applychanges(ui, repo, oldctx, opts)
|
||||
if stats and stats[3] > 0:
|
||||
raise util.Abort(_('Fix up the change and run '
|
||||
'hg histedit --continue'))
|
||||
raise error.InterventionRequired(_('Fix up the change and run '
|
||||
'hg histedit --continue'))
|
||||
# drop the second merge parent
|
||||
commit = commitfuncfor(repo, oldctx)
|
||||
n = commit(text=oldctx.description(), user=oldctx.user(),
|
||||
@ -319,17 +319,17 @@ def edit(ui, repo, ctx, ha, opts):
|
||||
oldctx = repo[ha]
|
||||
hg.update(repo, ctx.node())
|
||||
applychanges(ui, repo, oldctx, opts)
|
||||
raise util.Abort(_('Make changes as needed, you may commit or record as '
|
||||
'needed now.\nWhen you are finished, run hg'
|
||||
' histedit --continue to resume.'))
|
||||
raise error.InterventionRequired(
|
||||
_('Make changes as needed, you may commit or record as needed now.\n'
|
||||
'When you are finished, run hg histedit --continue to resume.'))
|
||||
|
||||
def fold(ui, repo, ctx, ha, opts):
|
||||
oldctx = repo[ha]
|
||||
hg.update(repo, ctx.node())
|
||||
stats = applychanges(ui, repo, oldctx, opts)
|
||||
if stats and stats[3] > 0:
|
||||
raise util.Abort(_('Fix up the change and run '
|
||||
'hg histedit --continue'))
|
||||
raise error.InterventionRequired(
|
||||
_('Fix up the change and run hg histedit --continue'))
|
||||
n = repo.commit(text='fold-temp-revision %s' % ha, user=oldctx.user(),
|
||||
date=oldctx.date(), extra=oldctx.extra())
|
||||
if n is None:
|
||||
@ -390,8 +390,8 @@ def message(ui, repo, ctx, ha, opts):
|
||||
hg.update(repo, ctx.node())
|
||||
stats = applychanges(ui, repo, oldctx, opts)
|
||||
if stats and stats[3] > 0:
|
||||
raise util.Abort(_('Fix up the change and run '
|
||||
'hg histedit --continue'))
|
||||
raise error.InterventionRequired(
|
||||
_('Fix up the change and run hg histedit --continue'))
|
||||
message = oldctx.description() + '\n'
|
||||
message = ui.edit(message, ui.username())
|
||||
commit = commitfuncfor(repo, oldctx)
|
||||
|
@ -63,7 +63,7 @@ log before edit
|
||||
edit the history
|
||||
$ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
|
||||
0 files updated, 0 files merged, 2 files removed, 0 files unresolved
|
||||
abort: Make changes as needed, you may commit or record as needed now.
|
||||
Make changes as needed, you may commit or record as needed now.
|
||||
When you are finished, run hg histedit --continue to resume.
|
||||
|
||||
Go at a random point and try to continue
|
||||
@ -151,7 +151,7 @@ check histedit_source
|
||||
> EOF
|
||||
$ HGEDITOR="cat \"$EDITED\" > " hg histedit tip 2>&1 | fixbundle
|
||||
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
||||
abort: Make changes as needed, you may commit or record as needed now.
|
||||
Make changes as needed, you may commit or record as needed now.
|
||||
When you are finished, run hg histedit --continue to resume.
|
||||
$ hg status
|
||||
A f
|
||||
|
@ -91,7 +91,7 @@ edit the history
|
||||
merging e
|
||||
warning: conflicts during merge.
|
||||
merging e incomplete! (edit conflicts, then use 'hg resolve --mark')
|
||||
abort: Fix up the change and run hg histedit --continue
|
||||
Fix up the change and run hg histedit --continue
|
||||
|
||||
fix up
|
||||
$ echo 'I can haz no commute' > e
|
||||
@ -125,7 +125,7 @@ fix up
|
||||
merging e
|
||||
warning: conflicts during merge.
|
||||
merging e incomplete! (edit conflicts, then use 'hg resolve --mark')
|
||||
abort: Fix up the change and run hg histedit --continue
|
||||
Fix up the change and run hg histedit --continue
|
||||
|
||||
just continue this time
|
||||
$ hg revert -r 'p1()' e
|
||||
|
@ -182,7 +182,7 @@ folding and creating no new change doesn't break:
|
||||
merging file
|
||||
warning: conflicts during merge.
|
||||
merging file incomplete! (edit conflicts, then use 'hg resolve --mark')
|
||||
abort: Fix up the change and run hg histedit --continue
|
||||
Fix up the change and run hg histedit --continue
|
||||
[255]
|
||||
There were conflicts, we keep P1 content. This
|
||||
should effectively drop the changes from +6.
|
||||
@ -247,7 +247,7 @@ dropped revision.
|
||||
merging file
|
||||
warning: conflicts during merge.
|
||||
merging file incomplete! (edit conflicts, then use 'hg resolve --mark')
|
||||
abort: Fix up the change and run hg histedit --continue
|
||||
Fix up the change and run hg histedit --continue
|
||||
[255]
|
||||
$ cat > file << EOF
|
||||
> 1
|
||||
|
@ -92,7 +92,7 @@ editing a changeset without any actual change would corrupt the repository
|
||||
| edit e860deea161a 4 e
|
||||
| pick 652413bf663e 5 f
|
||||
0 files updated, 0 files merged, 2 files removed, 0 files unresolved
|
||||
abort: Make changes as needed, you may commit or record as needed now.
|
||||
Make changes as needed, you may commit or record as needed now.
|
||||
When you are finished, run hg histedit --continue to resume.
|
||||
$ continueediting true "(leaving commit message unaltered)"
|
||||
% finalize changeset editing (leaving commit message unaltered)
|
||||
@ -145,12 +145,12 @@ check state of working copy
|
||||
| edit e860deea161a 4 e
|
||||
| pick 652413bf663e 5 f
|
||||
0 files updated, 0 files merged, 3 files removed, 0 files unresolved
|
||||
abort: Make changes as needed, you may commit or record as needed now.
|
||||
Make changes as needed, you may commit or record as needed now.
|
||||
When you are finished, run hg histedit --continue to resume.
|
||||
$ continueediting true "(leaving commit message unaltered)"
|
||||
% finalize changeset editing (leaving commit message unaltered)
|
||||
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
||||
abort: Make changes as needed, you may commit or record as needed now.
|
||||
Make changes as needed, you may commit or record as needed now.
|
||||
When you are finished, run hg histedit --continue to resume.
|
||||
$ graphlog "log after first edit"
|
||||
% log after first edit
|
||||
|
@ -79,7 +79,7 @@ edit the history
|
||||
merging e
|
||||
warning: conflicts during merge.
|
||||
merging e incomplete! (edit conflicts, then use 'hg resolve --mark')
|
||||
abort: Fix up the change and run hg histedit --continue
|
||||
Fix up the change and run hg histedit --continue
|
||||
|
||||
|
||||
abort the edit
|
||||
|
@ -92,7 +92,7 @@ edit the history
|
||||
merging e
|
||||
warning: conflicts during merge.
|
||||
merging e incomplete! (edit conflicts, then use 'hg resolve --mark')
|
||||
abort: Fix up the change and run hg histedit --continue
|
||||
Fix up the change and run hg histedit --continue
|
||||
|
||||
abort the edit
|
||||
$ hg histedit --abort 2>&1 | fixbundle
|
||||
@ -150,7 +150,7 @@ edit the history
|
||||
merging e
|
||||
warning: conflicts during merge.
|
||||
merging e incomplete! (edit conflicts, then use 'hg resolve --mark')
|
||||
abort: Fix up the change and run hg histedit --continue
|
||||
Fix up the change and run hg histedit --continue
|
||||
|
||||
fix up
|
||||
$ echo 'I can haz no commute' > e
|
||||
@ -160,7 +160,7 @@ fix up
|
||||
merging e
|
||||
warning: conflicts during merge.
|
||||
merging e incomplete! (edit conflicts, then use 'hg resolve --mark')
|
||||
abort: Fix up the change and run hg histedit --continue
|
||||
Fix up the change and run hg histedit --continue
|
||||
|
||||
This failure is caused by 7b4e2f4b7bcd "e" not rebasing the non commutative
|
||||
former children.
|
||||
@ -236,7 +236,7 @@ edit the history, this time with a fold action
|
||||
merging e
|
||||
warning: conflicts during merge.
|
||||
merging e incomplete! (edit conflicts, then use 'hg resolve --mark')
|
||||
abort: Fix up the change and run hg histedit --continue
|
||||
Fix up the change and run hg histedit --continue
|
||||
|
||||
$ echo 'I can haz no commute' > e
|
||||
$ hg resolve --mark e
|
||||
@ -245,7 +245,7 @@ edit the history, this time with a fold action
|
||||
merging e
|
||||
warning: conflicts during merge.
|
||||
merging e incomplete! (edit conflicts, then use 'hg resolve --mark')
|
||||
abort: Fix up the change and run hg histedit --continue
|
||||
Fix up the change and run hg histedit --continue
|
||||
second edit also fails, but just continue
|
||||
$ hg revert -r 'p1()' e
|
||||
$ hg resolve --mark e
|
||||
|
@ -139,7 +139,7 @@ Test that rewriting leaving instability behind is allowed
|
||||
$ hg histedit -r '.' --commands commands.txt
|
||||
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
||||
adding c
|
||||
abort: Make changes as needed, you may commit or record as needed now.
|
||||
Make changes as needed, you may commit or record as needed now.
|
||||
When you are finished, run hg histedit --continue to resume.
|
||||
[255]
|
||||
$ echo c >> c
|
||||
@ -278,7 +278,7 @@ New-commit as draft (default)
|
||||
$ hg histedit -r 'b449568bf7fc' --commands commands.txt
|
||||
0 files updated, 0 files merged, 6 files removed, 0 files unresolved
|
||||
adding f
|
||||
abort: Make changes as needed, you may commit or record as needed now.
|
||||
Make changes as needed, you may commit or record as needed now.
|
||||
When you are finished, run hg histedit --continue to resume.
|
||||
[255]
|
||||
$ echo f >> f
|
||||
@ -328,7 +328,7 @@ New-commit as draft (default)
|
||||
$ hg histedit -r 'b449568bf7fc' --commands commands.txt
|
||||
0 files updated, 0 files merged, 6 files removed, 0 files unresolved
|
||||
adding f
|
||||
abort: Make changes as needed, you may commit or record as needed now.
|
||||
Make changes as needed, you may commit or record as needed now.
|
||||
When you are finished, run hg histedit --continue to resume.
|
||||
[255]
|
||||
$ echo f >> f
|
||||
|
Loading…
Reference in New Issue
Block a user