##// END OF EJS Templates
tests: relax histedit issue4251 and issue3893 backups...
timeless -
r27349:5b68f72c default
parent child Browse files
Show More
@@ -1,447 +1,447
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 # Commands:
66 # Commands:
67 # p, pick = use commit
67 # p, pick = use commit
68 # e, edit = use commit, but stop for amending
68 # e, edit = use commit, but stop for amending
69 # f, fold = use commit, but combine it with the one above
69 # f, fold = use commit, but combine it with the one above
70 # r, roll = like fold, but discard this commit's description
70 # r, roll = like fold, but discard this commit's description
71 # d, drop = remove commit from history
71 # d, drop = remove commit from history
72 # m, mess = edit commit message without changing commit content
72 # m, mess = edit commit message without changing commit content
73 #
73 #
74 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
74 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
75
75
76 Run on a revision not ancestors of the current working directory.
76 Run on a revision not ancestors of the current working directory.
77 --------------------------------------------------------------------
77 --------------------------------------------------------------------
78
78
79 $ hg up 2
79 $ hg up 2
80 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
80 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
81 $ hg histedit -r 4
81 $ hg histedit -r 4
82 abort: 08d98a8350f3 is not an ancestor of working directory
82 abort: 08d98a8350f3 is not an ancestor of working directory
83 [255]
83 [255]
84 $ hg up --quiet
84 $ hg up --quiet
85
85
86
86
87 Test that we pick the minimum of a revrange
87 Test that we pick the minimum of a revrange
88 ---------------------------------------
88 ---------------------------------------
89
89
90 $ HGEDITOR=cat hg histedit '2::' --commands - << EOF
90 $ HGEDITOR=cat hg histedit '2::' --commands - << EOF
91 > pick eb57da33312f 2 three
91 > pick eb57da33312f 2 three
92 > pick c8e68270e35a 3 four
92 > pick c8e68270e35a 3 four
93 > pick 08d98a8350f3 4 five
93 > pick 08d98a8350f3 4 five
94 > EOF
94 > EOF
95 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
95 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
96 $ hg up --quiet
96 $ hg up --quiet
97
97
98 $ HGEDITOR=cat hg histedit 'tip:2' --commands - << EOF
98 $ HGEDITOR=cat hg histedit 'tip:2' --commands - << EOF
99 > pick eb57da33312f 2 three
99 > pick eb57da33312f 2 three
100 > pick c8e68270e35a 3 four
100 > pick c8e68270e35a 3 four
101 > pick 08d98a8350f3 4 five
101 > pick 08d98a8350f3 4 five
102 > EOF
102 > EOF
103 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
103 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
104 $ hg up --quiet
104 $ hg up --quiet
105
105
106 Test config specified default
106 Test config specified default
107 -----------------------------
107 -----------------------------
108
108
109 $ HGEDITOR=cat hg histedit --config "histedit.defaultrev=only(.) - ::eb57da33312f" --commands - << EOF
109 $ HGEDITOR=cat hg histedit --config "histedit.defaultrev=only(.) - ::eb57da33312f" --commands - << EOF
110 > pick c8e68270e35a 3 four
110 > pick c8e68270e35a 3 four
111 > pick 08d98a8350f3 4 five
111 > pick 08d98a8350f3 4 five
112 > EOF
112 > EOF
113 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
113 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
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 $ HGEDITOR=cat hg histedit -r 4 --commands - << EOF
130 $ HGEDITOR=cat hg histedit -r 4 --commands - << EOF
131 > edit 08d98a8350f3 4 five
131 > edit 08d98a8350f3 4 five
132 > EOF
132 > EOF
133 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
133 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
134 reverting alpha
134 reverting alpha
135 Make changes as needed, you may commit or record as needed now.
135 Make changes as needed, you may commit or record as needed now.
136 When you are finished, run hg histedit --continue to resume.
136 When you are finished, run hg histedit --continue to resume.
137 [1]
137 [1]
138
138
139 $ mv .hg/histedit-state .hg/histedit-state.back
139 $ mv .hg/histedit-state .hg/histedit-state.back
140 $ hg update --quiet --clean 2
140 $ hg update --quiet --clean 2
141 $ echo alpha >> alpha
141 $ echo alpha >> alpha
142 $ mv .hg/histedit-state.back .hg/histedit-state
142 $ mv .hg/histedit-state.back .hg/histedit-state
143
143
144 $ hg histedit --continue
144 $ hg histedit --continue
145 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
145 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
146 saved backup bundle to $TESTTMP/foo/.hg/strip-backup/08d98a8350f3-02594089-backup.hg (glob)
146 saved backup bundle to $TESTTMP/foo/.hg/strip-backup/08d98a8350f3-02594089-backup.hg (glob)
147 $ hg log -G -T '{rev} {shortest(node)} {desc}\n' -r 2::
147 $ hg log -G -T '{rev} {shortest(node)} {desc}\n' -r 2::
148 @ 4 f5ed five
148 @ 4 f5ed five
149 |
149 |
150 | o 3 c8e6 four
150 | o 3 c8e6 four
151 |/
151 |/
152 o 2 eb57 three
152 o 2 eb57 three
153 |
153 |
154
154
155 $ hg unbundle -q $TESTTMP/foo/.hg/strip-backup/08d98a8350f3-02594089-backup.hg
155 $ hg unbundle -q $TESTTMP/foo/.hg/strip-backup/08d98a8350f3-02594089-backup.hg
156 $ hg strip -q -r f5ed --config extensions.strip=
156 $ hg strip -q -r f5ed --config extensions.strip=
157 $ hg up -q 08d98a8350f3
157 $ hg up -q 08d98a8350f3
158
158
159 Test that missing revisions are detected
159 Test that missing revisions are detected
160 ---------------------------------------
160 ---------------------------------------
161
161
162 $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
162 $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
163 > pick eb57da33312f 2 three
163 > pick eb57da33312f 2 three
164 > pick 08d98a8350f3 4 five
164 > pick 08d98a8350f3 4 five
165 > EOF
165 > EOF
166 abort: missing rules for changeset c8e68270e35a
166 abort: missing rules for changeset c8e68270e35a
167 (use "drop c8e68270e35a" to discard the change)
167 (use "drop c8e68270e35a" to discard the change)
168 [255]
168 [255]
169
169
170 Test that extra revisions are detected
170 Test that extra revisions are detected
171 ---------------------------------------
171 ---------------------------------------
172
172
173 $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
173 $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
174 > pick 6058cbb6cfd7 0 one
174 > pick 6058cbb6cfd7 0 one
175 > pick c8e68270e35a 3 four
175 > pick c8e68270e35a 3 four
176 > pick 08d98a8350f3 4 five
176 > pick 08d98a8350f3 4 five
177 > EOF
177 > EOF
178 abort: may not use "pick" with changesets other than the ones listed
178 abort: may not use "pick" with changesets other than the ones listed
179 [255]
179 [255]
180
180
181 Test malformed line
181 Test malformed line
182 ---------------------------------------
182 ---------------------------------------
183
183
184 $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
184 $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
185 > pickeb57da33312f2three
185 > pickeb57da33312f2three
186 > pick c8e68270e35a 3 four
186 > pick c8e68270e35a 3 four
187 > pick 08d98a8350f3 4 five
187 > pick 08d98a8350f3 4 five
188 > EOF
188 > EOF
189 abort: malformed line "pickeb57da33312f2three"
189 abort: malformed line "pickeb57da33312f2three"
190 [255]
190 [255]
191
191
192 Test unknown changeset
192 Test unknown changeset
193 ---------------------------------------
193 ---------------------------------------
194
194
195 $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
195 $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
196 > pick 0123456789ab 2 three
196 > pick 0123456789ab 2 three
197 > pick c8e68270e35a 3 four
197 > pick c8e68270e35a 3 four
198 > pick 08d98a8350f3 4 five
198 > pick 08d98a8350f3 4 five
199 > EOF
199 > EOF
200 abort: unknown changeset 0123456789ab listed
200 abort: unknown changeset 0123456789ab listed
201 [255]
201 [255]
202
202
203 Test unknown command
203 Test unknown command
204 ---------------------------------------
204 ---------------------------------------
205
205
206 $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
206 $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
207 > coin eb57da33312f 2 three
207 > coin eb57da33312f 2 three
208 > pick c8e68270e35a 3 four
208 > pick c8e68270e35a 3 four
209 > pick 08d98a8350f3 4 five
209 > pick 08d98a8350f3 4 five
210 > EOF
210 > EOF
211 abort: unknown action "coin"
211 abort: unknown action "coin"
212 [255]
212 [255]
213
213
214 Test duplicated changeset
214 Test duplicated changeset
215 ---------------------------------------
215 ---------------------------------------
216
216
217 So one is missing and one appear twice.
217 So one is missing and one appear twice.
218
218
219 $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
219 $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
220 > pick eb57da33312f 2 three
220 > pick eb57da33312f 2 three
221 > pick eb57da33312f 2 three
221 > pick eb57da33312f 2 three
222 > pick 08d98a8350f3 4 five
222 > pick 08d98a8350f3 4 five
223 > EOF
223 > EOF
224 abort: duplicated command for changeset eb57da33312f
224 abort: duplicated command for changeset eb57da33312f
225 [255]
225 [255]
226
226
227 Test short version of command
227 Test short version of command
228 ---------------------------------------
228 ---------------------------------------
229
229
230 Note: we use varying amounts of white space between command name and changeset
230 Note: we use varying amounts of white space between command name and changeset
231 short hash. This tests issue3893.
231 short hash. This tests issue3893.
232
232
233 $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
233 $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
234 > pick eb57da33312f 2 three
234 > pick eb57da33312f 2 three
235 > p c8e68270e35a 3 four
235 > p c8e68270e35a 3 four
236 > f 08d98a8350f3 4 five
236 > f 08d98a8350f3 4 five
237 > EOF
237 > EOF
238 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
238 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
239 reverting alpha
239 reverting alpha
240 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
240 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
241 four
241 four
242 ***
242 ***
243 five
243 five
244
244
245
245
246
246
247 HG: Enter commit message. Lines beginning with 'HG:' are removed.
247 HG: Enter commit message. Lines beginning with 'HG:' are removed.
248 HG: Leave message empty to abort commit.
248 HG: Leave message empty to abort commit.
249 HG: --
249 HG: --
250 HG: user: test
250 HG: user: test
251 HG: branch 'default'
251 HG: branch 'default'
252 HG: changed alpha
252 HG: changed alpha
253 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
253 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
254 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
254 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
255 saved backup bundle to $TESTTMP/foo/.hg/strip-backup/*-backup.hg (glob)
255 saved backup bundle to $TESTTMP/foo/.hg/strip-backup/*-backup.hg (glob)
256 saved backup bundle to $TESTTMP/foo/.hg/strip-backup/c8e68270e35a-23a13bf9-backup.hg (glob)
256 saved backup bundle to $TESTTMP/foo/.hg/strip-backup/*-backup.hg (glob)
257
257
258 $ hg update -q 2
258 $ hg update -q 2
259 $ echo x > x
259 $ echo x > x
260 $ hg add x
260 $ hg add x
261 $ hg commit -m'x' x
261 $ hg commit -m'x' x
262 created new head
262 created new head
263 $ hg histedit -r 'heads(all())'
263 $ hg histedit -r 'heads(all())'
264 abort: The specified revisions must have exactly one common root
264 abort: The specified revisions must have exactly one common root
265 [255]
265 [255]
266
266
267 Test that trimming description using multi-byte characters
267 Test that trimming description using multi-byte characters
268 --------------------------------------------------------------------
268 --------------------------------------------------------------------
269
269
270 $ python <<EOF
270 $ python <<EOF
271 > fp = open('logfile', 'w')
271 > fp = open('logfile', 'w')
272 > fp.write('12345678901234567890123456789012345678901234567890' +
272 > fp.write('12345678901234567890123456789012345678901234567890' +
273 > '12345') # there are 5 more columns for 80 columns
273 > '12345') # there are 5 more columns for 80 columns
274 >
274 >
275 > # 2 x 4 = 8 columns, but 3 x 4 = 12 bytes
275 > # 2 x 4 = 8 columns, but 3 x 4 = 12 bytes
276 > fp.write(u'\u3042\u3044\u3046\u3048'.encode('utf-8'))
276 > fp.write(u'\u3042\u3044\u3046\u3048'.encode('utf-8'))
277 >
277 >
278 > fp.close()
278 > fp.close()
279 > EOF
279 > EOF
280 $ echo xx >> x
280 $ echo xx >> x
281 $ hg --encoding utf-8 commit --logfile logfile
281 $ hg --encoding utf-8 commit --logfile logfile
282
282
283 $ HGEDITOR=cat hg --encoding utf-8 histedit tip
283 $ HGEDITOR=cat hg --encoding utf-8 histedit tip
284 pick 3d3ea1f3a10b 5 1234567890123456789012345678901234567890123456789012345\xe3\x81\x82... (esc)
284 pick 3d3ea1f3a10b 5 1234567890123456789012345678901234567890123456789012345\xe3\x81\x82... (esc)
285
285
286 # Edit history between 3d3ea1f3a10b and 3d3ea1f3a10b
286 # Edit history between 3d3ea1f3a10b and 3d3ea1f3a10b
287 #
287 #
288 # Commits are listed from least to most recent
288 # Commits are listed from least to most recent
289 #
289 #
290 # Commands:
290 # Commands:
291 # p, pick = use commit
291 # p, pick = use commit
292 # e, edit = use commit, but stop for amending
292 # e, edit = use commit, but stop for amending
293 # f, fold = use commit, but combine it with the one above
293 # f, fold = use commit, but combine it with the one above
294 # r, roll = like fold, but discard this commit's description
294 # r, roll = like fold, but discard this commit's description
295 # d, drop = remove commit from history
295 # d, drop = remove commit from history
296 # m, mess = edit commit message without changing commit content
296 # m, mess = edit commit message without changing commit content
297 #
297 #
298 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
298 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
299
299
300 Test --continue with --keep
300 Test --continue with --keep
301
301
302 $ hg strip -q -r . --config extensions.strip=
302 $ hg strip -q -r . --config extensions.strip=
303 $ hg histedit '.^' -q --keep --commands - << EOF
303 $ hg histedit '.^' -q --keep --commands - << EOF
304 > edit eb57da33312f 2 three
304 > edit eb57da33312f 2 three
305 > pick f3cfcca30c44 4 x
305 > pick f3cfcca30c44 4 x
306 > EOF
306 > EOF
307 Make changes as needed, you may commit or record as needed now.
307 Make changes as needed, you may commit or record as needed now.
308 When you are finished, run hg histedit --continue to resume.
308 When you are finished, run hg histedit --continue to resume.
309 [1]
309 [1]
310 $ echo edit >> alpha
310 $ echo edit >> alpha
311 $ hg histedit -q --continue
311 $ hg histedit -q --continue
312 $ hg log -G -T '{rev}:{node|short} {desc}'
312 $ hg log -G -T '{rev}:{node|short} {desc}'
313 @ 6:8fda0c726bf2 x
313 @ 6:8fda0c726bf2 x
314 |
314 |
315 o 5:63379946892c three
315 o 5:63379946892c three
316 |
316 |
317 | o 4:f3cfcca30c44 x
317 | o 4:f3cfcca30c44 x
318 | |
318 | |
319 | | o 3:2a30f3cfee78 four
319 | | o 3:2a30f3cfee78 four
320 | |/ ***
320 | |/ ***
321 | | five
321 | | five
322 | o 2:eb57da33312f three
322 | o 2:eb57da33312f three
323 |/
323 |/
324 o 1:579e40513370 two
324 o 1:579e40513370 two
325 |
325 |
326 o 0:6058cbb6cfd7 one
326 o 0:6058cbb6cfd7 one
327
327
328
328
329 Test that abort fails gracefully on exception
329 Test that abort fails gracefully on exception
330 ----------------------------------------------
330 ----------------------------------------------
331 $ hg histedit . -q --commands - << EOF
331 $ hg histedit . -q --commands - << EOF
332 > edit 8fda0c726bf2 6 x
332 > edit 8fda0c726bf2 6 x
333 > EOF
333 > EOF
334 Make changes as needed, you may commit or record as needed now.
334 Make changes as needed, you may commit or record as needed now.
335 When you are finished, run hg histedit --continue to resume.
335 When you are finished, run hg histedit --continue to resume.
336 [1]
336 [1]
337 Corrupt histedit state file
337 Corrupt histedit state file
338 $ sed 's/8fda0c726bf2/123456789012/' .hg/histedit-state > ../corrupt-histedit
338 $ sed 's/8fda0c726bf2/123456789012/' .hg/histedit-state > ../corrupt-histedit
339 $ mv ../corrupt-histedit .hg/histedit-state
339 $ mv ../corrupt-histedit .hg/histedit-state
340 $ hg histedit --abort
340 $ hg histedit --abort
341 warning: encountered an exception during histedit --abort; the repository may not have been completely cleaned up
341 warning: encountered an exception during histedit --abort; the repository may not have been completely cleaned up
342 abort: .*(No such file or directory:|The system cannot find the file specified).* (re)
342 abort: .*(No such file or directory:|The system cannot find the file specified).* (re)
343 [255]
343 [255]
344 Histedit state has been exited
344 Histedit state has been exited
345 $ hg summary -q
345 $ hg summary -q
346 parent: 5:63379946892c
346 parent: 5:63379946892c
347 commit: 1 added, 1 unknown (new branch head)
347 commit: 1 added, 1 unknown (new branch head)
348 update: 4 new changesets (update)
348 update: 4 new changesets (update)
349
349
350 $ cd ..
350 $ cd ..
351
351
352 Set up default base revision tests
352 Set up default base revision tests
353
353
354 $ hg init defaultbase
354 $ hg init defaultbase
355 $ cd defaultbase
355 $ cd defaultbase
356 $ touch foo
356 $ touch foo
357 $ hg -q commit -A -m root
357 $ hg -q commit -A -m root
358 $ echo 1 > foo
358 $ echo 1 > foo
359 $ hg commit -m 'public 1'
359 $ hg commit -m 'public 1'
360 $ hg phase --force --public -r .
360 $ hg phase --force --public -r .
361 $ echo 2 > foo
361 $ echo 2 > foo
362 $ hg commit -m 'draft after public'
362 $ hg commit -m 'draft after public'
363 $ hg -q up -r 1
363 $ hg -q up -r 1
364 $ echo 3 > foo
364 $ echo 3 > foo
365 $ hg commit -m 'head 1 public'
365 $ hg commit -m 'head 1 public'
366 created new head
366 created new head
367 $ hg phase --force --public -r .
367 $ hg phase --force --public -r .
368 $ echo 4 > foo
368 $ echo 4 > foo
369 $ hg commit -m 'head 1 draft 1'
369 $ hg commit -m 'head 1 draft 1'
370 $ echo 5 > foo
370 $ echo 5 > foo
371 $ hg commit -m 'head 1 draft 2'
371 $ hg commit -m 'head 1 draft 2'
372 $ hg -q up -r 2
372 $ hg -q up -r 2
373 $ echo 6 > foo
373 $ echo 6 > foo
374 $ hg commit -m 'head 2 commit 1'
374 $ hg commit -m 'head 2 commit 1'
375 $ echo 7 > foo
375 $ echo 7 > foo
376 $ hg commit -m 'head 2 commit 2'
376 $ hg commit -m 'head 2 commit 2'
377 $ hg -q up -r 2
377 $ hg -q up -r 2
378 $ echo 8 > foo
378 $ echo 8 > foo
379 $ hg commit -m 'head 3'
379 $ hg commit -m 'head 3'
380 created new head
380 created new head
381 $ hg -q up -r 2
381 $ hg -q up -r 2
382 $ echo 9 > foo
382 $ echo 9 > foo
383 $ hg commit -m 'head 4'
383 $ hg commit -m 'head 4'
384 created new head
384 created new head
385 $ hg merge --tool :local -r 8
385 $ hg merge --tool :local -r 8
386 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
386 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
387 (branch merge, don't forget to commit)
387 (branch merge, don't forget to commit)
388 $ hg commit -m 'merge head 3 into head 4'
388 $ hg commit -m 'merge head 3 into head 4'
389 $ echo 11 > foo
389 $ echo 11 > foo
390 $ hg commit -m 'commit 1 after merge'
390 $ hg commit -m 'commit 1 after merge'
391 $ echo 12 > foo
391 $ echo 12 > foo
392 $ hg commit -m 'commit 2 after merge'
392 $ hg commit -m 'commit 2 after merge'
393
393
394 $ hg log -G -T '{rev}:{node|short} {phase} {desc}\n'
394 $ hg log -G -T '{rev}:{node|short} {phase} {desc}\n'
395 @ 12:8cde254db839 draft commit 2 after merge
395 @ 12:8cde254db839 draft commit 2 after merge
396 |
396 |
397 o 11:6f2f0241f119 draft commit 1 after merge
397 o 11:6f2f0241f119 draft commit 1 after merge
398 |
398 |
399 o 10:90506cc76b00 draft merge head 3 into head 4
399 o 10:90506cc76b00 draft merge head 3 into head 4
400 |\
400 |\
401 | o 9:f8607a373a97 draft head 4
401 | o 9:f8607a373a97 draft head 4
402 | |
402 | |
403 o | 8:0da92be05148 draft head 3
403 o | 8:0da92be05148 draft head 3
404 |/
404 |/
405 | o 7:4c35cdf97d5e draft head 2 commit 2
405 | o 7:4c35cdf97d5e draft head 2 commit 2
406 | |
406 | |
407 | o 6:931820154288 draft head 2 commit 1
407 | o 6:931820154288 draft head 2 commit 1
408 |/
408 |/
409 | o 5:8cdc02b9bc63 draft head 1 draft 2
409 | o 5:8cdc02b9bc63 draft head 1 draft 2
410 | |
410 | |
411 | o 4:463b8c0d2973 draft head 1 draft 1
411 | o 4:463b8c0d2973 draft head 1 draft 1
412 | |
412 | |
413 | o 3:23a0c4eefcbf public head 1 public
413 | o 3:23a0c4eefcbf public head 1 public
414 | |
414 | |
415 o | 2:4117331c3abb draft draft after public
415 o | 2:4117331c3abb draft draft after public
416 |/
416 |/
417 o 1:4426d359ea59 public public 1
417 o 1:4426d359ea59 public public 1
418 |
418 |
419 o 0:54136a8ddf32 public root
419 o 0:54136a8ddf32 public root
420
420
421
421
422 Default base revision should stop at public changesets
422 Default base revision should stop at public changesets
423
423
424 $ hg -q up 8cdc02b9bc63
424 $ hg -q up 8cdc02b9bc63
425 $ hg histedit --commands - <<EOF
425 $ hg histedit --commands - <<EOF
426 > pick 463b8c0d2973
426 > pick 463b8c0d2973
427 > pick 8cdc02b9bc63
427 > pick 8cdc02b9bc63
428 > EOF
428 > EOF
429 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
429 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
430
430
431 Default base revision should stop at branchpoint
431 Default base revision should stop at branchpoint
432
432
433 $ hg -q up 4c35cdf97d5e
433 $ hg -q up 4c35cdf97d5e
434 $ hg histedit --commands - <<EOF
434 $ hg histedit --commands - <<EOF
435 > pick 931820154288
435 > pick 931820154288
436 > pick 4c35cdf97d5e
436 > pick 4c35cdf97d5e
437 > EOF
437 > EOF
438 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
438 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
439
439
440 Default base revision should stop at merge commit
440 Default base revision should stop at merge commit
441
441
442 $ hg -q up 8cde254db839
442 $ hg -q up 8cde254db839
443 $ hg histedit --commands - <<EOF
443 $ hg histedit --commands - <<EOF
444 > pick 6f2f0241f119
444 > pick 6f2f0241f119
445 > pick 8cde254db839
445 > pick 8cde254db839
446 > EOF
446 > EOF
447 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
447 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -1,460 +1,460
1 $ . "$TESTDIR/histedit-helpers.sh"
1 $ . "$TESTDIR/histedit-helpers.sh"
2
2
3 $ cat >> $HGRCPATH <<EOF
3 $ cat >> $HGRCPATH <<EOF
4 > [extensions]
4 > [extensions]
5 > histedit=
5 > histedit=
6 > EOF
6 > EOF
7
7
8 $ initrepo ()
8 $ initrepo ()
9 > {
9 > {
10 > hg init r
10 > hg init r
11 > cd r
11 > cd r
12 > for x in a b c d e f ; do
12 > for x in a b c d e f ; do
13 > echo $x > $x
13 > echo $x > $x
14 > hg add $x
14 > hg add $x
15 > hg ci -m $x
15 > hg ci -m $x
16 > done
16 > done
17 > }
17 > }
18
18
19 $ initrepo
19 $ initrepo
20
20
21 log before edit
21 log before edit
22 $ hg log --graph
22 $ hg log --graph
23 @ changeset: 5:652413bf663e
23 @ changeset: 5:652413bf663e
24 | tag: tip
24 | tag: tip
25 | user: test
25 | user: test
26 | date: Thu Jan 01 00:00:00 1970 +0000
26 | date: Thu Jan 01 00:00:00 1970 +0000
27 | summary: f
27 | summary: f
28 |
28 |
29 o changeset: 4:e860deea161a
29 o changeset: 4:e860deea161a
30 | user: test
30 | user: test
31 | date: Thu Jan 01 00:00:00 1970 +0000
31 | date: Thu Jan 01 00:00:00 1970 +0000
32 | summary: e
32 | summary: e
33 |
33 |
34 o changeset: 3:055a42cdd887
34 o changeset: 3:055a42cdd887
35 | user: test
35 | user: test
36 | date: Thu Jan 01 00:00:00 1970 +0000
36 | date: Thu Jan 01 00:00:00 1970 +0000
37 | summary: d
37 | summary: d
38 |
38 |
39 o changeset: 2:177f92b77385
39 o changeset: 2:177f92b77385
40 | user: test
40 | user: test
41 | date: Thu Jan 01 00:00:00 1970 +0000
41 | date: Thu Jan 01 00:00:00 1970 +0000
42 | summary: c
42 | summary: c
43 |
43 |
44 o changeset: 1:d2ae7f538514
44 o changeset: 1:d2ae7f538514
45 | user: test
45 | user: test
46 | date: Thu Jan 01 00:00:00 1970 +0000
46 | date: Thu Jan 01 00:00:00 1970 +0000
47 | summary: b
47 | summary: b
48 |
48 |
49 o changeset: 0:cb9a9f314b8b
49 o changeset: 0:cb9a9f314b8b
50 user: test
50 user: test
51 date: Thu Jan 01 00:00:00 1970 +0000
51 date: Thu Jan 01 00:00:00 1970 +0000
52 summary: a
52 summary: a
53
53
54
54
55 show the edit commands offered
55 show the edit commands offered
56 $ HGEDITOR=cat hg histedit 177f92b77385
56 $ HGEDITOR=cat hg histedit 177f92b77385
57 pick 177f92b77385 2 c
57 pick 177f92b77385 2 c
58 pick 055a42cdd887 3 d
58 pick 055a42cdd887 3 d
59 pick e860deea161a 4 e
59 pick e860deea161a 4 e
60 pick 652413bf663e 5 f
60 pick 652413bf663e 5 f
61
61
62 # Edit history between 177f92b77385 and 652413bf663e
62 # Edit history between 177f92b77385 and 652413bf663e
63 #
63 #
64 # Commits are listed from least to most recent
64 # Commits are listed from least to most recent
65 #
65 #
66 # Commands:
66 # Commands:
67 # p, pick = use commit
67 # p, pick = use commit
68 # e, edit = use commit, but stop for amending
68 # e, edit = use commit, but stop for amending
69 # f, fold = use commit, but combine it with the one above
69 # f, fold = use commit, but combine it with the one above
70 # r, roll = like fold, but discard this commit's description
70 # r, roll = like fold, but discard this commit's description
71 # d, drop = remove commit from history
71 # d, drop = remove commit from history
72 # m, mess = edit commit message without changing commit content
72 # m, mess = edit commit message without changing commit content
73 #
73 #
74 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
74 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
75
75
76 edit the history
76 edit the history
77 (use a hacky editor to check histedit-last-edit.txt backup)
77 (use a hacky editor to check histedit-last-edit.txt backup)
78
78
79 $ EDITED="$TESTTMP/editedhistory"
79 $ EDITED="$TESTTMP/editedhistory"
80 $ cat > $EDITED <<EOF
80 $ cat > $EDITED <<EOF
81 > pick 177f92b77385 c
81 > pick 177f92b77385 c
82 > pick e860deea161a e
82 > pick e860deea161a e
83 > pick 652413bf663e f
83 > pick 652413bf663e f
84 > pick 055a42cdd887 d
84 > pick 055a42cdd887 d
85 > EOF
85 > EOF
86 $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
86 $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
87 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
87 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
88 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
88 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
89 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
89 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
90 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
90 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
91
91
92 rules should end up in .hg/histedit-last-edit.txt:
92 rules should end up in .hg/histedit-last-edit.txt:
93 $ cat .hg/histedit-last-edit.txt
93 $ cat .hg/histedit-last-edit.txt
94 pick 177f92b77385 c
94 pick 177f92b77385 c
95 pick e860deea161a e
95 pick e860deea161a e
96 pick 652413bf663e f
96 pick 652413bf663e f
97 pick 055a42cdd887 d
97 pick 055a42cdd887 d
98
98
99 log after edit
99 log after edit
100 $ hg log --graph
100 $ hg log --graph
101 @ changeset: 5:07114f51870f
101 @ changeset: 5:07114f51870f
102 | tag: tip
102 | tag: tip
103 | user: test
103 | user: test
104 | date: Thu Jan 01 00:00:00 1970 +0000
104 | date: Thu Jan 01 00:00:00 1970 +0000
105 | summary: d
105 | summary: d
106 |
106 |
107 o changeset: 4:8ade9693061e
107 o changeset: 4:8ade9693061e
108 | user: test
108 | user: test
109 | date: Thu Jan 01 00:00:00 1970 +0000
109 | date: Thu Jan 01 00:00:00 1970 +0000
110 | summary: f
110 | summary: f
111 |
111 |
112 o changeset: 3:d8249471110a
112 o changeset: 3:d8249471110a
113 | user: test
113 | user: test
114 | date: Thu Jan 01 00:00:00 1970 +0000
114 | date: Thu Jan 01 00:00:00 1970 +0000
115 | summary: e
115 | summary: e
116 |
116 |
117 o changeset: 2:177f92b77385
117 o changeset: 2:177f92b77385
118 | user: test
118 | user: test
119 | date: Thu Jan 01 00:00:00 1970 +0000
119 | date: Thu Jan 01 00:00:00 1970 +0000
120 | summary: c
120 | summary: c
121 |
121 |
122 o changeset: 1:d2ae7f538514
122 o changeset: 1:d2ae7f538514
123 | user: test
123 | user: test
124 | date: Thu Jan 01 00:00:00 1970 +0000
124 | date: Thu Jan 01 00:00:00 1970 +0000
125 | summary: b
125 | summary: b
126 |
126 |
127 o changeset: 0:cb9a9f314b8b
127 o changeset: 0:cb9a9f314b8b
128 user: test
128 user: test
129 date: Thu Jan 01 00:00:00 1970 +0000
129 date: Thu Jan 01 00:00:00 1970 +0000
130 summary: a
130 summary: a
131
131
132
132
133 put things back
133 put things back
134
134
135 $ hg histedit 177f92b77385 --commands - 2>&1 << EOF | fixbundle
135 $ hg histedit 177f92b77385 --commands - 2>&1 << EOF | fixbundle
136 > pick 177f92b77385 c
136 > pick 177f92b77385 c
137 > pick 07114f51870f d
137 > pick 07114f51870f d
138 > pick d8249471110a e
138 > pick d8249471110a e
139 > pick 8ade9693061e f
139 > pick 8ade9693061e f
140 > EOF
140 > EOF
141 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
141 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
142 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
142 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
143 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
143 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
144 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
144 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
145
145
146 $ hg log --graph
146 $ hg log --graph
147 @ changeset: 5:7eca9b5b1148
147 @ changeset: 5:7eca9b5b1148
148 | tag: tip
148 | tag: tip
149 | user: test
149 | user: test
150 | date: Thu Jan 01 00:00:00 1970 +0000
150 | date: Thu Jan 01 00:00:00 1970 +0000
151 | summary: f
151 | summary: f
152 |
152 |
153 o changeset: 4:915da888f2de
153 o changeset: 4:915da888f2de
154 | user: test
154 | user: test
155 | date: Thu Jan 01 00:00:00 1970 +0000
155 | date: Thu Jan 01 00:00:00 1970 +0000
156 | summary: e
156 | summary: e
157 |
157 |
158 o changeset: 3:10517e47bbbb
158 o changeset: 3:10517e47bbbb
159 | user: test
159 | user: test
160 | date: Thu Jan 01 00:00:00 1970 +0000
160 | date: Thu Jan 01 00:00:00 1970 +0000
161 | summary: d
161 | summary: d
162 |
162 |
163 o changeset: 2:177f92b77385
163 o changeset: 2:177f92b77385
164 | user: test
164 | user: test
165 | date: Thu Jan 01 00:00:00 1970 +0000
165 | date: Thu Jan 01 00:00:00 1970 +0000
166 | summary: c
166 | summary: c
167 |
167 |
168 o changeset: 1:d2ae7f538514
168 o changeset: 1:d2ae7f538514
169 | user: test
169 | user: test
170 | date: Thu Jan 01 00:00:00 1970 +0000
170 | date: Thu Jan 01 00:00:00 1970 +0000
171 | summary: b
171 | summary: b
172 |
172 |
173 o changeset: 0:cb9a9f314b8b
173 o changeset: 0:cb9a9f314b8b
174 user: test
174 user: test
175 date: Thu Jan 01 00:00:00 1970 +0000
175 date: Thu Jan 01 00:00:00 1970 +0000
176 summary: a
176 summary: a
177
177
178
178
179 slightly different this time
179 slightly different this time
180
180
181 $ hg histedit 177f92b77385 --commands - << EOF 2>&1 | fixbundle
181 $ hg histedit 177f92b77385 --commands - << EOF 2>&1 | fixbundle
182 > pick 10517e47bbbb d
182 > pick 10517e47bbbb d
183 > pick 7eca9b5b1148 f
183 > pick 7eca9b5b1148 f
184 > pick 915da888f2de e
184 > pick 915da888f2de e
185 > pick 177f92b77385 c
185 > pick 177f92b77385 c
186 > EOF
186 > EOF
187 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
187 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
188 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
188 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
189 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
189 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
190 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
190 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
191 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
191 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
192 $ hg log --graph
192 $ hg log --graph
193 @ changeset: 5:38b92f448761
193 @ changeset: 5:38b92f448761
194 | tag: tip
194 | tag: tip
195 | user: test
195 | user: test
196 | date: Thu Jan 01 00:00:00 1970 +0000
196 | date: Thu Jan 01 00:00:00 1970 +0000
197 | summary: c
197 | summary: c
198 |
198 |
199 o changeset: 4:de71b079d9ce
199 o changeset: 4:de71b079d9ce
200 | user: test
200 | user: test
201 | date: Thu Jan 01 00:00:00 1970 +0000
201 | date: Thu Jan 01 00:00:00 1970 +0000
202 | summary: e
202 | summary: e
203 |
203 |
204 o changeset: 3:be9ae3a309c6
204 o changeset: 3:be9ae3a309c6
205 | user: test
205 | user: test
206 | date: Thu Jan 01 00:00:00 1970 +0000
206 | date: Thu Jan 01 00:00:00 1970 +0000
207 | summary: f
207 | summary: f
208 |
208 |
209 o changeset: 2:799205341b6b
209 o changeset: 2:799205341b6b
210 | user: test
210 | user: test
211 | date: Thu Jan 01 00:00:00 1970 +0000
211 | date: Thu Jan 01 00:00:00 1970 +0000
212 | summary: d
212 | summary: d
213 |
213 |
214 o changeset: 1:d2ae7f538514
214 o changeset: 1:d2ae7f538514
215 | user: test
215 | user: test
216 | date: Thu Jan 01 00:00:00 1970 +0000
216 | date: Thu Jan 01 00:00:00 1970 +0000
217 | summary: b
217 | summary: b
218 |
218 |
219 o changeset: 0:cb9a9f314b8b
219 o changeset: 0:cb9a9f314b8b
220 user: test
220 user: test
221 date: Thu Jan 01 00:00:00 1970 +0000
221 date: Thu Jan 01 00:00:00 1970 +0000
222 summary: a
222 summary: a
223
223
224
224
225 keep prevents stripping dead revs
225 keep prevents stripping dead revs
226 $ hg histedit 799205341b6b --keep --commands - 2>&1 << EOF | fixbundle
226 $ hg histedit 799205341b6b --keep --commands - 2>&1 << EOF | fixbundle
227 > pick 799205341b6b d
227 > pick 799205341b6b d
228 > pick be9ae3a309c6 f
228 > pick be9ae3a309c6 f
229 > pick 38b92f448761 c
229 > pick 38b92f448761 c
230 > pick de71b079d9ce e
230 > pick de71b079d9ce e
231 > EOF
231 > EOF
232 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
232 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
233 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
233 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
234 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
234 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
235 $ hg log --graph
235 $ hg log --graph
236 @ changeset: 7:803ef1c6fcfd
236 @ changeset: 7:803ef1c6fcfd
237 | tag: tip
237 | tag: tip
238 | user: test
238 | user: test
239 | date: Thu Jan 01 00:00:00 1970 +0000
239 | date: Thu Jan 01 00:00:00 1970 +0000
240 | summary: e
240 | summary: e
241 |
241 |
242 o changeset: 6:ece0b8d93dda
242 o changeset: 6:ece0b8d93dda
243 | parent: 3:be9ae3a309c6
243 | parent: 3:be9ae3a309c6
244 | user: test
244 | user: test
245 | date: Thu Jan 01 00:00:00 1970 +0000
245 | date: Thu Jan 01 00:00:00 1970 +0000
246 | summary: c
246 | summary: c
247 |
247 |
248 | o changeset: 5:38b92f448761
248 | o changeset: 5:38b92f448761
249 | | user: test
249 | | user: test
250 | | date: Thu Jan 01 00:00:00 1970 +0000
250 | | date: Thu Jan 01 00:00:00 1970 +0000
251 | | summary: c
251 | | summary: c
252 | |
252 | |
253 | o changeset: 4:de71b079d9ce
253 | o changeset: 4:de71b079d9ce
254 |/ user: test
254 |/ user: test
255 | date: Thu Jan 01 00:00:00 1970 +0000
255 | date: Thu Jan 01 00:00:00 1970 +0000
256 | summary: e
256 | summary: e
257 |
257 |
258 o changeset: 3:be9ae3a309c6
258 o changeset: 3:be9ae3a309c6
259 | user: test
259 | user: test
260 | date: Thu Jan 01 00:00:00 1970 +0000
260 | date: Thu Jan 01 00:00:00 1970 +0000
261 | summary: f
261 | summary: f
262 |
262 |
263 o changeset: 2:799205341b6b
263 o changeset: 2:799205341b6b
264 | user: test
264 | user: test
265 | date: Thu Jan 01 00:00:00 1970 +0000
265 | date: Thu Jan 01 00:00:00 1970 +0000
266 | summary: d
266 | summary: d
267 |
267 |
268 o changeset: 1:d2ae7f538514
268 o changeset: 1:d2ae7f538514
269 | user: test
269 | user: test
270 | date: Thu Jan 01 00:00:00 1970 +0000
270 | date: Thu Jan 01 00:00:00 1970 +0000
271 | summary: b
271 | summary: b
272 |
272 |
273 o changeset: 0:cb9a9f314b8b
273 o changeset: 0:cb9a9f314b8b
274 user: test
274 user: test
275 date: Thu Jan 01 00:00:00 1970 +0000
275 date: Thu Jan 01 00:00:00 1970 +0000
276 summary: a
276 summary: a
277
277
278
278
279 try with --rev
279 try with --rev
280 $ hg histedit --commands - --rev -2 2>&1 <<EOF | fixbundle
280 $ hg histedit --commands - --rev -2 2>&1 <<EOF | fixbundle
281 > pick de71b079d9ce e
281 > pick de71b079d9ce e
282 > pick 38b92f448761 c
282 > pick 38b92f448761 c
283 > EOF
283 > EOF
284 abort: may not use "pick" with changesets other than the ones listed
284 abort: may not use "pick" with changesets other than the ones listed
285 $ hg log --graph
285 $ hg log --graph
286 @ changeset: 7:803ef1c6fcfd
286 @ changeset: 7:803ef1c6fcfd
287 | tag: tip
287 | tag: tip
288 | user: test
288 | user: test
289 | date: Thu Jan 01 00:00:00 1970 +0000
289 | date: Thu Jan 01 00:00:00 1970 +0000
290 | summary: e
290 | summary: e
291 |
291 |
292 o changeset: 6:ece0b8d93dda
292 o changeset: 6:ece0b8d93dda
293 | parent: 3:be9ae3a309c6
293 | parent: 3:be9ae3a309c6
294 | user: test
294 | user: test
295 | date: Thu Jan 01 00:00:00 1970 +0000
295 | date: Thu Jan 01 00:00:00 1970 +0000
296 | summary: c
296 | summary: c
297 |
297 |
298 | o changeset: 5:38b92f448761
298 | o changeset: 5:38b92f448761
299 | | user: test
299 | | user: test
300 | | date: Thu Jan 01 00:00:00 1970 +0000
300 | | date: Thu Jan 01 00:00:00 1970 +0000
301 | | summary: c
301 | | summary: c
302 | |
302 | |
303 | o changeset: 4:de71b079d9ce
303 | o changeset: 4:de71b079d9ce
304 |/ user: test
304 |/ user: test
305 | date: Thu Jan 01 00:00:00 1970 +0000
305 | date: Thu Jan 01 00:00:00 1970 +0000
306 | summary: e
306 | summary: e
307 |
307 |
308 o changeset: 3:be9ae3a309c6
308 o changeset: 3:be9ae3a309c6
309 | user: test
309 | user: test
310 | date: Thu Jan 01 00:00:00 1970 +0000
310 | date: Thu Jan 01 00:00:00 1970 +0000
311 | summary: f
311 | summary: f
312 |
312 |
313 o changeset: 2:799205341b6b
313 o changeset: 2:799205341b6b
314 | user: test
314 | user: test
315 | date: Thu Jan 01 00:00:00 1970 +0000
315 | date: Thu Jan 01 00:00:00 1970 +0000
316 | summary: d
316 | summary: d
317 |
317 |
318 o changeset: 1:d2ae7f538514
318 o changeset: 1:d2ae7f538514
319 | user: test
319 | user: test
320 | date: Thu Jan 01 00:00:00 1970 +0000
320 | date: Thu Jan 01 00:00:00 1970 +0000
321 | summary: b
321 | summary: b
322 |
322 |
323 o changeset: 0:cb9a9f314b8b
323 o changeset: 0:cb9a9f314b8b
324 user: test
324 user: test
325 date: Thu Jan 01 00:00:00 1970 +0000
325 date: Thu Jan 01 00:00:00 1970 +0000
326 summary: a
326 summary: a
327
327
328 Verify that revsetalias entries work with histedit:
328 Verify that revsetalias entries work with histedit:
329 $ cat >> $HGRCPATH <<EOF
329 $ cat >> $HGRCPATH <<EOF
330 > [revsetalias]
330 > [revsetalias]
331 > grandparent(ARG) = p1(p1(ARG))
331 > grandparent(ARG) = p1(p1(ARG))
332 > EOF
332 > EOF
333 $ echo extra commit >> c
333 $ echo extra commit >> c
334 $ hg ci -m 'extra commit to c'
334 $ hg ci -m 'extra commit to c'
335 $ HGEDITOR=cat hg histedit 'grandparent(.)'
335 $ HGEDITOR=cat hg histedit 'grandparent(.)'
336 pick ece0b8d93dda 6 c
336 pick ece0b8d93dda 6 c
337 pick 803ef1c6fcfd 7 e
337 pick 803ef1c6fcfd 7 e
338 pick 9c863c565126 8 extra commit to c
338 pick 9c863c565126 8 extra commit to c
339
339
340 # Edit history between ece0b8d93dda and 9c863c565126
340 # Edit history between ece0b8d93dda and 9c863c565126
341 #
341 #
342 # Commits are listed from least to most recent
342 # Commits are listed from least to most recent
343 #
343 #
344 # Commands:
344 # Commands:
345 # p, pick = use commit
345 # p, pick = use commit
346 # e, edit = use commit, but stop for amending
346 # e, edit = use commit, but stop for amending
347 # f, fold = use commit, but combine it with the one above
347 # f, fold = use commit, but combine it with the one above
348 # r, roll = like fold, but discard this commit's description
348 # r, roll = like fold, but discard this commit's description
349 # d, drop = remove commit from history
349 # d, drop = remove commit from history
350 # m, mess = edit commit message without changing commit content
350 # m, mess = edit commit message without changing commit content
351 #
351 #
352 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
352 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
353
353
354 should also work if a commit message is missing
354 should also work if a commit message is missing
355 $ BUNDLE="$TESTDIR/missing-comment.hg"
355 $ BUNDLE="$TESTDIR/missing-comment.hg"
356 $ hg init missing
356 $ hg init missing
357 $ cd missing
357 $ cd missing
358 $ hg unbundle $BUNDLE
358 $ hg unbundle $BUNDLE
359 adding changesets
359 adding changesets
360 adding manifests
360 adding manifests
361 adding file changes
361 adding file changes
362 added 3 changesets with 3 changes to 1 files
362 added 3 changesets with 3 changes to 1 files
363 (run 'hg update' to get a working copy)
363 (run 'hg update' to get a working copy)
364 $ hg co tip
364 $ hg co tip
365 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
365 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
366 $ hg log --graph
366 $ hg log --graph
367 @ changeset: 2:bd22688093b3
367 @ changeset: 2:bd22688093b3
368 | tag: tip
368 | tag: tip
369 | user: Robert Altman <robert.altman@telventDTN.com>
369 | user: Robert Altman <robert.altman@telventDTN.com>
370 | date: Mon Nov 28 16:40:04 2011 +0000
370 | date: Mon Nov 28 16:40:04 2011 +0000
371 | summary: Update file.
371 | summary: Update file.
372 |
372 |
373 o changeset: 1:3b3e956f9171
373 o changeset: 1:3b3e956f9171
374 | user: Robert Altman <robert.altman@telventDTN.com>
374 | user: Robert Altman <robert.altman@telventDTN.com>
375 | date: Mon Nov 28 16:37:57 2011 +0000
375 | date: Mon Nov 28 16:37:57 2011 +0000
376 |
376 |
377 o changeset: 0:141947992243
377 o changeset: 0:141947992243
378 user: Robert Altman <robert.altman@telventDTN.com>
378 user: Robert Altman <robert.altman@telventDTN.com>
379 date: Mon Nov 28 16:35:28 2011 +0000
379 date: Mon Nov 28 16:35:28 2011 +0000
380 summary: Checked in text file
380 summary: Checked in text file
381
381
382 $ hg histedit 0
382 $ hg histedit 0
383 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
383 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
384 $ cd ..
384 $ cd ..
385
385
386 $ cd ..
386 $ cd ..
387
387
388
388
389 Test to make sure folding renames doesn't cause bogus conflicts (issue4251):
389 Test to make sure folding renames doesn't cause bogus conflicts (issue4251):
390 $ hg init issue4251
390 $ hg init issue4251
391 $ cd issue4251
391 $ cd issue4251
392
392
393 $ mkdir initial-dir
393 $ mkdir initial-dir
394 $ echo foo > initial-dir/initial-file
394 $ echo foo > initial-dir/initial-file
395 $ hg add initial-dir/initial-file
395 $ hg add initial-dir/initial-file
396 $ hg commit -m "initial commit"
396 $ hg commit -m "initial commit"
397
397
398 Move the file to a new directory, and in the same commit, change its content:
398 Move the file to a new directory, and in the same commit, change its content:
399 $ mkdir another-dir
399 $ mkdir another-dir
400 $ hg mv initial-dir/initial-file another-dir/
400 $ hg mv initial-dir/initial-file another-dir/
401 $ echo changed > another-dir/initial-file
401 $ echo changed > another-dir/initial-file
402 $ hg commit -m "moved and changed"
402 $ hg commit -m "moved and changed"
403
403
404 Rename the file:
404 Rename the file:
405 $ hg mv another-dir/initial-file another-dir/renamed-file
405 $ hg mv another-dir/initial-file another-dir/renamed-file
406 $ hg commit -m "renamed"
406 $ hg commit -m "renamed"
407
407
408 Now, let's try to fold the second commit into the first:
408 Now, let's try to fold the second commit into the first:
409 $ cat > editor.sh <<EOF
409 $ cat > editor.sh <<EOF
410 > #!/bin/sh
410 > #!/bin/sh
411 > cat > \$1 <<ENDOF
411 > cat > \$1 <<ENDOF
412 > pick b0f4233702ca 0 initial commit
412 > pick b0f4233702ca 0 initial commit
413 > fold 5e8704a8f2d2 1 moved and changed
413 > fold 5e8704a8f2d2 1 moved and changed
414 > pick 40e7299e8fa7 2 renamed
414 > pick 40e7299e8fa7 2 renamed
415 > ENDOF
415 > ENDOF
416 > EOF
416 > EOF
417
417
418 $ HGEDITOR="sh ./editor.sh" hg histedit 0
418 $ HGEDITOR="sh ./editor.sh" hg histedit 0
419 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
419 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
420 adding another-dir/initial-file (glob)
420 adding another-dir/initial-file (glob)
421 removing initial-dir/initial-file (glob)
421 removing initial-dir/initial-file (glob)
422 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
422 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
423 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
423 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
424 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
424 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
425 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
425 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
426 saved backup bundle to $TESTTMP/issue4251/.hg/strip-backup/*-backup.hg (glob)
426 saved backup bundle to $TESTTMP/issue4251/.hg/strip-backup/*-backup.hg (glob)
427 saved backup bundle to $TESTTMP/issue4251/.hg/strip-backup/b0f4233702ca-d99e7186-backup.hg (glob)
427 saved backup bundle to $TESTTMP/issue4251/.hg/strip-backup/*-backup.hg (glob)
428
428
429 $ hg --config diff.git=yes export 0
429 $ hg --config diff.git=yes export 0
430 # HG changeset patch
430 # HG changeset patch
431 # User test
431 # User test
432 # Date 0 0
432 # Date 0 0
433 # Thu Jan 01 00:00:00 1970 +0000
433 # Thu Jan 01 00:00:00 1970 +0000
434 # Node ID fffadc26f8f85623ce60b028a3f1ccc3730f8530
434 # Node ID fffadc26f8f85623ce60b028a3f1ccc3730f8530
435 # Parent 0000000000000000000000000000000000000000
435 # Parent 0000000000000000000000000000000000000000
436 pick b0f4233702ca 0 initial commit
436 pick b0f4233702ca 0 initial commit
437 fold 5e8704a8f2d2 1 moved and changed
437 fold 5e8704a8f2d2 1 moved and changed
438 pick 40e7299e8fa7 2 renamed
438 pick 40e7299e8fa7 2 renamed
439
439
440 diff --git a/another-dir/initial-file b/another-dir/initial-file
440 diff --git a/another-dir/initial-file b/another-dir/initial-file
441 new file mode 100644
441 new file mode 100644
442 --- /dev/null
442 --- /dev/null
443 +++ b/another-dir/initial-file
443 +++ b/another-dir/initial-file
444 @@ -0,0 +1,1 @@
444 @@ -0,0 +1,1 @@
445 +changed
445 +changed
446
446
447 $ hg --config diff.git=yes export 1
447 $ hg --config diff.git=yes export 1
448 # HG changeset patch
448 # HG changeset patch
449 # User test
449 # User test
450 # Date 0 0
450 # Date 0 0
451 # Thu Jan 01 00:00:00 1970 +0000
451 # Thu Jan 01 00:00:00 1970 +0000
452 # Node ID 9b730d82b00af8a2766facebfa47cc124405a118
452 # Node ID 9b730d82b00af8a2766facebfa47cc124405a118
453 # Parent fffadc26f8f85623ce60b028a3f1ccc3730f8530
453 # Parent fffadc26f8f85623ce60b028a3f1ccc3730f8530
454 renamed
454 renamed
455
455
456 diff --git a/another-dir/initial-file b/another-dir/renamed-file
456 diff --git a/another-dir/initial-file b/another-dir/renamed-file
457 rename from another-dir/initial-file
457 rename from another-dir/initial-file
458 rename to another-dir/renamed-file
458 rename to another-dir/renamed-file
459
459
460 $ cd ..
460 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now