##// END OF EJS Templates
test-histedit-commute: call helper script with sh...
Matt Mackall -
r23910:759df519 default
parent child Browse files
Show More
@@ -1,460 +1,459 b''
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 message without changing commit content
72 # m, mess = edit 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 changesets other than the ones listed
284 abort: may not use 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 message without changing commit content
350 # m, mess = edit 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 $ chmod +x editor.sh
418
417
419 $ HGEDITOR=./editor.sh hg histedit 0
418 $ HGEDITOR="sh ./editor.sh" hg histedit 0
420 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
421 adding another-dir/initial-file
420 adding another-dir/initial-file
422 removing initial-dir/initial-file
421 removing initial-dir/initial-file
423 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
424 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
425 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
426 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
427 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)
428
427
429 $ hg --config diff.git=yes export 0
428 $ hg --config diff.git=yes export 0
430 # HG changeset patch
429 # HG changeset patch
431 # User test
430 # User test
432 # Date 0 0
431 # Date 0 0
433 # Thu Jan 01 00:00:00 1970 +0000
432 # Thu Jan 01 00:00:00 1970 +0000
434 # Node ID fffadc26f8f85623ce60b028a3f1ccc3730f8530
433 # Node ID fffadc26f8f85623ce60b028a3f1ccc3730f8530
435 # Parent 0000000000000000000000000000000000000000
434 # Parent 0000000000000000000000000000000000000000
436 pick b0f4233702ca 0 initial commit
435 pick b0f4233702ca 0 initial commit
437 fold 5e8704a8f2d2 1 moved and changed
436 fold 5e8704a8f2d2 1 moved and changed
438 pick 40e7299e8fa7 2 renamed
437 pick 40e7299e8fa7 2 renamed
439
438
440 diff --git a/another-dir/initial-file b/another-dir/initial-file
439 diff --git a/another-dir/initial-file b/another-dir/initial-file
441 new file mode 100644
440 new file mode 100644
442 --- /dev/null
441 --- /dev/null
443 +++ b/another-dir/initial-file
442 +++ b/another-dir/initial-file
444 @@ -0,0 +1,1 @@
443 @@ -0,0 +1,1 @@
445 +changed
444 +changed
446
445
447 $ hg --config diff.git=yes export 1
446 $ hg --config diff.git=yes export 1
448 # HG changeset patch
447 # HG changeset patch
449 # User test
448 # User test
450 # Date 0 0
449 # Date 0 0
451 # Thu Jan 01 00:00:00 1970 +0000
450 # Thu Jan 01 00:00:00 1970 +0000
452 # Node ID 9b730d82b00af8a2766facebfa47cc124405a118
451 # Node ID 9b730d82b00af8a2766facebfa47cc124405a118
453 # Parent fffadc26f8f85623ce60b028a3f1ccc3730f8530
452 # Parent fffadc26f8f85623ce60b028a3f1ccc3730f8530
454 renamed
453 renamed
455
454
456 diff --git a/another-dir/initial-file b/another-dir/renamed-file
455 diff --git a/another-dir/initial-file b/another-dir/renamed-file
457 rename from another-dir/initial-file
456 rename from another-dir/initial-file
458 rename to another-dir/renamed-file
457 rename to another-dir/renamed-file
459
458
460 $ cd ..
459 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now