Mercurial > hg
comparison tests/test-rebase-backup.t @ 38799:2002c193f2bc
rebase: support "history-editing-backup" config option
If you don't want to store any backup while rebasing, you can
use `history-editing-backup` config option.
[ui]
history-editing-backup = # True or False
Current status of list of commands which supports this config:
1. histedit
2. rebase
Differential Revision: https://phab.mercurial-scm.org/D3887
author | Sushil khanchi <sushilkhanchi97@gmail.com> |
---|---|
date | Thu, 05 Jul 2018 10:42:48 +0530 |
parents | |
children | 6acbe86c6490 |
comparison
equal
deleted
inserted
replaced
38798:d58958676b3c | 38799:2002c193f2bc |
---|---|
1 $ cat << EOF >> $HGRCPATH | |
2 > [extensions] | |
3 > rebase= | |
4 > EOF | |
5 | |
6 ========================================== | |
7 Test history-editing-backup config option | | |
8 ========================================== | |
9 Test with Pre-obsmarker rebase: | |
10 1) When config option is not set: | |
11 $ hg init repo1 | |
12 $ cd repo1 | |
13 $ echo a>a | |
14 $ hg ci -qAma | |
15 $ echo b>b | |
16 $ hg ci -qAmb | |
17 $ echo c>c | |
18 $ hg ci -qAmc | |
19 $ hg up 0 -q | |
20 $ echo d>d | |
21 $ hg ci -qAmd | |
22 $ echo e>e | |
23 $ hg ci -qAme | |
24 $ hg log -GT "{rev}: {firstline(desc)}\n" | |
25 @ 4: e | |
26 | | |
27 o 3: d | |
28 | | |
29 | o 2: c | |
30 | | | |
31 | o 1: b | |
32 |/ | |
33 o 0: a | |
34 | |
35 $ hg rebase -s 1 -d . | |
36 rebasing 1:d2ae7f538514 "b" | |
37 rebasing 2:177f92b77385 "c" | |
38 saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/d2ae7f538514-c7ed7a78-rebase.hg | |
39 $ hg log -GT "{rev}: {firstline(desc)}\n" | |
40 o 4: c | |
41 | | |
42 o 3: b | |
43 | | |
44 @ 2: e | |
45 | | |
46 o 1: d | |
47 | | |
48 o 0: a | |
49 | |
50 | |
51 2) When config option is set: | |
52 $ cat << EOF >> $HGRCPATH | |
53 > [ui] | |
54 > history-editing-backup = False | |
55 > EOF | |
56 | |
57 $ echo f>f | |
58 $ hg ci -Aqmf | |
59 $ echo g>g | |
60 $ hg ci -Aqmg | |
61 $ hg log -GT "{rev}: {firstline(desc)}\n" | |
62 @ 6: g | |
63 | | |
64 o 5: f | |
65 | | |
66 | o 4: c | |
67 | | | |
68 | o 3: b | |
69 |/ | |
70 o 2: e | |
71 | | |
72 o 1: d | |
73 | | |
74 o 0: a | |
75 | |
76 $ hg rebase -s 3 -d . | |
77 rebasing 3:05bff2a95b12 "b" | |
78 rebasing 4:1762bde4404d "c" | |
79 | |
80 $ hg log -GT "{rev}: {firstline(desc)}\n" | |
81 o 6: c | |
82 | | |
83 o 5: b | |
84 | | |
85 @ 4: g | |
86 | | |
87 o 3: f | |
88 | | |
89 o 2: e | |
90 | | |
91 o 1: d | |
92 | | |
93 o 0: a | |
94 | |
95 Test when rebased revisions are stripped during abort: | |
96 ====================================================== | |
97 | |
98 $ echo conflict > c | |
99 $ hg ci -Am "conflict with c" | |
100 adding c | |
101 created new head | |
102 $ hg log -GT "{rev}: {firstline(desc)}\n" | |
103 @ 7: conflict with c | |
104 | | |
105 | o 6: c | |
106 | | | |
107 | o 5: b | |
108 |/ | |
109 o 4: g | |
110 | | |
111 o 3: f | |
112 | | |
113 o 2: e | |
114 | | |
115 o 1: d | |
116 | | |
117 o 0: a | |
118 | |
119 When history-editing-backup = True: | |
120 $ cat << EOF >> $HGRCPATH | |
121 > [ui] | |
122 > history-editing-backup = True | |
123 > EOF | |
124 $ hg rebase -s 5 -d . | |
125 rebasing 5:1f8148a544ee "b" | |
126 rebasing 6:f8bc7d28e573 "c" | |
127 merging c | |
128 warning: conflicts while merging c! (edit, then use 'hg resolve --mark') | |
129 unresolved conflicts (see hg resolve, then hg rebase --continue) | |
130 [1] | |
131 $ hg rebase --abort | |
132 saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/818c1a43c916-2b644d96-backup.hg | |
133 rebase aborted | |
134 | |
135 When history-editing-backup = False: | |
136 $ cat << EOF >> $HGRCPATH | |
137 > [ui] | |
138 > history-editing-backup = False | |
139 > EOF | |
140 $ hg rebase -s 5 -d . | |
141 rebasing 5:1f8148a544ee "b" | |
142 rebasing 6:f8bc7d28e573 "c" | |
143 merging c | |
144 warning: conflicts while merging c! (edit, then use 'hg resolve --mark') | |
145 unresolved conflicts (see hg resolve, then hg rebase --continue) | |
146 [1] | |
147 $ hg rebase --abort | |
148 rebase aborted | |
149 $ cd .. | |
150 |