Show More
@@ -1,50 +1,196 b'' | |||
|
1 | 1 | Rebasing using a single transaction |
|
2 | 2 | |
|
3 | 3 | $ cat >> $HGRCPATH <<EOF |
|
4 | 4 | > [extensions] |
|
5 | 5 | > rebase= |
|
6 | 6 | > drawdag=$TESTDIR/drawdag.py |
|
7 | 7 | > |
|
8 | 8 | > [rebase] |
|
9 | 9 | > singletransaction=True |
|
10 | 10 | > |
|
11 | 11 | > [phases] |
|
12 | 12 | > publish=False |
|
13 | 13 | > |
|
14 | 14 | > [alias] |
|
15 | 15 | > tglog = log -G --template "{rev}: {desc}" |
|
16 | 16 | > EOF |
|
17 | 17 | |
|
18 | 18 | Check that a simple rebase works |
|
19 | 19 | |
|
20 | 20 | $ hg init simple && cd simple |
|
21 | 21 | $ hg debugdrawdag <<'EOF' |
|
22 | 22 | > Z |
|
23 | 23 | > | |
|
24 | 24 | > | D |
|
25 | 25 | > | | |
|
26 | 26 | > | C |
|
27 | 27 | > | | |
|
28 | 28 | > Y B |
|
29 | 29 | > |/ |
|
30 | 30 | > A |
|
31 | 31 | > EOF |
|
32 | 32 | - We should only see two status stored messages. One from the start, one from |
|
33 | 33 | - the end. |
|
34 | 34 | $ hg rebase --debug -b D -d Z | grep 'status stored' |
|
35 | 35 | rebase status stored |
|
36 | 36 | rebase status stored |
|
37 | 37 | $ hg tglog |
|
38 | 38 | o 5: D |
|
39 | 39 | | |
|
40 | 40 | o 4: C |
|
41 | 41 | | |
|
42 | 42 | o 3: B |
|
43 | 43 | | |
|
44 | 44 | o 2: Z |
|
45 | 45 | | |
|
46 | 46 | o 1: Y |
|
47 | 47 | | |
|
48 | 48 | o 0: A |
|
49 | 49 | |
|
50 | 50 | $ cd .. |
|
51 | ||
|
52 | Check that --collapse works | |
|
53 | ||
|
54 | $ hg init collapse && cd collapse | |
|
55 | $ hg debugdrawdag <<'EOF' | |
|
56 | > Z | |
|
57 | > | | |
|
58 | > | D | |
|
59 | > | | | |
|
60 | > | C | |
|
61 | > | | | |
|
62 | > Y B | |
|
63 | > |/ | |
|
64 | > A | |
|
65 | > EOF | |
|
66 | - We should only see two status stored messages. One from the start, one from | |
|
67 | - the end. | |
|
68 | $ hg rebase --collapse --debug -b D -d Z | grep 'status stored' | |
|
69 | rebase status stored | |
|
70 | rebase status stored | |
|
71 | $ hg tglog | |
|
72 | o 3: Collapsed revision | |
|
73 | | * B | |
|
74 | | * C | |
|
75 | | * D | |
|
76 | o 2: Z | |
|
77 | | | |
|
78 | o 1: Y | |
|
79 | | | |
|
80 | o 0: A | |
|
81 | ||
|
82 | $ cd .. | |
|
83 | ||
|
84 | With --collapse, check that conflicts can be resolved and rebase can then be | |
|
85 | continued | |
|
86 | ||
|
87 | $ hg init collapse-conflict && cd collapse-conflict | |
|
88 | $ hg debugdrawdag <<'EOF' | |
|
89 | > Z # Z/conflict=Z | |
|
90 | > | | |
|
91 | > | D | |
|
92 | > | | | |
|
93 | > | C # C/conflict=C | |
|
94 | > | | | |
|
95 | > Y B | |
|
96 | > |/ | |
|
97 | > A | |
|
98 | > EOF | |
|
99 | $ hg rebase --collapse -b D -d Z | |
|
100 | rebasing 1:112478962961 "B" (B) | |
|
101 | rebasing 3:c26739dbe603 "C" (C) | |
|
102 | merging conflict | |
|
103 | warning: conflicts while merging conflict! (edit, then use 'hg resolve --mark') | |
|
104 | unresolved conflicts (see hg resolve, then hg rebase --continue) | |
|
105 | [1] | |
|
106 | $ hg tglog | |
|
107 | o 5: D | |
|
108 | | | |
|
109 | | @ 4: Z | |
|
110 | | | | |
|
111 | @ | 3: C | |
|
112 | | | | |
|
113 | | o 2: Y | |
|
114 | | | | |
|
115 | o | 1: B | |
|
116 | |/ | |
|
117 | o 0: A | |
|
118 | ||
|
119 | $ hg st | |
|
120 | M C | |
|
121 | M conflict | |
|
122 | A B | |
|
123 | ? conflict.orig | |
|
124 | $ echo resolved > conflict | |
|
125 | $ hg resolve -m | |
|
126 | (no more unresolved files) | |
|
127 | continue: hg rebase --continue | |
|
128 | $ hg rebase --continue | |
|
129 | already rebased 1:112478962961 "B" (B) as 79bc8f4973ce | |
|
130 | rebasing 3:c26739dbe603 "C" (C) | |
|
131 | rebasing 5:d24bb333861c "D" (D tip) | |
|
132 | saved backup bundle to $TESTTMP/collapse-conflict/.hg/strip-backup/112478962961-b5b34645-rebase.hg | |
|
133 | $ hg tglog | |
|
134 | o 3: Collapsed revision | |
|
135 | | * B | |
|
136 | | * C | |
|
137 | | * D | |
|
138 | o 2: Z | |
|
139 | | | |
|
140 | o 1: Y | |
|
141 | | | |
|
142 | o 0: A | |
|
143 | ||
|
144 | $ cd .. | |
|
145 | ||
|
146 | With --collapse, check that the commit message editing can be canceled and | |
|
147 | rebase can then be continued | |
|
148 | ||
|
149 | $ hg init collapse-cancel-editor && cd collapse-cancel-editor | |
|
150 | $ hg debugdrawdag <<'EOF' | |
|
151 | > Z | |
|
152 | > | | |
|
153 | > | D | |
|
154 | > | | | |
|
155 | > | C | |
|
156 | > | | | |
|
157 | > Y B | |
|
158 | > |/ | |
|
159 | > A | |
|
160 | > EOF | |
|
161 | $ HGEDITOR=false hg --config ui.interactive=1 rebase --collapse -b D -d Z | |
|
162 | rebasing 1:112478962961 "B" (B) | |
|
163 | rebasing 3:26805aba1e60 "C" (C) | |
|
164 | rebasing 5:f585351a92f8 "D" (D tip) | |
|
165 | abort: edit failed: false exited with status 1 | |
|
166 | [255] | |
|
167 | $ hg tglog | |
|
168 | o 5: D | |
|
169 | | | |
|
170 | | @ 4: Z | |
|
171 | | | | |
|
172 | o | 3: C | |
|
173 | | | | |
|
174 | | o 2: Y | |
|
175 | | | | |
|
176 | o | 1: B | |
|
177 | |/ | |
|
178 | o 0: A | |
|
179 | ||
|
180 | $ hg rebase --continue | |
|
181 | already rebased 1:112478962961 "B" (B) as e9b22a392ce0 | |
|
182 | already rebased 3:26805aba1e60 "C" (C) as e9b22a392ce0 | |
|
183 | already rebased 5:f585351a92f8 "D" (D tip) as e9b22a392ce0 | |
|
184 | saved backup bundle to $TESTTMP/collapse-cancel-editor/.hg/strip-backup/112478962961-cb2a9b47-rebase.hg | |
|
185 | $ hg tglog | |
|
186 | o 3: Collapsed revision | |
|
187 | | * B | |
|
188 | | * C | |
|
189 | | * D | |
|
190 | o 2: Z | |
|
191 | | | |
|
192 | o 1: Y | |
|
193 | | | |
|
194 | o 0: A | |
|
195 | ||
|
196 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now