Debian Codegraph @

tests/test-histedit-no-backup.t

raw
1 #testcases abortcommand abortflag
2
3 #if abortflag
4 $ cat >> $HGRCPATH <<EOF
5 > [alias]
6 > abort = histedit --abort
7 > EOF
8 #endif
9
10 $ . "$TESTDIR/histedit-helpers.sh"
11
12 Enable extension used by this test
13 $ cat >>$HGRCPATH <<EOF
14 > [extensions]
15 > histedit=
16 > EOF
17
18 =================================
19 Test backup-bundle config option|
20 =================================
21 Repo setup:
22 $ hg init foo
23 $ cd foo
24 $ echo first>file
25 $ hg ci -qAm one
26 $ echo second>>file
27 $ hg ci -m two
28 $ echo third>>file
29 $ hg ci -m three
30 $ echo forth>>file
31 $ hg ci -m four
32 $ hg log -G --style compact
33 @ 3[tip] 7d5187087c79 1970-01-01 00:00 +0000 test
34 | four
35 |
36 o 2 80d23dfa866d 1970-01-01 00:00 +0000 test
37 | three
38 |
39 o 1 6153eb23e623 1970-01-01 00:00 +0000 test
40 | two
41 |
42 o 0 36b4bdd91f5b 1970-01-01 00:00 +0000 test
43 one
44
45 Test when `backup-bundle` config option is enabled:
46 $ hg histedit -r '36b4bdd91f5b' --commands - << EOF
47 > pick 36b4bdd91f5b 0 one
48 > pick 6153eb23e623 1 two
49 > roll 80d23dfa866d 2 three
50 > edit 7d5187087c79 3 four
51 > EOF
52 merging file
53 Editing (7d5187087c79), commit as needed now to split the change
54 (to edit 7d5187087c79, `hg histedit --continue` after making changes)
55 [240]
56 $ hg abort
57 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
58 saved backup bundle to $TESTTMP/foo/.hg/strip-backup/1d8f701c7b35-cf7be322-backup.hg
59 saved backup bundle to $TESTTMP/foo/.hg/strip-backup/5c0056670bce-b54b65d0-backup.hg
60
61 Test when `backup-bundle` config option is not enabled
62 Enable config option:
63 $ cat >>$HGRCPATH <<EOF
64 > [rewrite]
65 > backup-bundle = False
66 > EOF
67
68 $ hg histedit -r '36b4bdd91f5b' --commands - << EOF
69 > pick 36b4bdd91f5b 0 one
70 > pick 6153eb23e623 1 two
71 > roll 80d23dfa866d 2 three
72 > edit 7d5187087c79 3 four
73 > EOF
74 merging file
75 Editing (7d5187087c79), commit as needed now to split the change
76 (to edit 7d5187087c79, `hg histedit --continue` after making changes)
77 [240]
78
79 $ hg abort
80 1 files updated, 0 files merged, 0 files removed, 0 files unresolved