Show More
@@ -1,554 +1,554 b'' | |||||
1 | Test argument handling and various data parsing |
|
1 | Test argument handling and various data parsing | |
2 | ================================================== |
|
2 | ================================================== | |
3 |
|
3 | |||
4 |
|
4 | |||
5 | Enable extensions used by this test. |
|
5 | Enable extensions used by this test. | |
6 | $ cat >>$HGRCPATH <<EOF |
|
6 | $ cat >>$HGRCPATH <<EOF | |
7 | > [extensions] |
|
7 | > [extensions] | |
8 | > histedit= |
|
8 | > histedit= | |
9 | > EOF |
|
9 | > EOF | |
10 |
|
10 | |||
11 | Repo setup. |
|
11 | Repo setup. | |
12 | $ hg init foo |
|
12 | $ hg init foo | |
13 | $ cd foo |
|
13 | $ cd foo | |
14 | $ echo alpha >> alpha |
|
14 | $ echo alpha >> alpha | |
15 | $ hg addr |
|
15 | $ hg addr | |
16 | adding alpha |
|
16 | adding alpha | |
17 | $ hg ci -m one |
|
17 | $ hg ci -m one | |
18 | $ echo alpha >> alpha |
|
18 | $ echo alpha >> alpha | |
19 | $ hg ci -m two |
|
19 | $ hg ci -m two | |
20 | $ echo alpha >> alpha |
|
20 | $ echo alpha >> alpha | |
21 | $ hg ci -m three |
|
21 | $ hg ci -m three | |
22 | $ echo alpha >> alpha |
|
22 | $ echo alpha >> alpha | |
23 | $ hg ci -m four |
|
23 | $ hg ci -m four | |
24 | $ echo alpha >> alpha |
|
24 | $ echo alpha >> alpha | |
25 | $ hg ci -m five |
|
25 | $ hg ci -m five | |
26 |
|
26 | |||
27 | $ hg log --style compact --graph |
|
27 | $ hg log --style compact --graph | |
28 | @ 4[tip] 08d98a8350f3 1970-01-01 00:00 +0000 test |
|
28 | @ 4[tip] 08d98a8350f3 1970-01-01 00:00 +0000 test | |
29 | | five |
|
29 | | five | |
30 | | |
|
30 | | | |
31 | o 3 c8e68270e35a 1970-01-01 00:00 +0000 test |
|
31 | o 3 c8e68270e35a 1970-01-01 00:00 +0000 test | |
32 | | four |
|
32 | | four | |
33 | | |
|
33 | | | |
34 | o 2 eb57da33312f 1970-01-01 00:00 +0000 test |
|
34 | o 2 eb57da33312f 1970-01-01 00:00 +0000 test | |
35 | | three |
|
35 | | three | |
36 | | |
|
36 | | | |
37 | o 1 579e40513370 1970-01-01 00:00 +0000 test |
|
37 | o 1 579e40513370 1970-01-01 00:00 +0000 test | |
38 | | two |
|
38 | | two | |
39 | | |
|
39 | | | |
40 | o 0 6058cbb6cfd7 1970-01-01 00:00 +0000 test |
|
40 | o 0 6058cbb6cfd7 1970-01-01 00:00 +0000 test | |
41 | one |
|
41 | one | |
42 |
|
42 | |||
43 |
|
43 | |||
44 | histedit --continue/--abort with no existing state |
|
44 | histedit --continue/--abort with no existing state | |
45 | -------------------------------------------------- |
|
45 | -------------------------------------------------- | |
46 |
|
46 | |||
47 | $ hg histedit --continue |
|
47 | $ hg histedit --continue | |
48 | abort: no histedit in progress |
|
48 | abort: no histedit in progress | |
49 | [255] |
|
49 | [255] | |
50 | $ hg histedit --abort |
|
50 | $ hg histedit --abort | |
51 | abort: no histedit in progress |
|
51 | abort: no histedit in progress | |
52 | [255] |
|
52 | [255] | |
53 |
|
53 | |||
54 | Run a dummy edit to make sure we get tip^^ correctly via revsingle. |
|
54 | Run a dummy edit to make sure we get tip^^ correctly via revsingle. | |
55 | -------------------------------------------------------------------- |
|
55 | -------------------------------------------------------------------- | |
56 |
|
56 | |||
57 | $ HGEDITOR=cat hg histedit "tip^^" |
|
57 | $ HGEDITOR=cat hg histedit "tip^^" | |
58 | pick eb57da33312f 2 three |
|
58 | pick eb57da33312f 2 three | |
59 | pick c8e68270e35a 3 four |
|
59 | pick c8e68270e35a 3 four | |
60 | pick 08d98a8350f3 4 five |
|
60 | pick 08d98a8350f3 4 five | |
61 |
|
61 | |||
62 | # Edit history between eb57da33312f and 08d98a8350f3 |
|
62 | # Edit history between eb57da33312f and 08d98a8350f3 | |
63 | # |
|
63 | # | |
64 | # Commits are listed from least to most recent |
|
64 | # Commits are listed from least to most recent | |
65 | # |
|
65 | # | |
66 | # You can reorder changesets by reordering the lines |
|
66 | # You can reorder changesets by reordering the lines | |
67 | # |
|
67 | # | |
68 | # Commands: |
|
68 | # Commands: | |
69 | # |
|
69 | # | |
70 | # e, edit = use commit, but stop for amending |
|
70 | # e, edit = use commit, but stop for amending | |
71 | # m, mess = edit commit message without changing commit content |
|
71 | # m, mess = edit commit message without changing commit content | |
72 | # p, pick = use commit |
|
72 | # p, pick = use commit | |
73 | # b, base = checkout changeset and apply further changesets from there |
|
73 | # b, base = checkout changeset and apply further changesets from there | |
74 | # d, drop = remove commit from history |
|
74 | # d, drop = remove commit from history | |
75 | # f, fold = use commit, but combine it with the one above |
|
75 | # f, fold = use commit, but combine it with the one above | |
76 | # r, roll = like fold, but discard this commit's description and date |
|
76 | # r, roll = like fold, but discard this commit's description and date | |
77 | # |
|
77 | # | |
78 |
|
78 | |||
79 | Run on a revision not ancestors of the current working directory. |
|
79 | Run on a revision not ancestors of the current working directory. | |
80 | -------------------------------------------------------------------- |
|
80 | -------------------------------------------------------------------- | |
81 |
|
81 | |||
82 | $ hg up 2 |
|
82 | $ hg up 2 | |
83 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
83 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
84 | $ hg histedit -r 4 |
|
84 | $ hg histedit -r 4 | |
85 | abort: 08d98a8350f3 is not an ancestor of working directory |
|
85 | abort: 08d98a8350f3 is not an ancestor of working directory | |
86 | [255] |
|
86 | [255] | |
87 | $ hg up --quiet |
|
87 | $ hg up --quiet | |
88 |
|
88 | |||
89 |
|
89 | |||
90 | Test that we pick the minimum of a revrange |
|
90 | Test that we pick the minimum of a revrange | |
91 | --------------------------------------- |
|
91 | --------------------------------------- | |
92 |
|
92 | |||
93 | $ HGEDITOR=cat hg histedit '2::' --commands - << EOF |
|
93 | $ HGEDITOR=cat hg histedit '2::' --commands - << EOF | |
94 | > pick eb57da33312f 2 three |
|
94 | > pick eb57da33312f 2 three | |
95 | > pick c8e68270e35a 3 four |
|
95 | > pick c8e68270e35a 3 four | |
96 | > pick 08d98a8350f3 4 five |
|
96 | > pick 08d98a8350f3 4 five | |
97 | > EOF |
|
97 | > EOF | |
98 | $ hg up --quiet |
|
98 | $ hg up --quiet | |
99 |
|
99 | |||
100 | $ HGEDITOR=cat hg histedit 'tip:2' --commands - << EOF |
|
100 | $ HGEDITOR=cat hg histedit 'tip:2' --commands - << EOF | |
101 | > pick eb57da33312f 2 three |
|
101 | > pick eb57da33312f 2 three | |
102 | > pick c8e68270e35a 3 four |
|
102 | > pick c8e68270e35a 3 four | |
103 | > pick 08d98a8350f3 4 five |
|
103 | > pick 08d98a8350f3 4 five | |
104 | > EOF |
|
104 | > EOF | |
105 | $ hg up --quiet |
|
105 | $ hg up --quiet | |
106 |
|
106 | |||
107 | Test config specified default |
|
107 | Test config specified default | |
108 | ----------------------------- |
|
108 | ----------------------------- | |
109 |
|
109 | |||
110 | $ HGEDITOR=cat hg histedit --config "histedit.defaultrev=only(.) - ::eb57da33312f" --commands - << EOF |
|
110 | $ HGEDITOR=cat hg histedit --config "histedit.defaultrev=only(.) - ::eb57da33312f" --commands - << EOF | |
111 | > pick c8e68270e35a 3 four |
|
111 | > pick c8e68270e35a 3 four | |
112 | > pick 08d98a8350f3 4 five |
|
112 | > pick 08d98a8350f3 4 five | |
113 | > EOF |
|
113 | > EOF | |
114 |
|
114 | |||
115 | Run on a revision not descendants of the initial parent |
|
115 | Run on a revision not descendants of the initial parent | |
116 | -------------------------------------------------------------------- |
|
116 | -------------------------------------------------------------------- | |
117 |
|
117 | |||
118 | Test the message shown for inconsistent histedit state, which may be |
|
118 | Test the message shown for inconsistent histedit state, which may be | |
119 | created (and forgotten) by Mercurial earlier than 2.7. This emulates |
|
119 | created (and forgotten) by Mercurial earlier than 2.7. This emulates | |
120 | Mercurial earlier than 2.7 by renaming ".hg/histedit-state" |
|
120 | Mercurial earlier than 2.7 by renaming ".hg/histedit-state" | |
121 | temporarily. |
|
121 | temporarily. | |
122 |
|
122 | |||
123 | $ hg log -G -T '{rev} {shortest(node)} {desc}\n' -r 2:: |
|
123 | $ hg log -G -T '{rev} {shortest(node)} {desc}\n' -r 2:: | |
124 | @ 4 08d9 five |
|
124 | @ 4 08d9 five | |
125 | | |
|
125 | | | |
126 | o 3 c8e6 four |
|
126 | o 3 c8e6 four | |
127 | | |
|
127 | | | |
128 | o 2 eb57 three |
|
128 | o 2 eb57 three | |
129 | | |
|
129 | | | |
130 | ~ |
|
130 | ~ | |
131 | $ HGEDITOR=cat hg histedit -r 4 --commands - << EOF |
|
131 | $ HGEDITOR=cat hg histedit -r 4 --commands - << EOF | |
132 | > edit 08d98a8350f3 4 five |
|
132 | > edit 08d98a8350f3 4 five | |
133 | > EOF |
|
133 | > EOF | |
134 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
134 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
135 | reverting alpha |
|
135 | reverting alpha | |
136 | Editing (08d98a8350f3), you may commit or record as needed now. |
|
136 | Editing (08d98a8350f3), you may commit or record as needed now. | |
137 | (hg histedit --continue to resume) |
|
137 | (hg histedit --continue to resume) | |
138 | [1] |
|
138 | [1] | |
139 |
|
139 | |||
140 | $ hg graft --continue |
|
140 | $ hg graft --continue | |
141 | abort: no graft in progress |
|
141 | abort: no graft in progress | |
142 | (continue: hg histedit --continue) |
|
142 | (continue: hg histedit --continue) | |
143 | [255] |
|
143 | [255] | |
144 |
|
144 | |||
145 | $ mv .hg/histedit-state .hg/histedit-state.back |
|
145 | $ mv .hg/histedit-state .hg/histedit-state.back | |
146 | $ hg update --quiet --clean 2 |
|
146 | $ hg update --quiet --clean 2 | |
147 | $ echo alpha >> alpha |
|
147 | $ echo alpha >> alpha | |
148 | $ mv .hg/histedit-state.back .hg/histedit-state |
|
148 | $ mv .hg/histedit-state.back .hg/histedit-state | |
149 |
|
149 | |||
150 | $ hg histedit --continue |
|
150 | $ hg histedit --continue | |
151 | saved backup bundle to $TESTTMP/foo/.hg/strip-backup/08d98a8350f3-02594089-histedit.hg |
|
151 | saved backup bundle to $TESTTMP/foo/.hg/strip-backup/08d98a8350f3-02594089-histedit.hg | |
152 | $ hg log -G -T '{rev} {shortest(node)} {desc}\n' -r 2:: |
|
152 | $ hg log -G -T '{rev} {shortest(node)} {desc}\n' -r 2:: | |
153 | @ 4 f5ed five |
|
153 | @ 4 f5ed five | |
154 | | |
|
154 | | | |
155 | | o 3 c8e6 four |
|
155 | | o 3 c8e6 four | |
156 | |/ |
|
156 | |/ | |
157 | o 2 eb57 three |
|
157 | o 2 eb57 three | |
158 | | |
|
158 | | | |
159 | ~ |
|
159 | ~ | |
160 |
|
160 | |||
161 | $ hg unbundle -q $TESTTMP/foo/.hg/strip-backup/08d98a8350f3-02594089-histedit.hg |
|
161 | $ hg unbundle -q $TESTTMP/foo/.hg/strip-backup/08d98a8350f3-02594089-histedit.hg | |
162 | $ hg strip -q -r f5ed --config extensions.strip= |
|
162 | $ hg strip -q -r f5ed --config extensions.strip= | |
163 | $ hg up -q 08d98a8350f3 |
|
163 | $ hg up -q 08d98a8350f3 | |
164 |
|
164 | |||
165 | Test that missing revisions are detected |
|
165 | Test that missing revisions are detected | |
166 | --------------------------------------- |
|
166 | --------------------------------------- | |
167 |
|
167 | |||
168 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF |
|
168 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF | |
169 | > pick eb57da33312f 2 three |
|
169 | > pick eb57da33312f 2 three | |
170 | > pick 08d98a8350f3 4 five |
|
170 | > pick 08d98a8350f3 4 five | |
171 | > EOF |
|
171 | > EOF | |
172 | hg: parse error: missing rules for changeset c8e68270e35a |
|
172 | hg: parse error: missing rules for changeset c8e68270e35a | |
173 | (use "drop c8e68270e35a" to discard, see also: 'hg help -e histedit.config') |
|
173 | (use "drop c8e68270e35a" to discard, see also: 'hg help -e histedit.config') | |
174 | [255] |
|
174 | [255] | |
175 |
|
175 | |||
176 | Test that extra revisions are detected |
|
176 | Test that extra revisions are detected | |
177 | --------------------------------------- |
|
177 | --------------------------------------- | |
178 |
|
178 | |||
179 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF |
|
179 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF | |
180 | > pick 6058cbb6cfd7 0 one |
|
180 | > pick 6058cbb6cfd7 0 one | |
181 | > pick c8e68270e35a 3 four |
|
181 | > pick c8e68270e35a 3 four | |
182 | > pick 08d98a8350f3 4 five |
|
182 | > pick 08d98a8350f3 4 five | |
183 | > EOF |
|
183 | > EOF | |
184 | hg: parse error: pick "6058cbb6cfd7" changeset was not a candidate |
|
184 | hg: parse error: pick "6058cbb6cfd7" changeset was not a candidate | |
185 | (only use listed changesets) |
|
185 | (only use listed changesets) | |
186 | [255] |
|
186 | [255] | |
187 |
|
187 | |||
188 | Test malformed line |
|
188 | Test malformed line | |
189 | --------------------------------------- |
|
189 | --------------------------------------- | |
190 |
|
190 | |||
191 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF |
|
191 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF | |
192 | > pickeb57da33312f2three |
|
192 | > pickeb57da33312f2three | |
193 | > pick c8e68270e35a 3 four |
|
193 | > pick c8e68270e35a 3 four | |
194 | > pick 08d98a8350f3 4 five |
|
194 | > pick 08d98a8350f3 4 five | |
195 | > EOF |
|
195 | > EOF | |
196 | hg: parse error: malformed line "pickeb57da33312f2three" |
|
196 | hg: parse error: malformed line "pickeb57da33312f2three" | |
197 | [255] |
|
197 | [255] | |
198 |
|
198 | |||
199 | Test unknown changeset |
|
199 | Test unknown changeset | |
200 | --------------------------------------- |
|
200 | --------------------------------------- | |
201 |
|
201 | |||
202 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF |
|
202 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF | |
203 | > pick 0123456789ab 2 three |
|
203 | > pick 0123456789ab 2 three | |
204 | > pick c8e68270e35a 3 four |
|
204 | > pick c8e68270e35a 3 four | |
205 | > pick 08d98a8350f3 4 five |
|
205 | > pick 08d98a8350f3 4 five | |
206 | > EOF |
|
206 | > EOF | |
207 | hg: parse error: unknown changeset 0123456789ab listed |
|
207 | hg: parse error: unknown changeset 0123456789ab listed | |
208 | [255] |
|
208 | [255] | |
209 |
|
209 | |||
210 | Test unknown command |
|
210 | Test unknown command | |
211 | --------------------------------------- |
|
211 | --------------------------------------- | |
212 |
|
212 | |||
213 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF |
|
213 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF | |
214 | > coin eb57da33312f 2 three |
|
214 | > coin eb57da33312f 2 three | |
215 | > pick c8e68270e35a 3 four |
|
215 | > pick c8e68270e35a 3 four | |
216 | > pick 08d98a8350f3 4 five |
|
216 | > pick 08d98a8350f3 4 five | |
217 | > EOF |
|
217 | > EOF | |
218 | hg: parse error: unknown action "coin" |
|
218 | hg: parse error: unknown action "coin" | |
219 | [255] |
|
219 | [255] | |
220 |
|
220 | |||
221 | Test duplicated changeset |
|
221 | Test duplicated changeset | |
222 | --------------------------------------- |
|
222 | --------------------------------------- | |
223 |
|
223 | |||
224 | So one is missing and one appear twice. |
|
224 | So one is missing and one appear twice. | |
225 |
|
225 | |||
226 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF |
|
226 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF | |
227 | > pick eb57da33312f 2 three |
|
227 | > pick eb57da33312f 2 three | |
228 | > pick eb57da33312f 2 three |
|
228 | > pick eb57da33312f 2 three | |
229 | > pick 08d98a8350f3 4 five |
|
229 | > pick 08d98a8350f3 4 five | |
230 | > EOF |
|
230 | > EOF | |
231 | hg: parse error: duplicated command for changeset eb57da33312f |
|
231 | hg: parse error: duplicated command for changeset eb57da33312f | |
232 | [255] |
|
232 | [255] | |
233 |
|
233 | |||
234 | Test bogus rev |
|
234 | Test bogus rev | |
235 | --------------------------------------- |
|
235 | --------------------------------------- | |
236 |
|
236 | |||
237 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF |
|
237 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF | |
238 | > pick eb57da33312f 2 three |
|
238 | > pick eb57da33312f 2 three | |
239 | > pick 0 |
|
239 | > pick 0 | |
240 | > pick 08d98a8350f3 4 five |
|
240 | > pick 08d98a8350f3 4 five | |
241 | > EOF |
|
241 | > EOF | |
242 | hg: parse error: invalid changeset 0 |
|
242 | hg: parse error: invalid changeset 0 | |
243 | [255] |
|
243 | [255] | |
244 |
|
244 | |||
245 | Test short version of command |
|
245 | Test short version of command | |
246 | --------------------------------------- |
|
246 | --------------------------------------- | |
247 |
|
247 | |||
248 | Note: we use varying amounts of white space between command name and changeset |
|
248 | Note: we use varying amounts of white space between command name and changeset | |
249 | short hash. This tests issue3893. |
|
249 | short hash. This tests issue3893. | |
250 |
|
250 | |||
251 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF |
|
251 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF | |
252 | > pick eb57da33312f 2 three |
|
252 | > pick eb57da33312f 2 three | |
253 | > p c8e68270e35a 3 four |
|
253 | > p c8e68270e35a 3 four | |
254 | > f 08d98a8350f3 4 five |
|
254 | > f 08d98a8350f3 4 five | |
255 | > EOF |
|
255 | > EOF | |
256 | four |
|
256 | four | |
257 | *** |
|
257 | *** | |
258 | five |
|
258 | five | |
259 |
|
259 | |||
260 |
|
260 | |||
261 |
|
261 | |||
262 | HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
262 | HG: Enter commit message. Lines beginning with 'HG:' are removed. | |
263 | HG: Leave message empty to abort commit. |
|
263 | HG: Leave message empty to abort commit. | |
264 | HG: -- |
|
264 | HG: -- | |
265 | HG: user: test |
|
265 | HG: user: test | |
266 | HG: branch 'default' |
|
266 | HG: branch 'default' | |
267 | HG: changed alpha |
|
267 | HG: changed alpha | |
268 | saved backup bundle to $TESTTMP/foo/.hg/strip-backup/c8e68270e35a-63d8b8d8-histedit.hg |
|
268 | saved backup bundle to $TESTTMP/foo/.hg/strip-backup/c8e68270e35a-63d8b8d8-histedit.hg | |
269 |
|
269 | |||
270 | $ hg update -q 2 |
|
270 | $ hg update -q 2 | |
271 | $ echo x > x |
|
271 | $ echo x > x | |
272 | $ hg add x |
|
272 | $ hg add x | |
273 | $ hg commit -m'x' x |
|
273 | $ hg commit -m'x' x | |
274 | created new head |
|
274 | created new head | |
275 | $ hg histedit -r 'heads(all())' |
|
275 | $ hg histedit -r 'heads(all())' | |
276 | abort: The specified revisions must have exactly one common root |
|
276 | abort: The specified revisions must have exactly one common root | |
277 | [255] |
|
277 | [255] | |
278 |
|
278 | |||
279 | Test that trimming description using multi-byte characters |
|
279 | Test that trimming description using multi-byte characters | |
280 | -------------------------------------------------------------------- |
|
280 | -------------------------------------------------------------------- | |
281 |
|
281 | |||
282 | $ $PYTHON <<EOF |
|
282 | $ $PYTHON <<EOF | |
283 | > fp = open('logfile', 'w') |
|
283 | > fp = open('logfile', 'wb') | |
284 | > fp.write('12345678901234567890123456789012345678901234567890' + |
|
284 | > fp.write(b'12345678901234567890123456789012345678901234567890' + | |
285 | > '12345') # there are 5 more columns for 80 columns |
|
285 | > b'12345') # there are 5 more columns for 80 columns | |
286 | > |
|
286 | > | |
287 | > # 2 x 4 = 8 columns, but 3 x 4 = 12 bytes |
|
287 | > # 2 x 4 = 8 columns, but 3 x 4 = 12 bytes | |
288 | > fp.write(u'\u3042\u3044\u3046\u3048'.encode('utf-8')) |
|
288 | > fp.write(u'\u3042\u3044\u3046\u3048'.encode('utf-8')) | |
289 | > |
|
289 | > | |
290 | > fp.close() |
|
290 | > fp.close() | |
291 | > EOF |
|
291 | > EOF | |
292 | $ echo xx >> x |
|
292 | $ echo xx >> x | |
293 | $ hg --encoding utf-8 commit --logfile logfile |
|
293 | $ hg --encoding utf-8 commit --logfile logfile | |
294 |
|
294 | |||
295 | $ HGEDITOR=cat hg --encoding utf-8 histedit tip |
|
295 | $ HGEDITOR=cat hg --encoding utf-8 histedit tip | |
296 | pick 3d3ea1f3a10b 5 1234567890123456789012345678901234567890123456789012345\xe3\x81\x82... (esc) |
|
296 | pick 3d3ea1f3a10b 5 1234567890123456789012345678901234567890123456789012345\xe3\x81\x82... (esc) | |
297 |
|
297 | |||
298 | # Edit history between 3d3ea1f3a10b and 3d3ea1f3a10b |
|
298 | # Edit history between 3d3ea1f3a10b and 3d3ea1f3a10b | |
299 | # |
|
299 | # | |
300 | # Commits are listed from least to most recent |
|
300 | # Commits are listed from least to most recent | |
301 | # |
|
301 | # | |
302 | # You can reorder changesets by reordering the lines |
|
302 | # You can reorder changesets by reordering the lines | |
303 | # |
|
303 | # | |
304 | # Commands: |
|
304 | # Commands: | |
305 | # |
|
305 | # | |
306 | # e, edit = use commit, but stop for amending |
|
306 | # e, edit = use commit, but stop for amending | |
307 | # m, mess = edit commit message without changing commit content |
|
307 | # m, mess = edit commit message without changing commit content | |
308 | # p, pick = use commit |
|
308 | # p, pick = use commit | |
309 | # b, base = checkout changeset and apply further changesets from there |
|
309 | # b, base = checkout changeset and apply further changesets from there | |
310 | # d, drop = remove commit from history |
|
310 | # d, drop = remove commit from history | |
311 | # f, fold = use commit, but combine it with the one above |
|
311 | # f, fold = use commit, but combine it with the one above | |
312 | # r, roll = like fold, but discard this commit's description and date |
|
312 | # r, roll = like fold, but discard this commit's description and date | |
313 | # |
|
313 | # | |
314 |
|
314 | |||
315 | Test --continue with --keep |
|
315 | Test --continue with --keep | |
316 |
|
316 | |||
317 | $ hg strip -q -r . --config extensions.strip= |
|
317 | $ hg strip -q -r . --config extensions.strip= | |
318 | $ hg histedit '.^' -q --keep --commands - << EOF |
|
318 | $ hg histedit '.^' -q --keep --commands - << EOF | |
319 | > edit eb57da33312f 2 three |
|
319 | > edit eb57da33312f 2 three | |
320 | > pick f3cfcca30c44 4 x |
|
320 | > pick f3cfcca30c44 4 x | |
321 | > EOF |
|
321 | > EOF | |
322 | Editing (eb57da33312f), you may commit or record as needed now. |
|
322 | Editing (eb57da33312f), you may commit or record as needed now. | |
323 | (hg histedit --continue to resume) |
|
323 | (hg histedit --continue to resume) | |
324 | [1] |
|
324 | [1] | |
325 | $ echo edit >> alpha |
|
325 | $ echo edit >> alpha | |
326 | $ hg histedit -q --continue |
|
326 | $ hg histedit -q --continue | |
327 | $ hg log -G -T '{rev}:{node|short} {desc}' |
|
327 | $ hg log -G -T '{rev}:{node|short} {desc}' | |
328 | @ 6:8fda0c726bf2 x |
|
328 | @ 6:8fda0c726bf2 x | |
329 | | |
|
329 | | | |
330 | o 5:63379946892c three |
|
330 | o 5:63379946892c three | |
331 | | |
|
331 | | | |
332 | | o 4:f3cfcca30c44 x |
|
332 | | o 4:f3cfcca30c44 x | |
333 | | | |
|
333 | | | | |
334 | | | o 3:2a30f3cfee78 four |
|
334 | | | o 3:2a30f3cfee78 four | |
335 | | |/ *** |
|
335 | | |/ *** | |
336 | | | five |
|
336 | | | five | |
337 | | o 2:eb57da33312f three |
|
337 | | o 2:eb57da33312f three | |
338 | |/ |
|
338 | |/ | |
339 | o 1:579e40513370 two |
|
339 | o 1:579e40513370 two | |
340 | | |
|
340 | | | |
341 | o 0:6058cbb6cfd7 one |
|
341 | o 0:6058cbb6cfd7 one | |
342 |
|
342 | |||
343 |
|
343 | |||
344 | Test that abort fails gracefully on exception |
|
344 | Test that abort fails gracefully on exception | |
345 | ---------------------------------------------- |
|
345 | ---------------------------------------------- | |
346 | $ hg histedit . -q --commands - << EOF |
|
346 | $ hg histedit . -q --commands - << EOF | |
347 | > edit 8fda0c726bf2 6 x |
|
347 | > edit 8fda0c726bf2 6 x | |
348 | > EOF |
|
348 | > EOF | |
349 | Editing (8fda0c726bf2), you may commit or record as needed now. |
|
349 | Editing (8fda0c726bf2), you may commit or record as needed now. | |
350 | (hg histedit --continue to resume) |
|
350 | (hg histedit --continue to resume) | |
351 | [1] |
|
351 | [1] | |
352 | Corrupt histedit state file |
|
352 | Corrupt histedit state file | |
353 | $ sed 's/8fda0c726bf2/123456789012/' .hg/histedit-state > ../corrupt-histedit |
|
353 | $ sed 's/8fda0c726bf2/123456789012/' .hg/histedit-state > ../corrupt-histedit | |
354 | $ mv ../corrupt-histedit .hg/histedit-state |
|
354 | $ mv ../corrupt-histedit .hg/histedit-state | |
355 | $ hg histedit --abort |
|
355 | $ hg histedit --abort | |
356 | warning: encountered an exception during histedit --abort; the repository may not have been completely cleaned up |
|
356 | warning: encountered an exception during histedit --abort; the repository may not have been completely cleaned up | |
357 | abort: $TESTTMP/foo/.hg/strip-backup/*-histedit.hg: $ENOENT$ (glob) (windows !) |
|
357 | abort: $TESTTMP/foo/.hg/strip-backup/*-histedit.hg: $ENOENT$ (glob) (windows !) | |
358 | abort: $ENOENT$: $TESTTMP/foo/.hg/strip-backup/*-histedit.hg (glob) (no-windows !) |
|
358 | abort: $ENOENT$: $TESTTMP/foo/.hg/strip-backup/*-histedit.hg (glob) (no-windows !) | |
359 | [255] |
|
359 | [255] | |
360 | Histedit state has been exited |
|
360 | Histedit state has been exited | |
361 | $ hg summary -q |
|
361 | $ hg summary -q | |
362 | parent: 5:63379946892c |
|
362 | parent: 5:63379946892c | |
363 | commit: 1 added, 1 unknown (new branch head) |
|
363 | commit: 1 added, 1 unknown (new branch head) | |
364 | update: 4 new changesets (update) |
|
364 | update: 4 new changesets (update) | |
365 |
|
365 | |||
366 | $ cd .. |
|
366 | $ cd .. | |
367 |
|
367 | |||
368 | Set up default base revision tests |
|
368 | Set up default base revision tests | |
369 |
|
369 | |||
370 | $ hg init defaultbase |
|
370 | $ hg init defaultbase | |
371 | $ cd defaultbase |
|
371 | $ cd defaultbase | |
372 | $ touch foo |
|
372 | $ touch foo | |
373 | $ hg -q commit -A -m root |
|
373 | $ hg -q commit -A -m root | |
374 | $ echo 1 > foo |
|
374 | $ echo 1 > foo | |
375 | $ hg commit -m 'public 1' |
|
375 | $ hg commit -m 'public 1' | |
376 | $ hg phase --force --public -r . |
|
376 | $ hg phase --force --public -r . | |
377 | $ echo 2 > foo |
|
377 | $ echo 2 > foo | |
378 | $ hg commit -m 'draft after public' |
|
378 | $ hg commit -m 'draft after public' | |
379 | $ hg -q up -r 1 |
|
379 | $ hg -q up -r 1 | |
380 | $ echo 3 > foo |
|
380 | $ echo 3 > foo | |
381 | $ hg commit -m 'head 1 public' |
|
381 | $ hg commit -m 'head 1 public' | |
382 | created new head |
|
382 | created new head | |
383 | $ hg phase --force --public -r . |
|
383 | $ hg phase --force --public -r . | |
384 | $ echo 4 > foo |
|
384 | $ echo 4 > foo | |
385 | $ hg commit -m 'head 1 draft 1' |
|
385 | $ hg commit -m 'head 1 draft 1' | |
386 | $ echo 5 > foo |
|
386 | $ echo 5 > foo | |
387 | $ hg commit -m 'head 1 draft 2' |
|
387 | $ hg commit -m 'head 1 draft 2' | |
388 | $ hg -q up -r 2 |
|
388 | $ hg -q up -r 2 | |
389 | $ echo 6 > foo |
|
389 | $ echo 6 > foo | |
390 | $ hg commit -m 'head 2 commit 1' |
|
390 | $ hg commit -m 'head 2 commit 1' | |
391 | $ echo 7 > foo |
|
391 | $ echo 7 > foo | |
392 | $ hg commit -m 'head 2 commit 2' |
|
392 | $ hg commit -m 'head 2 commit 2' | |
393 | $ hg -q up -r 2 |
|
393 | $ hg -q up -r 2 | |
394 | $ echo 8 > foo |
|
394 | $ echo 8 > foo | |
395 | $ hg commit -m 'head 3' |
|
395 | $ hg commit -m 'head 3' | |
396 | created new head |
|
396 | created new head | |
397 | $ hg -q up -r 2 |
|
397 | $ hg -q up -r 2 | |
398 | $ echo 9 > foo |
|
398 | $ echo 9 > foo | |
399 | $ hg commit -m 'head 4' |
|
399 | $ hg commit -m 'head 4' | |
400 | created new head |
|
400 | created new head | |
401 | $ hg merge --tool :local -r 8 |
|
401 | $ hg merge --tool :local -r 8 | |
402 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
402 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
403 | (branch merge, don't forget to commit) |
|
403 | (branch merge, don't forget to commit) | |
404 | $ hg commit -m 'merge head 3 into head 4' |
|
404 | $ hg commit -m 'merge head 3 into head 4' | |
405 | $ echo 11 > foo |
|
405 | $ echo 11 > foo | |
406 | $ hg commit -m 'commit 1 after merge' |
|
406 | $ hg commit -m 'commit 1 after merge' | |
407 | $ echo 12 > foo |
|
407 | $ echo 12 > foo | |
408 | $ hg commit -m 'commit 2 after merge' |
|
408 | $ hg commit -m 'commit 2 after merge' | |
409 |
|
409 | |||
410 | $ hg log -G -T '{rev}:{node|short} {phase} {desc}\n' |
|
410 | $ hg log -G -T '{rev}:{node|short} {phase} {desc}\n' | |
411 | @ 12:8cde254db839 draft commit 2 after merge |
|
411 | @ 12:8cde254db839 draft commit 2 after merge | |
412 | | |
|
412 | | | |
413 | o 11:6f2f0241f119 draft commit 1 after merge |
|
413 | o 11:6f2f0241f119 draft commit 1 after merge | |
414 | | |
|
414 | | | |
415 | o 10:90506cc76b00 draft merge head 3 into head 4 |
|
415 | o 10:90506cc76b00 draft merge head 3 into head 4 | |
416 | |\ |
|
416 | |\ | |
417 | | o 9:f8607a373a97 draft head 4 |
|
417 | | o 9:f8607a373a97 draft head 4 | |
418 | | | |
|
418 | | | | |
419 | o | 8:0da92be05148 draft head 3 |
|
419 | o | 8:0da92be05148 draft head 3 | |
420 | |/ |
|
420 | |/ | |
421 | | o 7:4c35cdf97d5e draft head 2 commit 2 |
|
421 | | o 7:4c35cdf97d5e draft head 2 commit 2 | |
422 | | | |
|
422 | | | | |
423 | | o 6:931820154288 draft head 2 commit 1 |
|
423 | | o 6:931820154288 draft head 2 commit 1 | |
424 | |/ |
|
424 | |/ | |
425 | | o 5:8cdc02b9bc63 draft head 1 draft 2 |
|
425 | | o 5:8cdc02b9bc63 draft head 1 draft 2 | |
426 | | | |
|
426 | | | | |
427 | | o 4:463b8c0d2973 draft head 1 draft 1 |
|
427 | | o 4:463b8c0d2973 draft head 1 draft 1 | |
428 | | | |
|
428 | | | | |
429 | | o 3:23a0c4eefcbf public head 1 public |
|
429 | | o 3:23a0c4eefcbf public head 1 public | |
430 | | | |
|
430 | | | | |
431 | o | 2:4117331c3abb draft draft after public |
|
431 | o | 2:4117331c3abb draft draft after public | |
432 | |/ |
|
432 | |/ | |
433 | o 1:4426d359ea59 public public 1 |
|
433 | o 1:4426d359ea59 public public 1 | |
434 | | |
|
434 | | | |
435 | o 0:54136a8ddf32 public root |
|
435 | o 0:54136a8ddf32 public root | |
436 |
|
436 | |||
437 |
|
437 | |||
438 | Default base revision should stop at public changesets |
|
438 | Default base revision should stop at public changesets | |
439 |
|
439 | |||
440 | $ hg -q up 8cdc02b9bc63 |
|
440 | $ hg -q up 8cdc02b9bc63 | |
441 | $ hg histedit --commands - <<EOF |
|
441 | $ hg histedit --commands - <<EOF | |
442 | > pick 463b8c0d2973 |
|
442 | > pick 463b8c0d2973 | |
443 | > pick 8cdc02b9bc63 |
|
443 | > pick 8cdc02b9bc63 | |
444 | > EOF |
|
444 | > EOF | |
445 |
|
445 | |||
446 | Default base revision should stop at branchpoint |
|
446 | Default base revision should stop at branchpoint | |
447 |
|
447 | |||
448 | $ hg -q up 4c35cdf97d5e |
|
448 | $ hg -q up 4c35cdf97d5e | |
449 | $ hg histedit --commands - <<EOF |
|
449 | $ hg histedit --commands - <<EOF | |
450 | > pick 931820154288 |
|
450 | > pick 931820154288 | |
451 | > pick 4c35cdf97d5e |
|
451 | > pick 4c35cdf97d5e | |
452 | > EOF |
|
452 | > EOF | |
453 |
|
453 | |||
454 | Default base revision should stop at merge commit |
|
454 | Default base revision should stop at merge commit | |
455 |
|
455 | |||
456 | $ hg -q up 8cde254db839 |
|
456 | $ hg -q up 8cde254db839 | |
457 | $ hg histedit --commands - <<EOF |
|
457 | $ hg histedit --commands - <<EOF | |
458 | > pick 6f2f0241f119 |
|
458 | > pick 6f2f0241f119 | |
459 | > pick 8cde254db839 |
|
459 | > pick 8cde254db839 | |
460 | > EOF |
|
460 | > EOF | |
461 |
|
461 | |||
462 | commit --amend should abort if histedit is in progress |
|
462 | commit --amend should abort if histedit is in progress | |
463 | (issue4800) and markers are not being created. |
|
463 | (issue4800) and markers are not being created. | |
464 | Eventually, histedit could perhaps look at `source` extra, |
|
464 | Eventually, histedit could perhaps look at `source` extra, | |
465 | in which case this test should be revisited. |
|
465 | in which case this test should be revisited. | |
466 |
|
466 | |||
467 | $ hg -q up 8cde254db839 |
|
467 | $ hg -q up 8cde254db839 | |
468 | $ hg histedit 6f2f0241f119 --commands - <<EOF |
|
468 | $ hg histedit 6f2f0241f119 --commands - <<EOF | |
469 | > pick 8cde254db839 |
|
469 | > pick 8cde254db839 | |
470 | > edit 6f2f0241f119 |
|
470 | > edit 6f2f0241f119 | |
471 | > EOF |
|
471 | > EOF | |
472 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
472 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
473 | merging foo |
|
473 | merging foo | |
474 | warning: conflicts while merging foo! (edit, then use 'hg resolve --mark') |
|
474 | warning: conflicts while merging foo! (edit, then use 'hg resolve --mark') | |
475 | Fix up the change (pick 8cde254db839) |
|
475 | Fix up the change (pick 8cde254db839) | |
476 | (hg histedit --continue to resume) |
|
476 | (hg histedit --continue to resume) | |
477 | [1] |
|
477 | [1] | |
478 | $ hg resolve -m --all |
|
478 | $ hg resolve -m --all | |
479 | (no more unresolved files) |
|
479 | (no more unresolved files) | |
480 | continue: hg histedit --continue |
|
480 | continue: hg histedit --continue | |
481 | $ hg histedit --cont |
|
481 | $ hg histedit --cont | |
482 | merging foo |
|
482 | merging foo | |
483 | warning: conflicts while merging foo! (edit, then use 'hg resolve --mark') |
|
483 | warning: conflicts while merging foo! (edit, then use 'hg resolve --mark') | |
484 | Editing (6f2f0241f119), you may commit or record as needed now. |
|
484 | Editing (6f2f0241f119), you may commit or record as needed now. | |
485 | (hg histedit --continue to resume) |
|
485 | (hg histedit --continue to resume) | |
486 | [1] |
|
486 | [1] | |
487 | $ hg resolve -m --all |
|
487 | $ hg resolve -m --all | |
488 | (no more unresolved files) |
|
488 | (no more unresolved files) | |
489 | continue: hg histedit --continue |
|
489 | continue: hg histedit --continue | |
490 | $ hg commit --amend -m 'reject this fold' |
|
490 | $ hg commit --amend -m 'reject this fold' | |
491 | abort: histedit in progress |
|
491 | abort: histedit in progress | |
492 | (use 'hg histedit --continue' or 'hg histedit --abort') |
|
492 | (use 'hg histedit --continue' or 'hg histedit --abort') | |
493 | [255] |
|
493 | [255] | |
494 |
|
494 | |||
495 | With markers enabled, histedit does not get confused, and |
|
495 | With markers enabled, histedit does not get confused, and | |
496 | amend should not be blocked by the ongoing histedit. |
|
496 | amend should not be blocked by the ongoing histedit. | |
497 |
|
497 | |||
498 | $ cat >>$HGRCPATH <<EOF |
|
498 | $ cat >>$HGRCPATH <<EOF | |
499 | > [experimental] |
|
499 | > [experimental] | |
500 | > evolution.createmarkers=True |
|
500 | > evolution.createmarkers=True | |
501 | > evolution.allowunstable=True |
|
501 | > evolution.allowunstable=True | |
502 | > EOF |
|
502 | > EOF | |
503 | $ hg commit --amend -m 'allow this fold' |
|
503 | $ hg commit --amend -m 'allow this fold' | |
504 | $ hg histedit --continue |
|
504 | $ hg histedit --continue | |
505 |
|
505 | |||
506 | $ cd .. |
|
506 | $ cd .. | |
507 |
|
507 | |||
508 | Test autoverb feature |
|
508 | Test autoverb feature | |
509 |
|
509 | |||
510 | $ hg init autoverb |
|
510 | $ hg init autoverb | |
511 | $ cd autoverb |
|
511 | $ cd autoverb | |
512 | $ echo alpha >> alpha |
|
512 | $ echo alpha >> alpha | |
513 | $ hg ci -qAm one |
|
513 | $ hg ci -qAm one | |
514 | $ echo alpha >> alpha |
|
514 | $ echo alpha >> alpha | |
515 | $ hg ci -qm two |
|
515 | $ hg ci -qm two | |
516 | $ echo beta >> beta |
|
516 | $ echo beta >> beta | |
517 | $ hg ci -qAm "roll! one" |
|
517 | $ hg ci -qAm "roll! one" | |
518 |
|
518 | |||
519 | $ hg log --style compact --graph |
|
519 | $ hg log --style compact --graph | |
520 | @ 2[tip] 4f34d0f8b5fa 1970-01-01 00:00 +0000 test |
|
520 | @ 2[tip] 4f34d0f8b5fa 1970-01-01 00:00 +0000 test | |
521 | | roll! one |
|
521 | | roll! one | |
522 | | |
|
522 | | | |
523 | o 1 579e40513370 1970-01-01 00:00 +0000 test |
|
523 | o 1 579e40513370 1970-01-01 00:00 +0000 test | |
524 | | two |
|
524 | | two | |
525 | | |
|
525 | | | |
526 | o 0 6058cbb6cfd7 1970-01-01 00:00 +0000 test |
|
526 | o 0 6058cbb6cfd7 1970-01-01 00:00 +0000 test | |
527 | one |
|
527 | one | |
528 |
|
528 | |||
529 |
|
529 | |||
530 | Check that 'roll' is selected by default |
|
530 | Check that 'roll' is selected by default | |
531 |
|
531 | |||
532 | $ HGEDITOR=cat hg histedit 0 --config experimental.histedit.autoverb=True |
|
532 | $ HGEDITOR=cat hg histedit 0 --config experimental.histedit.autoverb=True | |
533 | pick 6058cbb6cfd7 0 one |
|
533 | pick 6058cbb6cfd7 0 one | |
534 | roll 4f34d0f8b5fa 2 roll! one |
|
534 | roll 4f34d0f8b5fa 2 roll! one | |
535 | pick 579e40513370 1 two |
|
535 | pick 579e40513370 1 two | |
536 |
|
536 | |||
537 | # Edit history between 6058cbb6cfd7 and 4f34d0f8b5fa |
|
537 | # Edit history between 6058cbb6cfd7 and 4f34d0f8b5fa | |
538 | # |
|
538 | # | |
539 | # Commits are listed from least to most recent |
|
539 | # Commits are listed from least to most recent | |
540 | # |
|
540 | # | |
541 | # You can reorder changesets by reordering the lines |
|
541 | # You can reorder changesets by reordering the lines | |
542 | # |
|
542 | # | |
543 | # Commands: |
|
543 | # Commands: | |
544 | # |
|
544 | # | |
545 | # e, edit = use commit, but stop for amending |
|
545 | # e, edit = use commit, but stop for amending | |
546 | # m, mess = edit commit message without changing commit content |
|
546 | # m, mess = edit commit message without changing commit content | |
547 | # p, pick = use commit |
|
547 | # p, pick = use commit | |
548 | # b, base = checkout changeset and apply further changesets from there |
|
548 | # b, base = checkout changeset and apply further changesets from there | |
549 | # d, drop = remove commit from history |
|
549 | # d, drop = remove commit from history | |
550 | # f, fold = use commit, but combine it with the one above |
|
550 | # f, fold = use commit, but combine it with the one above | |
551 | # r, roll = like fold, but discard this commit's description and date |
|
551 | # r, roll = like fold, but discard this commit's description and date | |
552 | # |
|
552 | # | |
553 |
|
553 | |||
554 | $ cd .. |
|
554 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now