##// END OF EJS Templates
test: fix in-test comments related to obsolescence...
Pierre-Yves David -
r18398:1a00c845 default
parent child Browse files
Show More
@@ -1,521 +1,521 b''
1 $ hg init
1 $ hg init
2
2
3 Setup:
3 Setup:
4
4
5 $ echo a >> a
5 $ echo a >> a
6 $ hg ci -Am 'base'
6 $ hg ci -Am 'base'
7 adding a
7 adding a
8
8
9 Refuse to amend public csets:
9 Refuse to amend public csets:
10
10
11 $ hg phase -r . -p
11 $ hg phase -r . -p
12 $ hg ci --amend
12 $ hg ci --amend
13 abort: cannot amend public changesets
13 abort: cannot amend public changesets
14 [255]
14 [255]
15 $ hg phase -r . -f -d
15 $ hg phase -r . -f -d
16
16
17 $ echo a >> a
17 $ echo a >> a
18 $ hg ci -Am 'base1'
18 $ hg ci -Am 'base1'
19
19
20 Nothing to amend:
20 Nothing to amend:
21
21
22 $ hg ci --amend
22 $ hg ci --amend
23 nothing changed
23 nothing changed
24 [1]
24 [1]
25
25
26 $ cat >> $HGRCPATH <<EOF
26 $ cat >> $HGRCPATH <<EOF
27 > [hooks]
27 > [hooks]
28 > pretxncommit.foo = sh -c "echo \\"pretxncommit \$HG_NODE\\"; hg id -r \$HG_NODE"
28 > pretxncommit.foo = sh -c "echo \\"pretxncommit \$HG_NODE\\"; hg id -r \$HG_NODE"
29 > EOF
29 > EOF
30
30
31 Amending changeset with changes in working dir:
31 Amending changeset with changes in working dir:
32 (and check that --message does not trigger an editor)
32 (and check that --message does not trigger an editor)
33
33
34 $ echo a >> a
34 $ echo a >> a
35 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -m 'amend base1'
35 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -m 'amend base1'
36 pretxncommit 43f1ba15f28a50abf0aae529cf8a16bfced7b149
36 pretxncommit 43f1ba15f28a50abf0aae529cf8a16bfced7b149
37 43f1ba15f28a tip
37 43f1ba15f28a tip
38 saved backup bundle to $TESTTMP/.hg/strip-backup/489edb5b847d-amend-backup.hg (glob)
38 saved backup bundle to $TESTTMP/.hg/strip-backup/489edb5b847d-amend-backup.hg (glob)
39 $ echo 'pretxncommit.foo = ' >> $HGRCPATH
39 $ echo 'pretxncommit.foo = ' >> $HGRCPATH
40 $ hg diff -c .
40 $ hg diff -c .
41 diff -r ad120869acf0 -r 43f1ba15f28a a
41 diff -r ad120869acf0 -r 43f1ba15f28a a
42 --- a/a Thu Jan 01 00:00:00 1970 +0000
42 --- a/a Thu Jan 01 00:00:00 1970 +0000
43 +++ b/a Thu Jan 01 00:00:00 1970 +0000
43 +++ b/a Thu Jan 01 00:00:00 1970 +0000
44 @@ -1,1 +1,3 @@
44 @@ -1,1 +1,3 @@
45 a
45 a
46 +a
46 +a
47 +a
47 +a
48 $ hg log
48 $ hg log
49 changeset: 1:43f1ba15f28a
49 changeset: 1:43f1ba15f28a
50 tag: tip
50 tag: tip
51 user: test
51 user: test
52 date: Thu Jan 01 00:00:00 1970 +0000
52 date: Thu Jan 01 00:00:00 1970 +0000
53 summary: amend base1
53 summary: amend base1
54
54
55 changeset: 0:ad120869acf0
55 changeset: 0:ad120869acf0
56 user: test
56 user: test
57 date: Thu Jan 01 00:00:00 1970 +0000
57 date: Thu Jan 01 00:00:00 1970 +0000
58 summary: base
58 summary: base
59
59
60
60
61 Check proper abort for empty message
61 Check proper abort for empty message
62
62
63 $ cat > editor.sh << '__EOF__'
63 $ cat > editor.sh << '__EOF__'
64 > #!/bin/sh
64 > #!/bin/sh
65 > echo "" > "$1"
65 > echo "" > "$1"
66 > __EOF__
66 > __EOF__
67 $ echo b > b
67 $ echo b > b
68 $ hg add b
68 $ hg add b
69 $ hg summary
69 $ hg summary
70 parent: 1:43f1ba15f28a tip
70 parent: 1:43f1ba15f28a tip
71 amend base1
71 amend base1
72 branch: default
72 branch: default
73 commit: 1 added, 1 unknown
73 commit: 1 added, 1 unknown
74 update: (current)
74 update: (current)
75 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend
75 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend
76 transaction abort!
76 transaction abort!
77 rollback completed
77 rollback completed
78 abort: empty commit message
78 abort: empty commit message
79 [255]
79 [255]
80 $ hg summary
80 $ hg summary
81 parent: 1:43f1ba15f28a tip
81 parent: 1:43f1ba15f28a tip
82 amend base1
82 amend base1
83 branch: default
83 branch: default
84 commit: 1 added, 1 unknown
84 commit: 1 added, 1 unknown
85 update: (current)
85 update: (current)
86
86
87 Add new file:
87 Add new file:
88 $ hg ci --amend -m 'amend base1 new file'
88 $ hg ci --amend -m 'amend base1 new file'
89 saved backup bundle to $TESTTMP/.hg/strip-backup/43f1ba15f28a-amend-backup.hg (glob)
89 saved backup bundle to $TESTTMP/.hg/strip-backup/43f1ba15f28a-amend-backup.hg (glob)
90
90
91 Remove file that was added in amended commit:
91 Remove file that was added in amended commit:
92 (and test logfile option)
92 (and test logfile option)
93 (and test that logfile option do not trigger an editor)
93 (and test that logfile option do not trigger an editor)
94
94
95 $ hg rm b
95 $ hg rm b
96 $ echo 'amend base1 remove new file' > ../logfile
96 $ echo 'amend base1 remove new file' > ../logfile
97 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg ci --amend --logfile ../logfile
97 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg ci --amend --logfile ../logfile
98 saved backup bundle to $TESTTMP/.hg/strip-backup/b8e3cb2b3882-amend-backup.hg (glob)
98 saved backup bundle to $TESTTMP/.hg/strip-backup/b8e3cb2b3882-amend-backup.hg (glob)
99
99
100 $ hg cat b
100 $ hg cat b
101 b: no such file in rev 74609c7f506e
101 b: no such file in rev 74609c7f506e
102 [1]
102 [1]
103
103
104 No changes, just a different message:
104 No changes, just a different message:
105
105
106 $ hg ci -v --amend -m 'no changes, new message'
106 $ hg ci -v --amend -m 'no changes, new message'
107 amending changeset 74609c7f506e
107 amending changeset 74609c7f506e
108 copying changeset 74609c7f506e to ad120869acf0
108 copying changeset 74609c7f506e to ad120869acf0
109 a
109 a
110 stripping amended changeset 74609c7f506e
110 stripping amended changeset 74609c7f506e
111 1 changesets found
111 1 changesets found
112 saved backup bundle to $TESTTMP/.hg/strip-backup/74609c7f506e-amend-backup.hg (glob)
112 saved backup bundle to $TESTTMP/.hg/strip-backup/74609c7f506e-amend-backup.hg (glob)
113 1 changesets found
113 1 changesets found
114 adding branch
114 adding branch
115 adding changesets
115 adding changesets
116 adding manifests
116 adding manifests
117 adding file changes
117 adding file changes
118 added 1 changesets with 1 changes to 1 files
118 added 1 changesets with 1 changes to 1 files
119 committed changeset 1:1cd866679df8
119 committed changeset 1:1cd866679df8
120 $ hg diff -c .
120 $ hg diff -c .
121 diff -r ad120869acf0 -r 1cd866679df8 a
121 diff -r ad120869acf0 -r 1cd866679df8 a
122 --- a/a Thu Jan 01 00:00:00 1970 +0000
122 --- a/a Thu Jan 01 00:00:00 1970 +0000
123 +++ b/a Thu Jan 01 00:00:00 1970 +0000
123 +++ b/a Thu Jan 01 00:00:00 1970 +0000
124 @@ -1,1 +1,3 @@
124 @@ -1,1 +1,3 @@
125 a
125 a
126 +a
126 +a
127 +a
127 +a
128 $ hg log
128 $ hg log
129 changeset: 1:1cd866679df8
129 changeset: 1:1cd866679df8
130 tag: tip
130 tag: tip
131 user: test
131 user: test
132 date: Thu Jan 01 00:00:00 1970 +0000
132 date: Thu Jan 01 00:00:00 1970 +0000
133 summary: no changes, new message
133 summary: no changes, new message
134
134
135 changeset: 0:ad120869acf0
135 changeset: 0:ad120869acf0
136 user: test
136 user: test
137 date: Thu Jan 01 00:00:00 1970 +0000
137 date: Thu Jan 01 00:00:00 1970 +0000
138 summary: base
138 summary: base
139
139
140
140
141 Disable default date on commit so when -d isn't given, the old date is preserved:
141 Disable default date on commit so when -d isn't given, the old date is preserved:
142
142
143 $ echo '[defaults]' >> $HGRCPATH
143 $ echo '[defaults]' >> $HGRCPATH
144 $ echo 'commit=' >> $HGRCPATH
144 $ echo 'commit=' >> $HGRCPATH
145
145
146 Test -u/-d:
146 Test -u/-d:
147
147
148 $ hg ci --amend -u foo -d '1 0'
148 $ hg ci --amend -u foo -d '1 0'
149 saved backup bundle to $TESTTMP/.hg/strip-backup/1cd866679df8-amend-backup.hg (glob)
149 saved backup bundle to $TESTTMP/.hg/strip-backup/1cd866679df8-amend-backup.hg (glob)
150 $ echo a >> a
150 $ echo a >> a
151 $ hg ci --amend -u foo -d '1 0'
151 $ hg ci --amend -u foo -d '1 0'
152 saved backup bundle to $TESTTMP/.hg/strip-backup/780e6f23e03d-amend-backup.hg (glob)
152 saved backup bundle to $TESTTMP/.hg/strip-backup/780e6f23e03d-amend-backup.hg (glob)
153 $ hg log -r .
153 $ hg log -r .
154 changeset: 1:5f357c7560ab
154 changeset: 1:5f357c7560ab
155 tag: tip
155 tag: tip
156 user: foo
156 user: foo
157 date: Thu Jan 01 00:00:01 1970 +0000
157 date: Thu Jan 01 00:00:01 1970 +0000
158 summary: no changes, new message
158 summary: no changes, new message
159
159
160
160
161 Open editor with old commit message if a message isn't given otherwise:
161 Open editor with old commit message if a message isn't given otherwise:
162
162
163 $ cat > editor.sh << '__EOF__'
163 $ cat > editor.sh << '__EOF__'
164 > #!/bin/sh
164 > #!/bin/sh
165 > cat $1
165 > cat $1
166 > echo "another precious commit message" > "$1"
166 > echo "another precious commit message" > "$1"
167 > __EOF__
167 > __EOF__
168 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v
168 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v
169 amending changeset 5f357c7560ab
169 amending changeset 5f357c7560ab
170 copying changeset 5f357c7560ab to ad120869acf0
170 copying changeset 5f357c7560ab to ad120869acf0
171 no changes, new message
171 no changes, new message
172
172
173
173
174 HG: Enter commit message. Lines beginning with 'HG:' are removed.
174 HG: Enter commit message. Lines beginning with 'HG:' are removed.
175 HG: Leave message empty to abort commit.
175 HG: Leave message empty to abort commit.
176 HG: --
176 HG: --
177 HG: user: foo
177 HG: user: foo
178 HG: branch 'default'
178 HG: branch 'default'
179 HG: changed a
179 HG: changed a
180 a
180 a
181 stripping amended changeset 5f357c7560ab
181 stripping amended changeset 5f357c7560ab
182 1 changesets found
182 1 changesets found
183 saved backup bundle to $TESTTMP/.hg/strip-backup/5f357c7560ab-amend-backup.hg (glob)
183 saved backup bundle to $TESTTMP/.hg/strip-backup/5f357c7560ab-amend-backup.hg (glob)
184 1 changesets found
184 1 changesets found
185 adding branch
185 adding branch
186 adding changesets
186 adding changesets
187 adding manifests
187 adding manifests
188 adding file changes
188 adding file changes
189 added 1 changesets with 1 changes to 1 files
189 added 1 changesets with 1 changes to 1 files
190 committed changeset 1:7ab3bf440b54
190 committed changeset 1:7ab3bf440b54
191
191
192 Same, but with changes in working dir (different code path):
192 Same, but with changes in working dir (different code path):
193
193
194 $ echo a >> a
194 $ echo a >> a
195 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v
195 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v
196 amending changeset 7ab3bf440b54
196 amending changeset 7ab3bf440b54
197 a
197 a
198 copying changeset a0ea9b1a4c8c to ad120869acf0
198 copying changeset a0ea9b1a4c8c to ad120869acf0
199 another precious commit message
199 another precious commit message
200
200
201
201
202 HG: Enter commit message. Lines beginning with 'HG:' are removed.
202 HG: Enter commit message. Lines beginning with 'HG:' are removed.
203 HG: Leave message empty to abort commit.
203 HG: Leave message empty to abort commit.
204 HG: --
204 HG: --
205 HG: user: foo
205 HG: user: foo
206 HG: branch 'default'
206 HG: branch 'default'
207 HG: changed a
207 HG: changed a
208 a
208 a
209 stripping intermediate changeset a0ea9b1a4c8c
209 stripping intermediate changeset a0ea9b1a4c8c
210 stripping amended changeset 7ab3bf440b54
210 stripping amended changeset 7ab3bf440b54
211 2 changesets found
211 2 changesets found
212 saved backup bundle to $TESTTMP/.hg/strip-backup/7ab3bf440b54-amend-backup.hg (glob)
212 saved backup bundle to $TESTTMP/.hg/strip-backup/7ab3bf440b54-amend-backup.hg (glob)
213 1 changesets found
213 1 changesets found
214 adding branch
214 adding branch
215 adding changesets
215 adding changesets
216 adding manifests
216 adding manifests
217 adding file changes
217 adding file changes
218 added 1 changesets with 1 changes to 1 files
218 added 1 changesets with 1 changes to 1 files
219 committed changeset 1:ea22a388757c
219 committed changeset 1:ea22a388757c
220
220
221 $ rm editor.sh
221 $ rm editor.sh
222 $ hg log -r .
222 $ hg log -r .
223 changeset: 1:ea22a388757c
223 changeset: 1:ea22a388757c
224 tag: tip
224 tag: tip
225 user: foo
225 user: foo
226 date: Thu Jan 01 00:00:01 1970 +0000
226 date: Thu Jan 01 00:00:01 1970 +0000
227 summary: another precious commit message
227 summary: another precious commit message
228
228
229
229
230 Moving bookmarks, preserve active bookmark:
230 Moving bookmarks, preserve active bookmark:
231
231
232 $ hg book book1
232 $ hg book book1
233 $ hg book book2
233 $ hg book book2
234 $ hg ci --amend -m 'move bookmarks'
234 $ hg ci --amend -m 'move bookmarks'
235 saved backup bundle to $TESTTMP/.hg/strip-backup/ea22a388757c-amend-backup.hg (glob)
235 saved backup bundle to $TESTTMP/.hg/strip-backup/ea22a388757c-amend-backup.hg (glob)
236 $ hg book
236 $ hg book
237 book1 1:6cec5aa930e2
237 book1 1:6cec5aa930e2
238 * book2 1:6cec5aa930e2
238 * book2 1:6cec5aa930e2
239 $ echo a >> a
239 $ echo a >> a
240 $ hg ci --amend -m 'move bookmarks'
240 $ hg ci --amend -m 'move bookmarks'
241 saved backup bundle to $TESTTMP/.hg/strip-backup/6cec5aa930e2-amend-backup.hg (glob)
241 saved backup bundle to $TESTTMP/.hg/strip-backup/6cec5aa930e2-amend-backup.hg (glob)
242 $ hg book
242 $ hg book
243 book1 1:48bb6e53a15f
243 book1 1:48bb6e53a15f
244 * book2 1:48bb6e53a15f
244 * book2 1:48bb6e53a15f
245
245
246 abort does not loose bookmarks
246 abort does not loose bookmarks
247
247
248 $ cat > editor.sh << '__EOF__'
248 $ cat > editor.sh << '__EOF__'
249 > #!/bin/sh
249 > #!/bin/sh
250 > echo "" > "$1"
250 > echo "" > "$1"
251 > __EOF__
251 > __EOF__
252 $ echo a >> a
252 $ echo a >> a
253 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend
253 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend
254 transaction abort!
254 transaction abort!
255 rollback completed
255 rollback completed
256 abort: empty commit message
256 abort: empty commit message
257 [255]
257 [255]
258 $ hg book
258 $ hg book
259 book1 1:48bb6e53a15f
259 book1 1:48bb6e53a15f
260 * book2 1:48bb6e53a15f
260 * book2 1:48bb6e53a15f
261 $ hg revert -Caq
261 $ hg revert -Caq
262 $ rm editor.sh
262 $ rm editor.sh
263
263
264 $ echo '[defaults]' >> $HGRCPATH
264 $ echo '[defaults]' >> $HGRCPATH
265 $ echo "commit=-d '0 0'" >> $HGRCPATH
265 $ echo "commit=-d '0 0'" >> $HGRCPATH
266
266
267 Moving branches:
267 Moving branches:
268
268
269 $ hg branch foo
269 $ hg branch foo
270 marked working directory as branch foo
270 marked working directory as branch foo
271 (branches are permanent and global, did you want a bookmark?)
271 (branches are permanent and global, did you want a bookmark?)
272 $ echo a >> a
272 $ echo a >> a
273 $ hg ci -m 'branch foo'
273 $ hg ci -m 'branch foo'
274 $ hg branch default -f
274 $ hg branch default -f
275 marked working directory as branch default
275 marked working directory as branch default
276 (branches are permanent and global, did you want a bookmark?)
276 (branches are permanent and global, did you want a bookmark?)
277 $ hg ci --amend -m 'back to default'
277 $ hg ci --amend -m 'back to default'
278 saved backup bundle to $TESTTMP/.hg/strip-backup/8ac881fbf49d-amend-backup.hg (glob)
278 saved backup bundle to $TESTTMP/.hg/strip-backup/8ac881fbf49d-amend-backup.hg (glob)
279 $ hg branches
279 $ hg branches
280 default 2:ce12b0b57d46
280 default 2:ce12b0b57d46
281
281
282 Close branch:
282 Close branch:
283
283
284 $ hg up -q 0
284 $ hg up -q 0
285 $ echo b >> b
285 $ echo b >> b
286 $ hg branch foo
286 $ hg branch foo
287 marked working directory as branch foo
287 marked working directory as branch foo
288 (branches are permanent and global, did you want a bookmark?)
288 (branches are permanent and global, did you want a bookmark?)
289 $ hg ci -Am 'fork'
289 $ hg ci -Am 'fork'
290 adding b
290 adding b
291 $ echo b >> b
291 $ echo b >> b
292 $ hg ci -mb
292 $ hg ci -mb
293 $ hg ci --amend --close-branch -m 'closing branch foo'
293 $ hg ci --amend --close-branch -m 'closing branch foo'
294 saved backup bundle to $TESTTMP/.hg/strip-backup/c962248fa264-amend-backup.hg (glob)
294 saved backup bundle to $TESTTMP/.hg/strip-backup/c962248fa264-amend-backup.hg (glob)
295
295
296 Same thing, different code path:
296 Same thing, different code path:
297
297
298 $ echo b >> b
298 $ echo b >> b
299 $ hg ci -m 'reopen branch'
299 $ hg ci -m 'reopen branch'
300 reopening closed branch head 4
300 reopening closed branch head 4
301 $ echo b >> b
301 $ echo b >> b
302 $ hg ci --amend --close-branch
302 $ hg ci --amend --close-branch
303 saved backup bundle to $TESTTMP/.hg/strip-backup/027371728205-amend-backup.hg (glob)
303 saved backup bundle to $TESTTMP/.hg/strip-backup/027371728205-amend-backup.hg (glob)
304 $ hg branches
304 $ hg branches
305 default 2:ce12b0b57d46
305 default 2:ce12b0b57d46
306
306
307 Refuse to amend merges:
307 Refuse to amend merges:
308
308
309 $ hg up -q default
309 $ hg up -q default
310 $ hg merge foo
310 $ hg merge foo
311 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
311 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
312 (branch merge, don't forget to commit)
312 (branch merge, don't forget to commit)
313 $ hg ci --amend
313 $ hg ci --amend
314 abort: cannot amend while merging
314 abort: cannot amend while merging
315 [255]
315 [255]
316 $ hg ci -m 'merge'
316 $ hg ci -m 'merge'
317 $ hg ci --amend
317 $ hg ci --amend
318 abort: cannot amend merge changesets
318 abort: cannot amend merge changesets
319 [255]
319 [255]
320
320
321 Follow copies/renames:
321 Follow copies/renames:
322
322
323 $ hg mv b c
323 $ hg mv b c
324 $ hg ci -m 'b -> c'
324 $ hg ci -m 'b -> c'
325 $ hg mv c d
325 $ hg mv c d
326 $ hg ci --amend -m 'b -> d'
326 $ hg ci --amend -m 'b -> d'
327 saved backup bundle to $TESTTMP/.hg/strip-backup/b8c6eac7f12e-amend-backup.hg (glob)
327 saved backup bundle to $TESTTMP/.hg/strip-backup/b8c6eac7f12e-amend-backup.hg (glob)
328 $ hg st --rev '.^' --copies d
328 $ hg st --rev '.^' --copies d
329 A d
329 A d
330 b
330 b
331 $ hg cp d e
331 $ hg cp d e
332 $ hg ci -m 'e = d'
332 $ hg ci -m 'e = d'
333 $ hg cp e f
333 $ hg cp e f
334 $ hg ci --amend -m 'f = d'
334 $ hg ci --amend -m 'f = d'
335 saved backup bundle to $TESTTMP/.hg/strip-backup/7f9761d65613-amend-backup.hg (glob)
335 saved backup bundle to $TESTTMP/.hg/strip-backup/7f9761d65613-amend-backup.hg (glob)
336 $ hg st --rev '.^' --copies f
336 $ hg st --rev '.^' --copies f
337 A f
337 A f
338 d
338 d
339
339
340 $ mv f f.orig
340 $ mv f f.orig
341 $ hg rm -A f
341 $ hg rm -A f
342 $ hg ci -m removef
342 $ hg ci -m removef
343 $ hg cp a f
343 $ hg cp a f
344 $ mv f.orig f
344 $ mv f.orig f
345 $ hg ci --amend -m replacef
345 $ hg ci --amend -m replacef
346 saved backup bundle to $TESTTMP/.hg/strip-backup/9e8c5f7e3d95-amend-backup.hg (glob)
346 saved backup bundle to $TESTTMP/.hg/strip-backup/9e8c5f7e3d95-amend-backup.hg (glob)
347 $ hg st --change . --copies
347 $ hg st --change . --copies
348 $ hg log -r . --template "{file_copies}\n"
348 $ hg log -r . --template "{file_copies}\n"
349
349
350
350
351 Move added file (issue3410):
351 Move added file (issue3410):
352
352
353 $ echo g >> g
353 $ echo g >> g
354 $ hg ci -Am g
354 $ hg ci -Am g
355 adding g
355 adding g
356 $ hg mv g h
356 $ hg mv g h
357 $ hg ci --amend
357 $ hg ci --amend
358 saved backup bundle to $TESTTMP/.hg/strip-backup/24aa8eacce2b-amend-backup.hg (glob)
358 saved backup bundle to $TESTTMP/.hg/strip-backup/24aa8eacce2b-amend-backup.hg (glob)
359 $ hg st --change . --copies h
359 $ hg st --change . --copies h
360 A h
360 A h
361 $ hg log -r . --template "{file_copies}\n"
361 $ hg log -r . --template "{file_copies}\n"
362
362
363
363
364 Can't rollback an amend:
364 Can't rollback an amend:
365
365
366 $ hg rollback
366 $ hg rollback
367 no rollback information available
367 no rollback information available
368 [1]
368 [1]
369
369
370 Preserve extra dict (issue3430):
370 Preserve extra dict (issue3430):
371
371
372 $ hg branch a
372 $ hg branch a
373 marked working directory as branch a
373 marked working directory as branch a
374 (branches are permanent and global, did you want a bookmark?)
374 (branches are permanent and global, did you want a bookmark?)
375 $ echo a >> a
375 $ echo a >> a
376 $ hg ci -ma
376 $ hg ci -ma
377 $ hg ci --amend -m "a'"
377 $ hg ci --amend -m "a'"
378 saved backup bundle to $TESTTMP/.hg/strip-backup/3837aa2a2fdb-amend-backup.hg (glob)
378 saved backup bundle to $TESTTMP/.hg/strip-backup/3837aa2a2fdb-amend-backup.hg (glob)
379 $ hg log -r . --template "{branch}\n"
379 $ hg log -r . --template "{branch}\n"
380 a
380 a
381 $ hg ci --amend -m "a''"
381 $ hg ci --amend -m "a''"
382 saved backup bundle to $TESTTMP/.hg/strip-backup/c05c06be7514-amend-backup.hg (glob)
382 saved backup bundle to $TESTTMP/.hg/strip-backup/c05c06be7514-amend-backup.hg (glob)
383 $ hg log -r . --template "{branch}\n"
383 $ hg log -r . --template "{branch}\n"
384 a
384 a
385
385
386 Also preserve other entries in the dict that are in the old commit,
386 Also preserve other entries in the dict that are in the old commit,
387 first graft something so there's an additional entry:
387 first graft something so there's an additional entry:
388
388
389 $ hg up 0 -q
389 $ hg up 0 -q
390 $ echo z > z
390 $ echo z > z
391 $ hg ci -Am 'fork'
391 $ hg ci -Am 'fork'
392 adding z
392 adding z
393 created new head
393 created new head
394 $ hg up 11
394 $ hg up 11
395 5 files updated, 0 files merged, 1 files removed, 0 files unresolved
395 5 files updated, 0 files merged, 1 files removed, 0 files unresolved
396 $ hg graft 12
396 $ hg graft 12
397 grafting revision 12
397 grafting revision 12
398 $ hg ci --amend -m 'graft amend'
398 $ hg ci --amend -m 'graft amend'
399 saved backup bundle to $TESTTMP/.hg/strip-backup/bd010aea3f39-amend-backup.hg (glob)
399 saved backup bundle to $TESTTMP/.hg/strip-backup/bd010aea3f39-amend-backup.hg (glob)
400 $ hg log -r . --debug | grep extra
400 $ hg log -r . --debug | grep extra
401 extra: amend_source=bd010aea3f39f3fb2a2f884b9ccb0471cd77398e
401 extra: amend_source=bd010aea3f39f3fb2a2f884b9ccb0471cd77398e
402 extra: branch=a
402 extra: branch=a
403 extra: source=2647734878ef0236dda712fae9c1651cf694ea8a
403 extra: source=2647734878ef0236dda712fae9c1651cf694ea8a
404
404
405 Preserve phase
405 Preserve phase
406
406
407 $ hg phase '.^::.'
407 $ hg phase '.^::.'
408 11: draft
408 11: draft
409 13: draft
409 13: draft
410 $ hg phase --secret --force .
410 $ hg phase --secret --force .
411 $ hg phase '.^::.'
411 $ hg phase '.^::.'
412 11: draft
412 11: draft
413 13: secret
413 13: secret
414 $ hg commit --amend -m 'amend for phase' -q
414 $ hg commit --amend -m 'amend for phase' -q
415 $ hg phase '.^::.'
415 $ hg phase '.^::.'
416 11: draft
416 11: draft
417 13: secret
417 13: secret
418
418
419 Test amend with obsolete
419 Test amend with obsolete
420 ---------------------------
420 ---------------------------
421
421
422 Enable obsolete
422 Enable obsolete
423
423
424 $ cat > ${TESTTMP}/obs.py << EOF
424 $ cat > ${TESTTMP}/obs.py << EOF
425 > import mercurial.obsolete
425 > import mercurial.obsolete
426 > mercurial.obsolete._enabled = True
426 > mercurial.obsolete._enabled = True
427 > EOF
427 > EOF
428 $ echo '[extensions]' >> $HGRCPATH
428 $ echo '[extensions]' >> $HGRCPATH
429 $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
429 $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
430
430
431
431
432 Amend with no files changes
432 Amend with no files changes
433
433
434 $ hg id -n
434 $ hg id -n
435 13
435 13
436 $ hg ci --amend -m 'babar'
436 $ hg ci --amend -m 'babar'
437 $ hg id -n
437 $ hg id -n
438 14
438 14
439 $ hg log -Gl 3 --style=compact
439 $ hg log -Gl 3 --style=compact
440 @ 14[tip]:11 b650e6ee8614 1970-01-01 00:00 +0000 test
440 @ 14[tip]:11 b650e6ee8614 1970-01-01 00:00 +0000 test
441 | babar
441 | babar
442 |
442 |
443 | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test
443 | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test
444 | | fork
444 | | fork
445 | |
445 | |
446 o | 11 3334b7925910 1970-01-01 00:00 +0000 test
446 o | 11 3334b7925910 1970-01-01 00:00 +0000 test
447 | | a''
447 | | a''
448 | |
448 | |
449 $ hg log -Gl 4 --hidden --style=compact
449 $ hg log -Gl 4 --hidden --style=compact
450 @ 14[tip]:11 b650e6ee8614 1970-01-01 00:00 +0000 test
450 @ 14[tip]:11 b650e6ee8614 1970-01-01 00:00 +0000 test
451 | babar
451 | babar
452 |
452 |
453 | x 13:11 68ff8ff97044 1970-01-01 00:00 +0000 test
453 | x 13:11 68ff8ff97044 1970-01-01 00:00 +0000 test
454 |/ amend for phase
454 |/ amend for phase
455 |
455 |
456 | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test
456 | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test
457 | | fork
457 | | fork
458 | |
458 | |
459 o | 11 3334b7925910 1970-01-01 00:00 +0000 test
459 o | 11 3334b7925910 1970-01-01 00:00 +0000 test
460 | | a''
460 | | a''
461 | |
461 | |
462
462
463 Amend with files changes
463 Amend with files changes
464
464
465 (note: the extra commit over 15 is a temporary junk I would be happy to get
465 (note: the extra commit over 15 is a temporary junk I would be happy to get
466 ride of)
466 ride of)
467
467
468 $ echo 'babar' >> a
468 $ echo 'babar' >> a
469 $ hg commit --amend
469 $ hg commit --amend
470 $ hg log -Gl 6 --hidden --style=compact
470 $ hg log -Gl 6 --hidden --style=compact
471 @ 16[tip]:11 9f9e9bccf56c 1970-01-01 00:00 +0000 test
471 @ 16[tip]:11 9f9e9bccf56c 1970-01-01 00:00 +0000 test
472 | babar
472 | babar
473 |
473 |
474 | x 15 90fef497c56f 1970-01-01 00:00 +0000 test
474 | x 15 90fef497c56f 1970-01-01 00:00 +0000 test
475 | | temporary amend commit for b650e6ee8614
475 | | temporary amend commit for b650e6ee8614
476 | |
476 | |
477 | x 14:11 b650e6ee8614 1970-01-01 00:00 +0000 test
477 | x 14:11 b650e6ee8614 1970-01-01 00:00 +0000 test
478 |/ babar
478 |/ babar
479 |
479 |
480 | x 13:11 68ff8ff97044 1970-01-01 00:00 +0000 test
480 | x 13:11 68ff8ff97044 1970-01-01 00:00 +0000 test
481 |/ amend for phase
481 |/ amend for phase
482 |
482 |
483 | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test
483 | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test
484 | | fork
484 | | fork
485 | |
485 | |
486 o | 11 3334b7925910 1970-01-01 00:00 +0000 test
486 o | 11 3334b7925910 1970-01-01 00:00 +0000 test
487 | | a''
487 | | a''
488 | |
488 | |
489
489
490
490
491 Test that amend does not make it easy to create obsoletescence cycle
491 Test that amend does not make it easy to create obsoletescence cycle
492 ---------------------------------------------------------------------
492 ---------------------------------------------------------------------
493
493
494
494
495 $ hg id -r 14 --hidden
495 $ hg id -r 14 --hidden
496 b650e6ee8614 (a)
496 b650e6ee8614 (a)
497 $ hg revert -ar 14 --hidden
497 $ hg revert -ar 14 --hidden
498 reverting a
498 reverting a
499 $ hg commit --amend
499 $ hg commit --amend
500 $ hg id
500 $ hg id
501 b99e5df575f7 (a) tip
501 b99e5df575f7 (a) tip
502
502
503 Test ui.prevent-unstable
503 Test that rewriting leaving instability behind is allowed
504 ---------------------------------------------------------------------
504 ---------------------------------------------------------------------
505
505
506 $ hg up '.^'
506 $ hg up '.^'
507 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
507 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
508 $ echo 'b' >> a
508 $ echo 'b' >> a
509 $ hg log --style compact -r 'children(.)'
509 $ hg log --style compact -r 'children(.)'
510 18[tip]:11 b99e5df575f7 1970-01-01 00:00 +0000 test
510 18[tip]:11 b99e5df575f7 1970-01-01 00:00 +0000 test
511 babar
511 babar
512
512
513 $ hg commit --amend
513 $ hg commit --amend
514 $ hg log -r 'unstable()'
514 $ hg log -r 'unstable()'
515 changeset: 18:b99e5df575f7
515 changeset: 18:b99e5df575f7
516 branch: a
516 branch: a
517 parent: 11:3334b7925910
517 parent: 11:3334b7925910
518 user: test
518 user: test
519 date: Thu Jan 01 00:00:00 1970 +0000
519 date: Thu Jan 01 00:00:00 1970 +0000
520 summary: babar
520 summary: babar
521
521
@@ -1,155 +1,155 b''
1 $ . "$TESTDIR/histedit-helpers.sh"
1 $ . "$TESTDIR/histedit-helpers.sh"
2
2
3 Enable obsolete
3 Enable obsolete
4
4
5 $ cat > ${TESTTMP}/obs.py << EOF
5 $ cat > ${TESTTMP}/obs.py << EOF
6 > import mercurial.obsolete
6 > import mercurial.obsolete
7 > mercurial.obsolete._enabled = True
7 > mercurial.obsolete._enabled = True
8 > EOF
8 > EOF
9
9
10 $ cat >> $HGRCPATH << EOF
10 $ cat >> $HGRCPATH << EOF
11 > [ui]
11 > [ui]
12 > logtemplate= {rev}:{node|short} {desc|firstline}
12 > logtemplate= {rev}:{node|short} {desc|firstline}
13 > [phases]
13 > [phases]
14 > publish=False
14 > publish=False
15 > [extensions]'
15 > [extensions]'
16 > histedit=
16 > histedit=
17 >
17 >
18 > obs=${TESTTMP}/obs.py
18 > obs=${TESTTMP}/obs.py
19 > EOF
19 > EOF
20
20
21 $ hg init base
21 $ hg init base
22 $ cd base
22 $ cd base
23
23
24 $ for x in a b c d e f ; do
24 $ for x in a b c d e f ; do
25 > echo $x > $x
25 > echo $x > $x
26 > hg add $x
26 > hg add $x
27 > hg ci -m $x
27 > hg ci -m $x
28 > done
28 > done
29
29
30 $ hg log --graph
30 $ hg log --graph
31 @ 5:652413bf663e f
31 @ 5:652413bf663e f
32 |
32 |
33 o 4:e860deea161a e
33 o 4:e860deea161a e
34 |
34 |
35 o 3:055a42cdd887 d
35 o 3:055a42cdd887 d
36 |
36 |
37 o 2:177f92b77385 c
37 o 2:177f92b77385 c
38 |
38 |
39 o 1:d2ae7f538514 b
39 o 1:d2ae7f538514 b
40 |
40 |
41 o 0:cb9a9f314b8b a
41 o 0:cb9a9f314b8b a
42
42
43
43
44 $ HGEDITOR=cat hg histedit 1
44 $ HGEDITOR=cat hg histedit 1
45 pick d2ae7f538514 1 b
45 pick d2ae7f538514 1 b
46 pick 177f92b77385 2 c
46 pick 177f92b77385 2 c
47 pick 055a42cdd887 3 d
47 pick 055a42cdd887 3 d
48 pick e860deea161a 4 e
48 pick e860deea161a 4 e
49 pick 652413bf663e 5 f
49 pick 652413bf663e 5 f
50
50
51 # Edit history between d2ae7f538514 and 652413bf663e
51 # Edit history between d2ae7f538514 and 652413bf663e
52 #
52 #
53 # Commands:
53 # Commands:
54 # p, pick = use commit
54 # p, pick = use commit
55 # e, edit = use commit, but stop for amending
55 # e, edit = use commit, but stop for amending
56 # f, fold = use commit, but fold into previous commit (combines N and N-1)
56 # f, fold = use commit, but fold into previous commit (combines N and N-1)
57 # d, drop = remove commit from history
57 # d, drop = remove commit from history
58 # m, mess = edit message without changing commit content
58 # m, mess = edit message without changing commit content
59 #
59 #
60 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
60 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
61 $ cat > commands.txt <<EOF
61 $ cat > commands.txt <<EOF
62 > pick 177f92b77385 2 c
62 > pick 177f92b77385 2 c
63 > drop d2ae7f538514 1 b
63 > drop d2ae7f538514 1 b
64 > pick 055a42cdd887 3 d
64 > pick 055a42cdd887 3 d
65 > fold e860deea161a 4 e
65 > fold e860deea161a 4 e
66 > pick 652413bf663e 5 f
66 > pick 652413bf663e 5 f
67 > EOF
67 > EOF
68 $ hg histedit 1 --commands commands.txt --verbose | grep histedit
68 $ hg histedit 1 --commands commands.txt --verbose | grep histedit
69 saved backup bundle to $TESTTMP/base/.hg/strip-backup/34a9919932c1-backup.hg (glob)
69 saved backup bundle to $TESTTMP/base/.hg/strip-backup/34a9919932c1-backup.hg (glob)
70 $ hg log --graph --hidden
70 $ hg log --graph --hidden
71 @ 8:0efacef7cb48 f
71 @ 8:0efacef7cb48 f
72 |
72 |
73 o 7:ae467701c500 d
73 o 7:ae467701c500 d
74 |
74 |
75 o 6:d36c0562f908 c
75 o 6:d36c0562f908 c
76 |
76 |
77 | x 5:652413bf663e f
77 | x 5:652413bf663e f
78 | |
78 | |
79 | x 4:e860deea161a e
79 | x 4:e860deea161a e
80 | |
80 | |
81 | x 3:055a42cdd887 d
81 | x 3:055a42cdd887 d
82 | |
82 | |
83 | x 2:177f92b77385 c
83 | x 2:177f92b77385 c
84 | |
84 | |
85 | x 1:d2ae7f538514 b
85 | x 1:d2ae7f538514 b
86 |/
86 |/
87 o 0:cb9a9f314b8b a
87 o 0:cb9a9f314b8b a
88
88
89 $ hg debugobsolete
89 $ hg debugobsolete
90 d2ae7f538514cd87c17547b0de4cea71fe1af9fb 0 {'date': '* *', 'user': 'test'} (glob)
90 d2ae7f538514cd87c17547b0de4cea71fe1af9fb 0 {'date': '* *', 'user': 'test'} (glob)
91 177f92b773850b59254aa5e923436f921b55483b d36c0562f908c692f5204d606d4ff3537d41f1bf 0 {'date': '* *', 'user': 'test'} (glob)
91 177f92b773850b59254aa5e923436f921b55483b d36c0562f908c692f5204d606d4ff3537d41f1bf 0 {'date': '* *', 'user': 'test'} (glob)
92 055a42cdd88768532f9cf79daa407fc8d138de9b ae467701c5006bf21ffcfdb555b3d6b63280b6b7 0 {'date': '* *', 'user': 'test'} (glob)
92 055a42cdd88768532f9cf79daa407fc8d138de9b ae467701c5006bf21ffcfdb555b3d6b63280b6b7 0 {'date': '* *', 'user': 'test'} (glob)
93 e860deea161a2f77de56603b340ebbb4536308ae ae467701c5006bf21ffcfdb555b3d6b63280b6b7 0 {'date': '* *', 'user': 'test'} (glob)
93 e860deea161a2f77de56603b340ebbb4536308ae ae467701c5006bf21ffcfdb555b3d6b63280b6b7 0 {'date': '* *', 'user': 'test'} (glob)
94 652413bf663ef2a641cab26574e46d5f5a64a55a 0efacef7cb481bf574f69075b82d044fdbe5c20f 0 {'date': '* *', 'user': 'test'} (glob)
94 652413bf663ef2a641cab26574e46d5f5a64a55a 0efacef7cb481bf574f69075b82d044fdbe5c20f 0 {'date': '* *', 'user': 'test'} (glob)
95
95
96
96
97 Ensure hidden revision does not prevent histedit
97 Ensure hidden revision does not prevent histedit
98 -------------------------------------------------
98 -------------------------------------------------
99
99
100 create an hidden revision
100 create an hidden revision
101
101
102 $ cat > commands.txt <<EOF
102 $ cat > commands.txt <<EOF
103 > pick d36c0562f908 6 c
103 > pick d36c0562f908 6 c
104 > drop ae467701c500 7 d
104 > drop ae467701c500 7 d
105 > pick 0efacef7cb48 8 f
105 > pick 0efacef7cb48 8 f
106 > EOF
106 > EOF
107 $ hg histedit 6 --commands commands.txt
107 $ hg histedit 6 --commands commands.txt
108 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
108 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
109 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
109 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
110 $ hg log --graph
110 $ hg log --graph
111 @ 9:7c044e3e33a9 f
111 @ 9:7c044e3e33a9 f
112 |
112 |
113 o 6:d36c0562f908 c
113 o 6:d36c0562f908 c
114 |
114 |
115 o 0:cb9a9f314b8b a
115 o 0:cb9a9f314b8b a
116
116
117 check hidden revision are ignored (6 have hidden children 7 and 8)
117 check hidden revision are ignored (6 have hidden children 7 and 8)
118
118
119 $ cat > commands.txt <<EOF
119 $ cat > commands.txt <<EOF
120 > pick d36c0562f908 6 c
120 > pick d36c0562f908 6 c
121 > pick 7c044e3e33a9 8 f
121 > pick 7c044e3e33a9 8 f
122 > EOF
122 > EOF
123 $ hg histedit 6 --commands commands.txt
123 $ hg histedit 6 --commands commands.txt
124 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
124 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
125
125
126
126
127 Check that histedit respect phases
127 Check that histedit respect phases
128 =========================================
128 =========================================
129
129
130 (not directly related to the test file but doesn't deserve it's own test case)
130 (not directly related to the test file but doesn't deserve it's own test case)
131
131
132 $ hg log -G
132 $ hg log -G
133 @ 9:7c044e3e33a9 f
133 @ 9:7c044e3e33a9 f
134 |
134 |
135 o 6:d36c0562f908 c
135 o 6:d36c0562f908 c
136 |
136 |
137 o 0:cb9a9f314b8b a
137 o 0:cb9a9f314b8b a
138
138
139 $ hg ph -pv '.^'
139 $ hg ph -pv '.^'
140 phase changed for 2 changesets
140 phase changed for 2 changesets
141 $ hg histedit -r '.~2'
141 $ hg histedit -r '.~2'
142 abort: cannot edit immutable changeset: cb9a9f314b8b
142 abort: cannot edit immutable changeset: cb9a9f314b8b
143 [255]
143 [255]
144
144
145
145
146 +Test ui.prevent-unstable option
146 Test that rewriting leaving instability behind is allowed
147 +------------------------------------
147 ---------------------------------------------------------------------
148
148
149 $ hg up '.^'
149 $ hg up '.^'
150 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
150 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
151 $ hg phase --force --draft .
151 $ hg phase --force --draft .
152 $ hg log -r 'children(.)'
152 $ hg log -r 'children(.)'
153 9:7c044e3e33a9 f (no-eol)
153 9:7c044e3e33a9 f (no-eol)
154 $ hg histedit -r '.'
154 $ hg histedit -r '.'
155 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
155 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -1,308 +1,308 b''
1 ==========================
1 ==========================
2 Test rebase with obsolete
2 Test rebase with obsolete
3 ==========================
3 ==========================
4
4
5 Enable obsolete
5 Enable obsolete
6
6
7 $ cat > ${TESTTMP}/obs.py << EOF
7 $ cat > ${TESTTMP}/obs.py << EOF
8 > import mercurial.obsolete
8 > import mercurial.obsolete
9 > mercurial.obsolete._enabled = True
9 > mercurial.obsolete._enabled = True
10 > EOF
10 > EOF
11 $ cat >> $HGRCPATH << EOF
11 $ cat >> $HGRCPATH << EOF
12 > [ui]
12 > [ui]
13 > logtemplate= {rev}:{node|short} {desc|firstline}
13 > logtemplate= {rev}:{node|short} {desc|firstline}
14 > [phases]
14 > [phases]
15 > publish=False
15 > publish=False
16 > [extensions]'
16 > [extensions]'
17 > rebase=
17 > rebase=
18 >
18 >
19 > obs=${TESTTMP}/obs.py
19 > obs=${TESTTMP}/obs.py
20 > EOF
20 > EOF
21
21
22 Setup rebase canonical repo
22 Setup rebase canonical repo
23
23
24 $ hg init base
24 $ hg init base
25 $ cd base
25 $ cd base
26 $ hg unbundle "$TESTDIR/bundles/rebase.hg"
26 $ hg unbundle "$TESTDIR/bundles/rebase.hg"
27 adding changesets
27 adding changesets
28 adding manifests
28 adding manifests
29 adding file changes
29 adding file changes
30 added 8 changesets with 7 changes to 7 files (+2 heads)
30 added 8 changesets with 7 changes to 7 files (+2 heads)
31 (run 'hg heads' to see heads, 'hg merge' to merge)
31 (run 'hg heads' to see heads, 'hg merge' to merge)
32 $ hg up tip
32 $ hg up tip
33 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
33 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
34 $ hg log -G
34 $ hg log -G
35 @ 7:02de42196ebe H
35 @ 7:02de42196ebe H
36 |
36 |
37 | o 6:eea13746799a G
37 | o 6:eea13746799a G
38 |/|
38 |/|
39 o | 5:24b6387c8c8c F
39 o | 5:24b6387c8c8c F
40 | |
40 | |
41 | o 4:9520eea781bc E
41 | o 4:9520eea781bc E
42 |/
42 |/
43 | o 3:32af7686d403 D
43 | o 3:32af7686d403 D
44 | |
44 | |
45 | o 2:5fddd98957c8 C
45 | o 2:5fddd98957c8 C
46 | |
46 | |
47 | o 1:42ccdea3bb16 B
47 | o 1:42ccdea3bb16 B
48 |/
48 |/
49 o 0:cd010b8cd998 A
49 o 0:cd010b8cd998 A
50
50
51 $ cd ..
51 $ cd ..
52
52
53 simple rebase
53 simple rebase
54 ---------------------------------
54 ---------------------------------
55
55
56 $ hg clone base simple
56 $ hg clone base simple
57 updating to branch default
57 updating to branch default
58 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
58 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
59 $ cd simple
59 $ cd simple
60 $ hg up 32af7686d403
60 $ hg up 32af7686d403
61 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
61 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
62 $ hg rebase -d eea13746799a
62 $ hg rebase -d eea13746799a
63 $ hg log -G
63 $ hg log -G
64 @ 10:8eeb3c33ad33 D
64 @ 10:8eeb3c33ad33 D
65 |
65 |
66 o 9:2327fea05063 C
66 o 9:2327fea05063 C
67 |
67 |
68 o 8:e4e5be0395b2 B
68 o 8:e4e5be0395b2 B
69 |
69 |
70 | o 7:02de42196ebe H
70 | o 7:02de42196ebe H
71 | |
71 | |
72 o | 6:eea13746799a G
72 o | 6:eea13746799a G
73 |\|
73 |\|
74 | o 5:24b6387c8c8c F
74 | o 5:24b6387c8c8c F
75 | |
75 | |
76 o | 4:9520eea781bc E
76 o | 4:9520eea781bc E
77 |/
77 |/
78 o 0:cd010b8cd998 A
78 o 0:cd010b8cd998 A
79
79
80 $ hg log --hidden -G
80 $ hg log --hidden -G
81 @ 10:8eeb3c33ad33 D
81 @ 10:8eeb3c33ad33 D
82 |
82 |
83 o 9:2327fea05063 C
83 o 9:2327fea05063 C
84 |
84 |
85 o 8:e4e5be0395b2 B
85 o 8:e4e5be0395b2 B
86 |
86 |
87 | o 7:02de42196ebe H
87 | o 7:02de42196ebe H
88 | |
88 | |
89 o | 6:eea13746799a G
89 o | 6:eea13746799a G
90 |\|
90 |\|
91 | o 5:24b6387c8c8c F
91 | o 5:24b6387c8c8c F
92 | |
92 | |
93 o | 4:9520eea781bc E
93 o | 4:9520eea781bc E
94 |/
94 |/
95 | x 3:32af7686d403 D
95 | x 3:32af7686d403 D
96 | |
96 | |
97 | x 2:5fddd98957c8 C
97 | x 2:5fddd98957c8 C
98 | |
98 | |
99 | x 1:42ccdea3bb16 B
99 | x 1:42ccdea3bb16 B
100 |/
100 |/
101 o 0:cd010b8cd998 A
101 o 0:cd010b8cd998 A
102
102
103 $ hg debugobsolete
103 $ hg debugobsolete
104 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 e4e5be0395b2cbd471ed22a26b1b6a1a0658a794 0 {'date': '*', 'user': 'test'} (glob)
104 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 e4e5be0395b2cbd471ed22a26b1b6a1a0658a794 0 {'date': '*', 'user': 'test'} (glob)
105 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 2327fea05063f39961b14cb69435a9898dc9a245 0 {'date': '*', 'user': 'test'} (glob)
105 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 2327fea05063f39961b14cb69435a9898dc9a245 0 {'date': '*', 'user': 'test'} (glob)
106 32af7686d403cf45b5d95f2d70cebea587ac806a 8eeb3c33ad33d452c89e5dcf611c347f978fb42b 0 {'date': '*', 'user': 'test'} (glob)
106 32af7686d403cf45b5d95f2d70cebea587ac806a 8eeb3c33ad33d452c89e5dcf611c347f978fb42b 0 {'date': '*', 'user': 'test'} (glob)
107
107
108
108
109 $ cd ..
109 $ cd ..
110
110
111 empty changeset
111 empty changeset
112 ---------------------------------
112 ---------------------------------
113
113
114 $ hg clone base empty
114 $ hg clone base empty
115 updating to branch default
115 updating to branch default
116 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
116 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
117 $ cd empty
117 $ cd empty
118 $ hg up eea13746799a
118 $ hg up eea13746799a
119 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
119 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
120
120
121 We make a copy of both the first changeset in the rebased and some other in the
121 We make a copy of both the first changeset in the rebased and some other in the
122 set.
122 set.
123
123
124 $ hg graft 42ccdea3bb16 32af7686d403
124 $ hg graft 42ccdea3bb16 32af7686d403
125 grafting revision 1
125 grafting revision 1
126 grafting revision 3
126 grafting revision 3
127 $ hg rebase -s 42ccdea3bb16 -d .
127 $ hg rebase -s 42ccdea3bb16 -d .
128 $ hg log -G
128 $ hg log -G
129 @ 10:5ae4c968c6ac C
129 @ 10:5ae4c968c6ac C
130 |
130 |
131 o 9:08483444fef9 D
131 o 9:08483444fef9 D
132 |
132 |
133 o 8:8877864f1edb B
133 o 8:8877864f1edb B
134 |
134 |
135 | o 7:02de42196ebe H
135 | o 7:02de42196ebe H
136 | |
136 | |
137 o | 6:eea13746799a G
137 o | 6:eea13746799a G
138 |\|
138 |\|
139 | o 5:24b6387c8c8c F
139 | o 5:24b6387c8c8c F
140 | |
140 | |
141 o | 4:9520eea781bc E
141 o | 4:9520eea781bc E
142 |/
142 |/
143 o 0:cd010b8cd998 A
143 o 0:cd010b8cd998 A
144
144
145 $ hg log --hidden -G
145 $ hg log --hidden -G
146 @ 10:5ae4c968c6ac C
146 @ 10:5ae4c968c6ac C
147 |
147 |
148 o 9:08483444fef9 D
148 o 9:08483444fef9 D
149 |
149 |
150 o 8:8877864f1edb B
150 o 8:8877864f1edb B
151 |
151 |
152 | o 7:02de42196ebe H
152 | o 7:02de42196ebe H
153 | |
153 | |
154 o | 6:eea13746799a G
154 o | 6:eea13746799a G
155 |\|
155 |\|
156 | o 5:24b6387c8c8c F
156 | o 5:24b6387c8c8c F
157 | |
157 | |
158 o | 4:9520eea781bc E
158 o | 4:9520eea781bc E
159 |/
159 |/
160 | x 3:32af7686d403 D
160 | x 3:32af7686d403 D
161 | |
161 | |
162 | x 2:5fddd98957c8 C
162 | x 2:5fddd98957c8 C
163 | |
163 | |
164 | x 1:42ccdea3bb16 B
164 | x 1:42ccdea3bb16 B
165 |/
165 |/
166 o 0:cd010b8cd998 A
166 o 0:cd010b8cd998 A
167
167
168 $ hg debugobsolete
168 $ hg debugobsolete
169 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 08483444fef91d6224f6655ee586a65d263ad34c 0 {'date': '*', 'user': 'test'} (glob)
169 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 08483444fef91d6224f6655ee586a65d263ad34c 0 {'date': '*', 'user': 'test'} (glob)
170 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 {'date': '*', 'user': 'test'} (glob)
170 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 {'date': '*', 'user': 'test'} (glob)
171 32af7686d403cf45b5d95f2d70cebea587ac806a 5ae4c968c6aca831df823664e706c9d4aa34473d 0 {'date': '*', 'user': 'test'} (glob)
171 32af7686d403cf45b5d95f2d70cebea587ac806a 5ae4c968c6aca831df823664e706c9d4aa34473d 0 {'date': '*', 'user': 'test'} (glob)
172
172
173
173
174 $ cd ..
174 $ cd ..
175
175
176 collapse rebase
176 collapse rebase
177 ---------------------------------
177 ---------------------------------
178
178
179 $ hg clone base collapse
179 $ hg clone base collapse
180 updating to branch default
180 updating to branch default
181 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
181 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
182 $ cd collapse
182 $ cd collapse
183 $ hg rebase -s 42ccdea3bb16 -d eea13746799a --collapse
183 $ hg rebase -s 42ccdea3bb16 -d eea13746799a --collapse
184 $ hg log -G
184 $ hg log -G
185 @ 8:4dc2197e807b Collapsed revision
185 @ 8:4dc2197e807b Collapsed revision
186 |
186 |
187 | o 7:02de42196ebe H
187 | o 7:02de42196ebe H
188 | |
188 | |
189 o | 6:eea13746799a G
189 o | 6:eea13746799a G
190 |\|
190 |\|
191 | o 5:24b6387c8c8c F
191 | o 5:24b6387c8c8c F
192 | |
192 | |
193 o | 4:9520eea781bc E
193 o | 4:9520eea781bc E
194 |/
194 |/
195 o 0:cd010b8cd998 A
195 o 0:cd010b8cd998 A
196
196
197 $ hg log --hidden -G
197 $ hg log --hidden -G
198 @ 8:4dc2197e807b Collapsed revision
198 @ 8:4dc2197e807b Collapsed revision
199 |
199 |
200 | o 7:02de42196ebe H
200 | o 7:02de42196ebe H
201 | |
201 | |
202 o | 6:eea13746799a G
202 o | 6:eea13746799a G
203 |\|
203 |\|
204 | o 5:24b6387c8c8c F
204 | o 5:24b6387c8c8c F
205 | |
205 | |
206 o | 4:9520eea781bc E
206 o | 4:9520eea781bc E
207 |/
207 |/
208 | x 3:32af7686d403 D
208 | x 3:32af7686d403 D
209 | |
209 | |
210 | x 2:5fddd98957c8 C
210 | x 2:5fddd98957c8 C
211 | |
211 | |
212 | x 1:42ccdea3bb16 B
212 | x 1:42ccdea3bb16 B
213 |/
213 |/
214 o 0:cd010b8cd998 A
214 o 0:cd010b8cd998 A
215
215
216 $ hg id --debug
216 $ hg id --debug
217 4dc2197e807bae9817f09905b50ab288be2dbbcf tip
217 4dc2197e807bae9817f09905b50ab288be2dbbcf tip
218 $ hg debugobsolete
218 $ hg debugobsolete
219 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 4dc2197e807bae9817f09905b50ab288be2dbbcf 0 {'date': '*', 'user': 'test'} (glob)
219 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 4dc2197e807bae9817f09905b50ab288be2dbbcf 0 {'date': '*', 'user': 'test'} (glob)
220 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 4dc2197e807bae9817f09905b50ab288be2dbbcf 0 {'date': '*', 'user': 'test'} (glob)
220 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 4dc2197e807bae9817f09905b50ab288be2dbbcf 0 {'date': '*', 'user': 'test'} (glob)
221 32af7686d403cf45b5d95f2d70cebea587ac806a 4dc2197e807bae9817f09905b50ab288be2dbbcf 0 {'date': '*', 'user': 'test'} (glob)
221 32af7686d403cf45b5d95f2d70cebea587ac806a 4dc2197e807bae9817f09905b50ab288be2dbbcf 0 {'date': '*', 'user': 'test'} (glob)
222
222
223 $ cd ..
223 $ cd ..
224
224
225 Rebase set has hidden descendants
225 Rebase set has hidden descendants
226 ---------------------------------
226 ---------------------------------
227
227
228 We rebase a changeset which has a hidden changeset. The hidden changeset must
228 We rebase a changeset which has a hidden changeset. The hidden changeset must
229 not be rebased.
229 not be rebased.
230
230
231 $ hg clone base hidden
231 $ hg clone base hidden
232 updating to branch default
232 updating to branch default
233 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
233 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
234 $ cd hidden
234 $ cd hidden
235 $ hg rebase -s 5fddd98957c8 -d eea13746799a
235 $ hg rebase -s 5fddd98957c8 -d eea13746799a
236 $ hg rebase -s 42ccdea3bb16 -d 02de42196ebe
236 $ hg rebase -s 42ccdea3bb16 -d 02de42196ebe
237 $ hg log -G
237 $ hg log -G
238 @ 10:7c6027df6a99 B
238 @ 10:7c6027df6a99 B
239 |
239 |
240 | o 9:cf44d2f5a9f4 D
240 | o 9:cf44d2f5a9f4 D
241 | |
241 | |
242 | o 8:e273c5e7d2d2 C
242 | o 8:e273c5e7d2d2 C
243 | |
243 | |
244 o | 7:02de42196ebe H
244 o | 7:02de42196ebe H
245 | |
245 | |
246 | o 6:eea13746799a G
246 | o 6:eea13746799a G
247 |/|
247 |/|
248 o | 5:24b6387c8c8c F
248 o | 5:24b6387c8c8c F
249 | |
249 | |
250 | o 4:9520eea781bc E
250 | o 4:9520eea781bc E
251 |/
251 |/
252 o 0:cd010b8cd998 A
252 o 0:cd010b8cd998 A
253
253
254 $ hg log --hidden -G
254 $ hg log --hidden -G
255 @ 10:7c6027df6a99 B
255 @ 10:7c6027df6a99 B
256 |
256 |
257 | o 9:cf44d2f5a9f4 D
257 | o 9:cf44d2f5a9f4 D
258 | |
258 | |
259 | o 8:e273c5e7d2d2 C
259 | o 8:e273c5e7d2d2 C
260 | |
260 | |
261 o | 7:02de42196ebe H
261 o | 7:02de42196ebe H
262 | |
262 | |
263 | o 6:eea13746799a G
263 | o 6:eea13746799a G
264 |/|
264 |/|
265 o | 5:24b6387c8c8c F
265 o | 5:24b6387c8c8c F
266 | |
266 | |
267 | o 4:9520eea781bc E
267 | o 4:9520eea781bc E
268 |/
268 |/
269 | x 3:32af7686d403 D
269 | x 3:32af7686d403 D
270 | |
270 | |
271 | x 2:5fddd98957c8 C
271 | x 2:5fddd98957c8 C
272 | |
272 | |
273 | x 1:42ccdea3bb16 B
273 | x 1:42ccdea3bb16 B
274 |/
274 |/
275 o 0:cd010b8cd998 A
275 o 0:cd010b8cd998 A
276
276
277 $ hg debugobsolete
277 $ hg debugobsolete
278 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b e273c5e7d2d29df783dce9f9eaa3ac4adc69c15d 0 {'date': '*', 'user': 'test'} (glob)
278 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b e273c5e7d2d29df783dce9f9eaa3ac4adc69c15d 0 {'date': '*', 'user': 'test'} (glob)
279 32af7686d403cf45b5d95f2d70cebea587ac806a cf44d2f5a9f4297a62be94cbdd3dff7c7dc54258 0 {'date': '*', 'user': 'test'} (glob)
279 32af7686d403cf45b5d95f2d70cebea587ac806a cf44d2f5a9f4297a62be94cbdd3dff7c7dc54258 0 {'date': '*', 'user': 'test'} (glob)
280 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 7c6027df6a99d93f461868e5433f63bde20b6dfb 0 {'date': '*', 'user': 'test'} (glob)
280 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 7c6027df6a99d93f461868e5433f63bde20b6dfb 0 {'date': '*', 'user': 'test'} (glob)
281
281
282 Test ui.prevent-unstable option
282 Test that rewriting leaving instability behind is allowed
283 ------------------------------------
283 ---------------------------------------------------------------------
284
284
285 $ hg log -r 'children(8)'
285 $ hg log -r 'children(8)'
286 9:cf44d2f5a9f4 D (no-eol)
286 9:cf44d2f5a9f4 D (no-eol)
287 $ hg rebase -r 8
287 $ hg rebase -r 8
288 $ hg log -G
288 $ hg log -G
289 @ 11:0d8f238b634c C
289 @ 11:0d8f238b634c C
290 |
290 |
291 o 10:7c6027df6a99 B
291 o 10:7c6027df6a99 B
292 |
292 |
293 | o 9:cf44d2f5a9f4 D
293 | o 9:cf44d2f5a9f4 D
294 | |
294 | |
295 | x 8:e273c5e7d2d2 C
295 | x 8:e273c5e7d2d2 C
296 | |
296 | |
297 o | 7:02de42196ebe H
297 o | 7:02de42196ebe H
298 | |
298 | |
299 | o 6:eea13746799a G
299 | o 6:eea13746799a G
300 |/|
300 |/|
301 o | 5:24b6387c8c8c F
301 o | 5:24b6387c8c8c F
302 | |
302 | |
303 | o 4:9520eea781bc E
303 | o 4:9520eea781bc E
304 |/
304 |/
305 o 0:cd010b8cd998 A
305 o 0:cd010b8cd998 A
306
306
307
307
308
308
General Comments 0
You need to be logged in to leave comments. Login now