Show More
@@ -1,745 +1,745 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 during a merge: |
|
307 | Refuse to amend during a merge: | |
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 |
|
317 | |||
318 | Follow copies/renames: |
|
318 | Follow copies/renames: | |
319 |
|
319 | |||
320 | $ hg mv b c |
|
320 | $ hg mv b c | |
321 | $ hg ci -m 'b -> c' |
|
321 | $ hg ci -m 'b -> c' | |
322 | $ hg mv c d |
|
322 | $ hg mv c d | |
323 | $ hg ci --amend -m 'b -> d' |
|
323 | $ hg ci --amend -m 'b -> d' | |
324 | saved backup bundle to $TESTTMP/.hg/strip-backup/b8c6eac7f12e-amend-backup.hg (glob) |
|
324 | saved backup bundle to $TESTTMP/.hg/strip-backup/b8c6eac7f12e-amend-backup.hg (glob) | |
325 | $ hg st --rev '.^' --copies d |
|
325 | $ hg st --rev '.^' --copies d | |
326 | A d |
|
326 | A d | |
327 | b |
|
327 | b | |
328 | $ hg cp d e |
|
328 | $ hg cp d e | |
329 | $ hg ci -m 'e = d' |
|
329 | $ hg ci -m 'e = d' | |
330 | $ hg cp e f |
|
330 | $ hg cp e f | |
331 | $ hg ci --amend -m 'f = d' |
|
331 | $ hg ci --amend -m 'f = d' | |
332 | saved backup bundle to $TESTTMP/.hg/strip-backup/7f9761d65613-amend-backup.hg (glob) |
|
332 | saved backup bundle to $TESTTMP/.hg/strip-backup/7f9761d65613-amend-backup.hg (glob) | |
333 | $ hg st --rev '.^' --copies f |
|
333 | $ hg st --rev '.^' --copies f | |
334 | A f |
|
334 | A f | |
335 | d |
|
335 | d | |
336 |
|
336 | |||
337 | $ mv f f.orig |
|
337 | $ mv f f.orig | |
338 | $ hg rm -A f |
|
338 | $ hg rm -A f | |
339 | $ hg ci -m removef |
|
339 | $ hg ci -m removef | |
340 | $ hg cp a f |
|
340 | $ hg cp a f | |
341 | $ mv f.orig f |
|
341 | $ mv f.orig f | |
342 | $ hg ci --amend -m replacef |
|
342 | $ hg ci --amend -m replacef | |
343 | saved backup bundle to $TESTTMP/.hg/strip-backup/9e8c5f7e3d95-amend-backup.hg (glob) |
|
343 | saved backup bundle to $TESTTMP/.hg/strip-backup/9e8c5f7e3d95-amend-backup.hg (glob) | |
344 | $ hg st --change . --copies |
|
344 | $ hg st --change . --copies | |
345 | $ hg log -r . --template "{file_copies}\n" |
|
345 | $ hg log -r . --template "{file_copies}\n" | |
346 |
|
346 | |||
347 |
|
347 | |||
348 | Move added file (issue3410): |
|
348 | Move added file (issue3410): | |
349 |
|
349 | |||
350 | $ echo g >> g |
|
350 | $ echo g >> g | |
351 | $ hg ci -Am g |
|
351 | $ hg ci -Am g | |
352 | adding g |
|
352 | adding g | |
353 | $ hg mv g h |
|
353 | $ hg mv g h | |
354 | $ hg ci --amend |
|
354 | $ hg ci --amend | |
355 | saved backup bundle to $TESTTMP/.hg/strip-backup/24aa8eacce2b-amend-backup.hg (glob) |
|
355 | saved backup bundle to $TESTTMP/.hg/strip-backup/24aa8eacce2b-amend-backup.hg (glob) | |
356 | $ hg st --change . --copies h |
|
356 | $ hg st --change . --copies h | |
357 | A h |
|
357 | A h | |
358 | $ hg log -r . --template "{file_copies}\n" |
|
358 | $ hg log -r . --template "{file_copies}\n" | |
359 |
|
359 | |||
360 |
|
360 | |||
361 | Can't rollback an amend: |
|
361 | Can't rollback an amend: | |
362 |
|
362 | |||
363 | $ hg rollback |
|
363 | $ hg rollback | |
364 | no rollback information available |
|
364 | no rollback information available | |
365 | [1] |
|
365 | [1] | |
366 |
|
366 | |||
367 | Preserve extra dict (issue3430): |
|
367 | Preserve extra dict (issue3430): | |
368 |
|
368 | |||
369 | $ hg branch a |
|
369 | $ hg branch a | |
370 | marked working directory as branch a |
|
370 | marked working directory as branch a | |
371 | (branches are permanent and global, did you want a bookmark?) |
|
371 | (branches are permanent and global, did you want a bookmark?) | |
372 | $ echo a >> a |
|
372 | $ echo a >> a | |
373 | $ hg ci -ma |
|
373 | $ hg ci -ma | |
374 | $ hg ci --amend -m "a'" |
|
374 | $ hg ci --amend -m "a'" | |
375 | saved backup bundle to $TESTTMP/.hg/strip-backup/3837aa2a2fdb-amend-backup.hg (glob) |
|
375 | saved backup bundle to $TESTTMP/.hg/strip-backup/3837aa2a2fdb-amend-backup.hg (glob) | |
376 | $ hg log -r . --template "{branch}\n" |
|
376 | $ hg log -r . --template "{branch}\n" | |
377 | a |
|
377 | a | |
378 | $ hg ci --amend -m "a''" |
|
378 | $ hg ci --amend -m "a''" | |
379 | saved backup bundle to $TESTTMP/.hg/strip-backup/c05c06be7514-amend-backup.hg (glob) |
|
379 | saved backup bundle to $TESTTMP/.hg/strip-backup/c05c06be7514-amend-backup.hg (glob) | |
380 | $ hg log -r . --template "{branch}\n" |
|
380 | $ hg log -r . --template "{branch}\n" | |
381 | a |
|
381 | a | |
382 |
|
382 | |||
383 | Also preserve other entries in the dict that are in the old commit, |
|
383 | Also preserve other entries in the dict that are in the old commit, | |
384 | first graft something so there's an additional entry: |
|
384 | first graft something so there's an additional entry: | |
385 |
|
385 | |||
386 | $ hg up 0 -q |
|
386 | $ hg up 0 -q | |
387 | $ echo z > z |
|
387 | $ echo z > z | |
388 | $ hg ci -Am 'fork' |
|
388 | $ hg ci -Am 'fork' | |
389 | adding z |
|
389 | adding z | |
390 | created new head |
|
390 | created new head | |
391 | $ hg up 11 |
|
391 | $ hg up 11 | |
392 | 5 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
392 | 5 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
393 | $ hg graft 12 |
|
393 | $ hg graft 12 | |
394 | grafting revision 12 |
|
394 | grafting revision 12 | |
395 | $ hg ci --amend -m 'graft amend' |
|
395 | $ hg ci --amend -m 'graft amend' | |
396 | saved backup bundle to $TESTTMP/.hg/strip-backup/bd010aea3f39-amend-backup.hg (glob) |
|
396 | saved backup bundle to $TESTTMP/.hg/strip-backup/bd010aea3f39-amend-backup.hg (glob) | |
397 | $ hg log -r . --debug | grep extra |
|
397 | $ hg log -r . --debug | grep extra | |
398 | extra: amend_source=bd010aea3f39f3fb2a2f884b9ccb0471cd77398e |
|
398 | extra: amend_source=bd010aea3f39f3fb2a2f884b9ccb0471cd77398e | |
399 | extra: branch=a |
|
399 | extra: branch=a | |
400 | extra: source=2647734878ef0236dda712fae9c1651cf694ea8a |
|
400 | extra: source=2647734878ef0236dda712fae9c1651cf694ea8a | |
401 |
|
401 | |||
402 | Preserve phase |
|
402 | Preserve phase | |
403 |
|
403 | |||
404 | $ hg phase '.^::.' |
|
404 | $ hg phase '.^::.' | |
405 | 11: draft |
|
405 | 11: draft | |
406 | 13: draft |
|
406 | 13: draft | |
407 | $ hg phase --secret --force . |
|
407 | $ hg phase --secret --force . | |
408 | $ hg phase '.^::.' |
|
408 | $ hg phase '.^::.' | |
409 | 11: draft |
|
409 | 11: draft | |
410 | 13: secret |
|
410 | 13: secret | |
411 | $ hg commit --amend -m 'amend for phase' -q |
|
411 | $ hg commit --amend -m 'amend for phase' -q | |
412 | $ hg phase '.^::.' |
|
412 | $ hg phase '.^::.' | |
413 | 11: draft |
|
413 | 11: draft | |
414 | 13: secret |
|
414 | 13: secret | |
415 |
|
415 | |||
416 | Test amend with obsolete |
|
416 | Test amend with obsolete | |
417 | --------------------------- |
|
417 | --------------------------- | |
418 |
|
418 | |||
419 | Enable obsolete |
|
419 | Enable obsolete | |
420 |
|
420 | |||
421 | $ cat > ${TESTTMP}/obs.py << EOF |
|
421 | $ cat > ${TESTTMP}/obs.py << EOF | |
422 | > import mercurial.obsolete |
|
422 | > import mercurial.obsolete | |
423 | > mercurial.obsolete._enabled = True |
|
423 | > mercurial.obsolete._enabled = True | |
424 | > EOF |
|
424 | > EOF | |
425 | $ echo '[extensions]' >> $HGRCPATH |
|
425 | $ echo '[extensions]' >> $HGRCPATH | |
426 | $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH |
|
426 | $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH | |
427 |
|
427 | |||
428 |
|
428 | |||
429 | Amend with no files changes |
|
429 | Amend with no files changes | |
430 |
|
430 | |||
431 | $ hg id -n |
|
431 | $ hg id -n | |
432 | 13 |
|
432 | 13 | |
433 | $ hg ci --amend -m 'babar' |
|
433 | $ hg ci --amend -m 'babar' | |
434 | $ hg id -n |
|
434 | $ hg id -n | |
435 | 14 |
|
435 | 14 | |
436 | $ hg log -Gl 3 --style=compact |
|
436 | $ hg log -Gl 3 --style=compact | |
437 | @ 14[tip]:11 b650e6ee8614 1970-01-01 00:00 +0000 test |
|
437 | @ 14[tip]:11 b650e6ee8614 1970-01-01 00:00 +0000 test | |
438 | | babar |
|
438 | | babar | |
439 | | |
|
439 | | | |
440 | | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test |
|
440 | | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test | |
441 | | | fork |
|
441 | | | fork | |
442 | | | |
|
442 | | | | |
443 | o | 11 3334b7925910 1970-01-01 00:00 +0000 test |
|
443 | o | 11 3334b7925910 1970-01-01 00:00 +0000 test | |
444 | | | a'' |
|
444 | | | a'' | |
445 | | | |
|
445 | | | | |
446 | $ hg log -Gl 4 --hidden --style=compact |
|
446 | $ hg log -Gl 4 --hidden --style=compact | |
447 | @ 14[tip]:11 b650e6ee8614 1970-01-01 00:00 +0000 test |
|
447 | @ 14[tip]:11 b650e6ee8614 1970-01-01 00:00 +0000 test | |
448 | | babar |
|
448 | | babar | |
449 | | |
|
449 | | | |
450 | | x 13:11 68ff8ff97044 1970-01-01 00:00 +0000 test |
|
450 | | x 13:11 68ff8ff97044 1970-01-01 00:00 +0000 test | |
451 | |/ amend for phase |
|
451 | |/ amend for phase | |
452 | | |
|
452 | | | |
453 | | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test |
|
453 | | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test | |
454 | | | fork |
|
454 | | | fork | |
455 | | | |
|
455 | | | | |
456 | o | 11 3334b7925910 1970-01-01 00:00 +0000 test |
|
456 | o | 11 3334b7925910 1970-01-01 00:00 +0000 test | |
457 | | | a'' |
|
457 | | | a'' | |
458 | | | |
|
458 | | | | |
459 |
|
459 | |||
460 | Amend with files changes |
|
460 | Amend with files changes | |
461 |
|
461 | |||
462 | (note: the extra commit over 15 is a temporary junk I would be happy to get |
|
462 | (note: the extra commit over 15 is a temporary junk I would be happy to get | |
463 | ride of) |
|
463 | ride of) | |
464 |
|
464 | |||
465 | $ echo 'babar' >> a |
|
465 | $ echo 'babar' >> a | |
466 | $ hg commit --amend |
|
466 | $ hg commit --amend | |
467 | $ hg log -Gl 6 --hidden --style=compact |
|
467 | $ hg log -Gl 6 --hidden --style=compact | |
468 | @ 16[tip]:11 9f9e9bccf56c 1970-01-01 00:00 +0000 test |
|
468 | @ 16[tip]:11 9f9e9bccf56c 1970-01-01 00:00 +0000 test | |
469 | | babar |
|
469 | | babar | |
470 | | |
|
470 | | | |
471 | | x 15 90fef497c56f 1970-01-01 00:00 +0000 test |
|
471 | | x 15 90fef497c56f 1970-01-01 00:00 +0000 test | |
472 | | | temporary amend commit for b650e6ee8614 |
|
472 | | | temporary amend commit for b650e6ee8614 | |
473 | | | |
|
473 | | | | |
474 | | x 14:11 b650e6ee8614 1970-01-01 00:00 +0000 test |
|
474 | | x 14:11 b650e6ee8614 1970-01-01 00:00 +0000 test | |
475 | |/ babar |
|
475 | |/ babar | |
476 | | |
|
476 | | | |
477 | | x 13:11 68ff8ff97044 1970-01-01 00:00 +0000 test |
|
477 | | x 13:11 68ff8ff97044 1970-01-01 00:00 +0000 test | |
478 | |/ amend for phase |
|
478 | |/ amend for phase | |
479 | | |
|
479 | | | |
480 | | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test |
|
480 | | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test | |
481 | | | fork |
|
481 | | | fork | |
482 | | | |
|
482 | | | | |
483 | o | 11 3334b7925910 1970-01-01 00:00 +0000 test |
|
483 | o | 11 3334b7925910 1970-01-01 00:00 +0000 test | |
484 | | | a'' |
|
484 | | | a'' | |
485 | | | |
|
485 | | | | |
486 |
|
486 | |||
487 |
|
487 | |||
488 | Test that amend does not make it easy to create obsolescence cycle |
|
488 | Test that amend does not make it easy to create obsolescence cycle | |
489 | --------------------------------------------------------------------- |
|
489 | --------------------------------------------------------------------- | |
490 |
|
490 | |||
491 | $ hg id -r 14 --hidden |
|
491 | $ hg id -r 14 --hidden | |
492 | b650e6ee8614 (a) |
|
492 | b650e6ee8614 (a) | |
493 | $ hg revert -ar 14 --hidden |
|
493 | $ hg revert -ar 14 --hidden | |
494 | reverting a |
|
494 | reverting a | |
495 | $ hg commit --amend |
|
495 | $ hg commit --amend | |
496 | $ hg id |
|
496 | $ hg id | |
497 | b99e5df575f7 (a) tip |
|
497 | b99e5df575f7 (a) tip | |
498 |
|
498 | |||
499 | Test that rewriting leaving instability behind is allowed |
|
499 | Test that rewriting leaving instability behind is allowed | |
500 | --------------------------------------------------------------------- |
|
500 | --------------------------------------------------------------------- | |
501 |
|
501 | |||
502 | $ hg up '.^' |
|
502 | $ hg up '.^' | |
503 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
503 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
504 | $ echo 'b' >> a |
|
504 | $ echo 'b' >> a | |
505 | $ hg log --style compact -r 'children(.)' |
|
505 | $ hg log --style compact -r 'children(.)' | |
506 | 18[tip]:11 b99e5df575f7 1970-01-01 00:00 +0000 test |
|
506 | 18[tip]:11 b99e5df575f7 1970-01-01 00:00 +0000 test | |
507 | babar |
|
507 | babar | |
508 |
|
508 | |||
509 | $ hg commit --amend |
|
509 | $ hg commit --amend | |
510 | $ hg log -r 'unstable()' |
|
510 | $ hg log -r 'unstable()' | |
511 | changeset: 18:b99e5df575f7 |
|
511 | changeset: 18:b99e5df575f7 | |
512 | branch: a |
|
512 | branch: a | |
513 | parent: 11:3334b7925910 |
|
513 | parent: 11:3334b7925910 | |
514 | user: test |
|
514 | user: test | |
515 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
515 | date: Thu Jan 01 00:00:00 1970 +0000 | |
516 | summary: babar |
|
516 | summary: babar | |
517 |
|
517 | |||
518 |
|
518 | |||
519 | Amend a merge changeset (with renames and conflicts from the second parent): |
|
519 | Amend a merge changeset (with renames and conflicts from the second parent): | |
520 |
|
520 | |||
521 | $ hg up -q default |
|
521 | $ hg up -q default | |
522 | $ hg branch -q bar |
|
522 | $ hg branch -q bar | |
523 | $ hg cp a aa |
|
523 | $ hg cp a aa | |
524 | $ hg mv z zz |
|
524 | $ hg mv z zz | |
525 | $ echo cc > cc |
|
525 | $ echo cc > cc | |
526 | $ hg add cc |
|
526 | $ hg add cc | |
527 | $ hg ci -m aazzcc |
|
527 | $ hg ci -m aazzcc | |
528 | $ hg up -q default |
|
528 | $ hg up -q default | |
529 | $ echo a >> a |
|
529 | $ echo a >> a | |
530 | $ echo dd > cc |
|
530 | $ echo dd > cc | |
531 | $ hg add cc |
|
531 | $ hg add cc | |
532 | $ hg ci -m aa |
|
532 | $ hg ci -m aa | |
533 | $ hg merge -q bar |
|
533 | $ hg merge -q bar | |
534 | warning: conflicts during merge. |
|
534 | warning: conflicts during merge. | |
535 | merging cc incomplete! (edit conflicts, then use 'hg resolve --mark') |
|
535 | merging cc incomplete! (edit conflicts, then use 'hg resolve --mark') | |
536 | [1] |
|
536 | [1] | |
537 | $ hg resolve -m cc |
|
537 | $ hg resolve -m cc | |
538 | $ hg ci -m 'merge bar' |
|
538 | $ hg ci -m 'merge bar' | |
539 | $ hg log --config diff.git=1 -pr . |
|
539 | $ hg log --config diff.git=1 -pr . | |
540 | changeset: 23:d51446492733 |
|
540 | changeset: 23:d51446492733 | |
541 | tag: tip |
|
541 | tag: tip | |
542 | parent: 22:30d96aeaf27b |
|
542 | parent: 22:30d96aeaf27b | |
543 | parent: 21:1aa437659d19 |
|
543 | parent: 21:1aa437659d19 | |
544 | user: test |
|
544 | user: test | |
545 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
545 | date: Thu Jan 01 00:00:00 1970 +0000 | |
546 | summary: merge bar |
|
546 | summary: merge bar | |
547 |
|
547 | |||
548 | diff --git a/a b/aa |
|
548 | diff --git a/a b/aa | |
549 | copy from a |
|
549 | copy from a | |
550 | copy to aa |
|
550 | copy to aa | |
551 | diff --git a/cc b/cc |
|
551 | diff --git a/cc b/cc | |
552 | --- a/cc |
|
552 | --- a/cc | |
553 | +++ b/cc |
|
553 | +++ b/cc | |
554 | @@ -1,1 +1,5 @@ |
|
554 | @@ -1,1 +1,5 @@ | |
555 | +<<<<<<< local |
|
555 | +<<<<<<< local | |
556 | dd |
|
556 | dd | |
557 | +======= |
|
557 | +======= | |
558 | +cc |
|
558 | +cc | |
559 | +>>>>>>> other |
|
559 | +>>>>>>> other | |
560 | diff --git a/z b/zz |
|
560 | diff --git a/z b/zz | |
561 | rename from z |
|
561 | rename from z | |
562 | rename to zz |
|
562 | rename to zz | |
563 |
|
563 | |||
564 | $ hg debugrename aa |
|
564 | $ hg debugrename aa | |
565 | aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e |
|
565 | aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e | |
566 | $ hg debugrename zz |
|
566 | $ hg debugrename zz | |
567 | zz renamed from z:69a1b67522704ec122181c0890bd16e9d3e7516a |
|
567 | zz renamed from z:69a1b67522704ec122181c0890bd16e9d3e7516a | |
568 | $ hg debugrename cc |
|
568 | $ hg debugrename cc | |
569 | cc not renamed |
|
569 | cc not renamed | |
570 | $ hg ci --amend -m 'merge bar (amend message)' |
|
570 | $ hg ci --amend -m 'merge bar (amend message)' | |
571 | $ hg log --config diff.git=1 -pr . |
|
571 | $ hg log --config diff.git=1 -pr . | |
572 | changeset: 24:59de3dce7a79 |
|
572 | changeset: 24:59de3dce7a79 | |
573 | tag: tip |
|
573 | tag: tip | |
574 | parent: 22:30d96aeaf27b |
|
574 | parent: 22:30d96aeaf27b | |
575 | parent: 21:1aa437659d19 |
|
575 | parent: 21:1aa437659d19 | |
576 | user: test |
|
576 | user: test | |
577 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
577 | date: Thu Jan 01 00:00:00 1970 +0000 | |
578 | summary: merge bar (amend message) |
|
578 | summary: merge bar (amend message) | |
579 |
|
579 | |||
580 | diff --git a/a b/aa |
|
580 | diff --git a/a b/aa | |
581 | copy from a |
|
581 | copy from a | |
582 | copy to aa |
|
582 | copy to aa | |
583 | diff --git a/cc b/cc |
|
583 | diff --git a/cc b/cc | |
584 | --- a/cc |
|
584 | --- a/cc | |
585 | +++ b/cc |
|
585 | +++ b/cc | |
586 | @@ -1,1 +1,5 @@ |
|
586 | @@ -1,1 +1,5 @@ | |
587 | +<<<<<<< local |
|
587 | +<<<<<<< local | |
588 | dd |
|
588 | dd | |
589 | +======= |
|
589 | +======= | |
590 | +cc |
|
590 | +cc | |
591 | +>>>>>>> other |
|
591 | +>>>>>>> other | |
592 | diff --git a/z b/zz |
|
592 | diff --git a/z b/zz | |
593 | rename from z |
|
593 | rename from z | |
594 | rename to zz |
|
594 | rename to zz | |
595 |
|
595 | |||
596 | $ hg debugrename aa |
|
596 | $ hg debugrename aa | |
597 | aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e |
|
597 | aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e | |
598 | $ hg debugrename zz |
|
598 | $ hg debugrename zz | |
599 | zz renamed from z:69a1b67522704ec122181c0890bd16e9d3e7516a |
|
599 | zz renamed from z:69a1b67522704ec122181c0890bd16e9d3e7516a | |
600 | $ hg debugrename cc |
|
600 | $ hg debugrename cc | |
601 | cc not renamed |
|
601 | cc not renamed | |
602 | $ hg mv zz z |
|
602 | $ hg mv zz z | |
603 | $ hg ci --amend -m 'merge bar (undo rename)' |
|
603 | $ hg ci --amend -m 'merge bar (undo rename)' | |
604 | $ hg log --config diff.git=1 -pr . |
|
604 | $ hg log --config diff.git=1 -pr . | |
605 | changeset: 26:7fb89c461f81 |
|
605 | changeset: 26:7fb89c461f81 | |
606 | tag: tip |
|
606 | tag: tip | |
607 | parent: 22:30d96aeaf27b |
|
607 | parent: 22:30d96aeaf27b | |
608 | parent: 21:1aa437659d19 |
|
608 | parent: 21:1aa437659d19 | |
609 | user: test |
|
609 | user: test | |
610 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
610 | date: Thu Jan 01 00:00:00 1970 +0000 | |
611 | summary: merge bar (undo rename) |
|
611 | summary: merge bar (undo rename) | |
612 |
|
612 | |||
613 | diff --git a/a b/aa |
|
613 | diff --git a/a b/aa | |
614 | copy from a |
|
614 | copy from a | |
615 | copy to aa |
|
615 | copy to aa | |
616 | diff --git a/cc b/cc |
|
616 | diff --git a/cc b/cc | |
617 | --- a/cc |
|
617 | --- a/cc | |
618 | +++ b/cc |
|
618 | +++ b/cc | |
619 | @@ -1,1 +1,5 @@ |
|
619 | @@ -1,1 +1,5 @@ | |
620 | +<<<<<<< local |
|
620 | +<<<<<<< local | |
621 | dd |
|
621 | dd | |
622 | +======= |
|
622 | +======= | |
623 | +cc |
|
623 | +cc | |
624 | +>>>>>>> other |
|
624 | +>>>>>>> other | |
625 |
|
625 | |||
626 | $ hg debugrename z |
|
626 | $ hg debugrename z | |
627 | z not renamed |
|
627 | z not renamed | |
628 |
|
628 | |||
629 | Amend a merge changeset (with renames during the merge): |
|
629 | Amend a merge changeset (with renames during the merge): | |
630 |
|
630 | |||
631 | $ hg up -q bar |
|
631 | $ hg up -q bar | |
632 | $ echo x > x |
|
632 | $ echo x > x | |
633 | $ hg add x |
|
633 | $ hg add x | |
634 | $ hg ci -m x |
|
634 | $ hg ci -m x | |
635 | $ hg up -q default |
|
635 | $ hg up -q default | |
636 | $ hg merge -q bar |
|
636 | $ hg merge -q bar | |
637 | $ hg mv aa aaa |
|
637 | $ hg mv aa aaa | |
638 | $ echo aa >> aaa |
|
638 | $ echo aa >> aaa | |
639 | $ hg ci -m 'merge bar again' |
|
639 | $ hg ci -m 'merge bar again' | |
640 | $ hg log --config diff.git=1 -pr . |
|
640 | $ hg log --config diff.git=1 -pr . | |
641 | changeset: 28:982d7a34ffee |
|
641 | changeset: 28:982d7a34ffee | |
642 | tag: tip |
|
642 | tag: tip | |
643 | parent: 26:7fb89c461f81 |
|
643 | parent: 26:7fb89c461f81 | |
644 | parent: 27:4c94d5bc65f5 |
|
644 | parent: 27:4c94d5bc65f5 | |
645 | user: test |
|
645 | user: test | |
646 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
646 | date: Thu Jan 01 00:00:00 1970 +0000 | |
647 | summary: merge bar again |
|
647 | summary: merge bar again | |
648 |
|
648 | |||
649 | diff --git a/aa b/aa |
|
649 | diff --git a/aa b/aa | |
650 | deleted file mode 100644 |
|
650 | deleted file mode 100644 | |
651 | --- a/aa |
|
651 | --- a/aa | |
652 | +++ /dev/null |
|
652 | +++ /dev/null | |
653 | @@ -1,2 +0,0 @@ |
|
653 | @@ -1,2 +0,0 @@ | |
654 | -a |
|
654 | -a | |
655 | -a |
|
655 | -a | |
656 | diff --git a/aaa b/aaa |
|
656 | diff --git a/aaa b/aaa | |
657 | new file mode 100644 |
|
657 | new file mode 100644 | |
658 | --- /dev/null |
|
658 | --- /dev/null | |
659 | +++ b/aaa |
|
659 | +++ b/aaa | |
660 | @@ -0,0 +1,3 @@ |
|
660 | @@ -0,0 +1,3 @@ | |
661 | +a |
|
661 | +a | |
662 | +a |
|
662 | +a | |
663 | +aa |
|
663 | +aa | |
664 | diff --git a/x b/x |
|
664 | diff --git a/x b/x | |
665 | new file mode 100644 |
|
665 | new file mode 100644 | |
666 | --- /dev/null |
|
666 | --- /dev/null | |
667 | +++ b/x |
|
667 | +++ b/x | |
668 | @@ -0,0 +1,1 @@ |
|
668 | @@ -0,0 +1,1 @@ | |
669 | +x |
|
669 | +x | |
670 |
|
670 | |||
671 | $ hg debugrename aaa |
|
671 | $ hg debugrename aaa | |
672 | aaa renamed from aa:37d9b5d994eab34eda9c16b195ace52c7b129980 |
|
672 | aaa renamed from aa:37d9b5d994eab34eda9c16b195ace52c7b129980 | |
673 | $ hg mv aaa aa |
|
673 | $ hg mv aaa aa | |
674 | $ hg ci --amend -m 'merge bar again (undo rename)' |
|
674 | $ hg ci --amend -m 'merge bar again (undo rename)' | |
675 | $ hg log --config diff.git=1 -pr . |
|
675 | $ hg log --config diff.git=1 -pr . | |
676 | changeset: 30:522688c0e71b |
|
676 | changeset: 30:522688c0e71b | |
677 | tag: tip |
|
677 | tag: tip | |
678 | parent: 26:7fb89c461f81 |
|
678 | parent: 26:7fb89c461f81 | |
679 | parent: 27:4c94d5bc65f5 |
|
679 | parent: 27:4c94d5bc65f5 | |
680 | user: test |
|
680 | user: test | |
681 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
681 | date: Thu Jan 01 00:00:00 1970 +0000 | |
682 | summary: merge bar again (undo rename) |
|
682 | summary: merge bar again (undo rename) | |
683 |
|
683 | |||
684 | diff --git a/aa b/aa |
|
684 | diff --git a/aa b/aa | |
685 | --- a/aa |
|
685 | --- a/aa | |
686 | +++ b/aa |
|
686 | +++ b/aa | |
687 | @@ -1,2 +1,3 @@ |
|
687 | @@ -1,2 +1,3 @@ | |
688 | a |
|
688 | a | |
689 | a |
|
689 | a | |
690 | +aa |
|
690 | +aa | |
691 | diff --git a/x b/x |
|
691 | diff --git a/x b/x | |
692 | new file mode 100644 |
|
692 | new file mode 100644 | |
693 | --- /dev/null |
|
693 | --- /dev/null | |
694 | +++ b/x |
|
694 | +++ b/x | |
695 | @@ -0,0 +1,1 @@ |
|
695 | @@ -0,0 +1,1 @@ | |
696 | +x |
|
696 | +x | |
697 |
|
697 | |||
698 | $ hg debugrename aa |
|
698 | $ hg debugrename aa | |
699 | aa not renamed |
|
699 | aa not renamed | |
700 | $ hg debugrename -r .^ aa |
|
700 | $ hg debugrename -r '.^' aa | |
701 | aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e |
|
701 | aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e | |
702 |
|
702 | |||
703 | Amend a merge changeset (with manifest-level conflicts): |
|
703 | Amend a merge changeset (with manifest-level conflicts): | |
704 |
|
704 | |||
705 | $ hg up -q bar |
|
705 | $ hg up -q bar | |
706 | $ hg rm aa |
|
706 | $ hg rm aa | |
707 | $ hg ci -m 'rm aa' |
|
707 | $ hg ci -m 'rm aa' | |
708 | $ hg up -q default |
|
708 | $ hg up -q default | |
709 | $ echo aa >> aa |
|
709 | $ echo aa >> aa | |
710 | $ hg ci -m aa |
|
710 | $ hg ci -m aa | |
711 | $ hg merge -q bar |
|
711 | $ hg merge -q bar | |
712 | local changed aa which remote deleted |
|
712 | local changed aa which remote deleted | |
713 | use (c)hanged version or (d)elete? c |
|
713 | use (c)hanged version or (d)elete? c | |
714 | $ hg ci -m 'merge bar (with conflicts)' |
|
714 | $ hg ci -m 'merge bar (with conflicts)' | |
715 | $ hg log --config diff.git=1 -pr . |
|
715 | $ hg log --config diff.git=1 -pr . | |
716 | changeset: 33:5f9904c491b8 |
|
716 | changeset: 33:5f9904c491b8 | |
717 | tag: tip |
|
717 | tag: tip | |
718 | parent: 32:01780b896f58 |
|
718 | parent: 32:01780b896f58 | |
719 | parent: 31:67db8847a540 |
|
719 | parent: 31:67db8847a540 | |
720 | user: test |
|
720 | user: test | |
721 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
721 | date: Thu Jan 01 00:00:00 1970 +0000 | |
722 | summary: merge bar (with conflicts) |
|
722 | summary: merge bar (with conflicts) | |
723 |
|
723 | |||
724 |
|
724 | |||
725 | $ hg rm aa |
|
725 | $ hg rm aa | |
726 | $ hg ci --amend -m 'merge bar (with conflicts, amended)' |
|
726 | $ hg ci --amend -m 'merge bar (with conflicts, amended)' | |
727 | $ hg log --config diff.git=1 -pr . |
|
727 | $ hg log --config diff.git=1 -pr . | |
728 | changeset: 35:6ce0c89781a3 |
|
728 | changeset: 35:6ce0c89781a3 | |
729 | tag: tip |
|
729 | tag: tip | |
730 | parent: 32:01780b896f58 |
|
730 | parent: 32:01780b896f58 | |
731 | parent: 31:67db8847a540 |
|
731 | parent: 31:67db8847a540 | |
732 | user: test |
|
732 | user: test | |
733 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
733 | date: Thu Jan 01 00:00:00 1970 +0000 | |
734 | summary: merge bar (with conflicts, amended) |
|
734 | summary: merge bar (with conflicts, amended) | |
735 |
|
735 | |||
736 | diff --git a/aa b/aa |
|
736 | diff --git a/aa b/aa | |
737 | deleted file mode 100644 |
|
737 | deleted file mode 100644 | |
738 | --- a/aa |
|
738 | --- a/aa | |
739 | +++ /dev/null |
|
739 | +++ /dev/null | |
740 | @@ -1,4 +0,0 @@ |
|
740 | @@ -1,4 +0,0 @@ | |
741 | -a |
|
741 | -a | |
742 | -a |
|
742 | -a | |
743 | -aa |
|
743 | -aa | |
744 | -aa |
|
744 | -aa | |
745 |
|
745 |
General Comments 0
You need to be logged in to leave comments.
Login now