Show More
@@ -1919,6 +1919,14 b' def _aborthistedit(ui, repo, state, noba' | |||
|
1919 | 1919 | finally: |
|
1920 | 1920 | state.clear() |
|
1921 | 1921 | |
|
1922 | def hgaborthistedit(ui, repo): | |
|
1923 | state = histeditstate(repo) | |
|
1924 | nobackup = not ui.configbool('rewrite', 'backup-bundle') | |
|
1925 | with repo.wlock() as wlock, repo.lock() as lock: | |
|
1926 | state.wlock = wlock | |
|
1927 | state.lock = lock | |
|
1928 | _aborthistedit(ui, repo, state, nobackup=nobackup) | |
|
1929 | ||
|
1922 | 1930 | def _edithisteditplan(ui, repo, state, rules): |
|
1923 | 1931 | state.read() |
|
1924 | 1932 | if not rules: |
@@ -2314,5 +2322,5 b' def summaryhook(ui, repo):' | |||
|
2314 | 2322 | def extsetup(ui): |
|
2315 | 2323 | cmdutil.summaryhooks.add('histedit', summaryhook) |
|
2316 | 2324 | statemod.addunfinished('histedit', fname='histedit-state', allowcommit=True, |
|
2317 | continueflag=True) | |
|
2325 | continueflag=True, abortfunc=hgaborthistedit) | |
|
2318 | 2326 |
@@ -1,3 +1,12 b'' | |||
|
1 | #testcases abortcommand abortflag | |
|
2 | ||
|
3 | #if abortflag | |
|
4 | $ cat >> $HGRCPATH <<EOF | |
|
5 | > [alias] | |
|
6 | > abort = histedit --abort | |
|
7 | > EOF | |
|
8 | #endif | |
|
9 | ||
|
1 | 10 | Test argument handling and various data parsing |
|
2 | 11 |
================================================= |
|
3 | 12 | |
@@ -47,8 +56,9 b' histedit --continue/--abort with no exis' | |||
|
47 | 56 | $ hg histedit --continue |
|
48 | 57 | abort: no histedit in progress |
|
49 | 58 | [255] |
|
50 |
$ hg |
|
|
51 | abort: no histedit in progress | |
|
59 | $ hg abort | |
|
60 | abort: no histedit in progress (abortflag !) | |
|
61 | abort: no operation in progress (abortcommand !) | |
|
52 | 62 | [255] |
|
53 | 63 | |
|
54 | 64 | Run a dummy edit to make sure we get tip^^ correctly via revsingle. |
@@ -358,7 +368,7 b' Test that abort fails gracefully on exce' | |||
|
358 | 368 | Corrupt histedit state file |
|
359 | 369 | $ sed 's/8fda0c726bf2/123456789012/' .hg/histedit-state > ../corrupt-histedit |
|
360 | 370 | $ mv ../corrupt-histedit .hg/histedit-state |
|
361 |
$ hg |
|
|
371 | $ hg abort | |
|
362 | 372 | warning: encountered an exception during histedit --abort; the repository may not have been completely cleaned up |
|
363 | 373 | abort: $TESTTMP/foo/.hg/strip-backup/*-histedit.hg: $ENOENT$ (glob) (windows !) |
|
364 | 374 | abort: $ENOENT$: '$TESTTMP/foo/.hg/strip-backup/*-histedit.hg' (glob) (no-windows !) |
@@ -1,3 +1,12 b'' | |||
|
1 | #testcases abortcommand abortflag | |
|
2 | ||
|
3 | #if abortflag | |
|
4 | $ cat >> $HGRCPATH <<EOF | |
|
5 | > [alias] | |
|
6 | > abort = histedit --abort | |
|
7 | > EOF | |
|
8 | #endif | |
|
9 | ||
|
1 | 10 | $ . "$TESTDIR/histedit-helpers.sh" |
|
2 | 11 | |
|
3 | 12 | Enable extension used by this test |
@@ -44,7 +53,7 b' Test when `backup-bundle` config option ' | |||
|
44 | 53 | Editing (7d5187087c79), you may commit or record as needed now. |
|
45 | 54 | (hg histedit --continue to resume) |
|
46 | 55 | [1] |
|
47 |
$ hg |
|
|
56 | $ hg abort | |
|
48 | 57 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
49 | 58 | saved backup bundle to $TESTTMP/foo/.hg/strip-backup/1d8f701c7b35-cf7be322-backup.hg |
|
50 | 59 | saved backup bundle to $TESTTMP/foo/.hg/strip-backup/5c0056670bce-b54b65d0-backup.hg |
@@ -66,5 +75,6 b' Enable config option:' | |||
|
66 | 75 | Editing (7d5187087c79), you may commit or record as needed now. |
|
67 | 76 | (hg histedit --continue to resume) |
|
68 | 77 | [1] |
|
69 | $ hg histedit --abort | |
|
78 | ||
|
79 | $ hg abort | |
|
70 | 80 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
@@ -1,3 +1,12 b'' | |||
|
1 | #testcases abortcommand abortflag | |
|
2 | ||
|
3 | #if abortflag | |
|
4 | $ cat >> $HGRCPATH <<EOF | |
|
5 | > [alias] | |
|
6 | > abort = histedit --abort | |
|
7 | > EOF | |
|
8 | #endif | |
|
9 | ||
|
1 | 10 | $ . "$TESTDIR/histedit-helpers.sh" |
|
2 | 11 | |
|
3 | 12 | Enable obsolete |
@@ -522,7 +531,13 b' attempted later.' | |||
|
522 | 531 | (hg histedit --continue to resume) |
|
523 | 532 | [1] |
|
524 | 533 | |
|
525 | $ hg histedit --abort | |
|
534 | #if abortcommand | |
|
535 | when in dry-run mode | |
|
536 | $ hg abort --dry-run | |
|
537 | histedit in progress, will be aborted | |
|
538 | #endif | |
|
539 | ||
|
540 | $ hg abort | |
|
526 | 541 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
527 | 542 | saved backup bundle to $TESTTMP/abort/.hg/strip-backup/4dc06258baa6-dff4ef05-backup.hg |
|
528 | 543 |
General Comments 0
You need to be logged in to leave comments.
Login now