Mercurial > hg
comparison tests/test-histedit-no-backup.t @ 38548:7b57b1ed5c0f
histedit: add --no-backup option (issue5825)
This option provides a functionality to not store a backup
while aborting histedit in between. Also added tests for the
same.
Differential Revision: https://phab.mercurial-scm.org/D3872
author | Sushil khanchi <sushilkhanchi97@gmail.com> |
---|---|
date | Fri, 22 Jun 2018 23:53:43 +0530 |
parents | |
children | c2586a6e5884 |
comparison
equal
deleted
inserted
replaced
38547:404eab7ff33f | 38548:7b57b1ed5c0f |
---|---|
1 $ . "$TESTDIR/histedit-helpers.sh" | |
2 | |
3 Enable extension used by this test | |
4 $ cat >>$HGRCPATH <<EOF | |
5 > [extensions] | |
6 > histedit= | |
7 > EOF | |
8 | |
9 Repo setup: | |
10 $ hg init foo | |
11 $ cd foo | |
12 $ echo first>file | |
13 $ hg ci -qAm one | |
14 $ echo second>>file | |
15 $ hg ci -m two | |
16 $ echo third>>file | |
17 $ hg ci -m three | |
18 $ echo forth>>file | |
19 $ hg ci -m four | |
20 $ hg log -G --style compact | |
21 @ 3[tip] 7d5187087c79 1970-01-01 00:00 +0000 test | |
22 | four | |
23 | | |
24 o 2 80d23dfa866d 1970-01-01 00:00 +0000 test | |
25 | three | |
26 | | |
27 o 1 6153eb23e623 1970-01-01 00:00 +0000 test | |
28 | two | |
29 | | |
30 o 0 36b4bdd91f5b 1970-01-01 00:00 +0000 test | |
31 one | |
32 | |
33 Check when --no-backup is not passed | |
34 $ hg histedit -r '36b4bdd91f5b' --commands - << EOF | |
35 > pick 36b4bdd91f5b 0 one | |
36 > pick 6153eb23e623 1 two | |
37 > roll 80d23dfa866d 2 three | |
38 > edit 7d5187087c79 3 four | |
39 > EOF | |
40 merging file | |
41 Editing (7d5187087c79), you may commit or record as needed now. | |
42 (hg histedit --continue to resume) | |
43 [1] | |
44 | |
45 $ hg histedit --abort | |
46 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
47 saved backup bundle to $TESTTMP/foo/.hg/strip-backup/1d8f701c7b35-cf7be322-backup.hg | |
48 saved backup bundle to $TESTTMP/foo/.hg/strip-backup/5c0056670bce-b54b65d0-backup.hg | |
49 | |
50 $ hg st | |
51 $ hg diff | |
52 $ hg log -G --style compact | |
53 @ 3[tip] 7d5187087c79 1970-01-01 00:00 +0000 test | |
54 | four | |
55 | | |
56 o 2 80d23dfa866d 1970-01-01 00:00 +0000 test | |
57 | three | |
58 | | |
59 o 1 6153eb23e623 1970-01-01 00:00 +0000 test | |
60 | two | |
61 | | |
62 o 0 36b4bdd91f5b 1970-01-01 00:00 +0000 test | |
63 one | |
64 | |
65 | |
66 Check when --no-backup is passed | |
67 $ hg histedit -r '36b4bdd91f5b' --commands - << EOF | |
68 > pick 36b4bdd91f5b 0 one | |
69 > pick 6153eb23e623 1 two | |
70 > roll 80d23dfa866d 2 three | |
71 > edit 7d5187087c79 3 four | |
72 > EOF | |
73 merging file | |
74 Editing (7d5187087c79), you may commit or record as needed now. | |
75 (hg histedit --continue to resume) | |
76 [1] | |
77 | |
78 $ hg histedit --abort --no-backup | |
79 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
80 | |
81 $ hg st | |
82 $ hg diff | |
83 $ hg log -G --style compact | |
84 @ 3[tip] 7d5187087c79 1970-01-01 00:00 +0000 test | |
85 | four | |
86 | | |
87 o 2 80d23dfa866d 1970-01-01 00:00 +0000 test | |
88 | three | |
89 | | |
90 o 1 6153eb23e623 1970-01-01 00:00 +0000 test | |
91 | two | |
92 | | |
93 o 0 36b4bdd91f5b 1970-01-01 00:00 +0000 test | |
94 one | |
95 |