Show More
@@ -1,611 +1,628 b'' | |||||
1 | #testcases obsstore-off obsstore-on |
|
1 | #testcases obsstore-off obsstore-on | |
2 |
|
2 | |||
3 | $ cat << EOF >> $HGRCPATH |
|
3 | $ cat << EOF >> $HGRCPATH | |
4 | > [extensions] |
|
4 | > [extensions] | |
5 | > amend= |
|
5 | > amend= | |
6 | > debugdrawdag=$TESTDIR/drawdag.py |
|
6 | > debugdrawdag=$TESTDIR/drawdag.py | |
7 | > [diff] |
|
7 | > [diff] | |
8 | > git=1 |
|
8 | > git=1 | |
9 | > EOF |
|
9 | > EOF | |
10 |
|
10 | |||
11 | #if obsstore-on |
|
11 | #if obsstore-on | |
12 | $ cat << EOF >> $HGRCPATH |
|
12 | $ cat << EOF >> $HGRCPATH | |
13 | > [experimental] |
|
13 | > [experimental] | |
14 | > evolution.createmarkers=True |
|
14 | > evolution.createmarkers=True | |
15 | > EOF |
|
15 | > EOF | |
16 | #endif |
|
16 | #endif | |
17 |
|
17 | |||
18 | Basic amend |
|
18 | Basic amend | |
19 |
|
19 | |||
20 | $ hg init repo1 |
|
20 | $ hg init repo1 | |
21 | $ cd repo1 |
|
21 | $ cd repo1 | |
22 | $ hg debugdrawdag <<'EOS' |
|
22 | $ hg debugdrawdag <<'EOS' | |
23 | > B |
|
23 | > B | |
24 | > | |
|
24 | > | | |
25 | > A |
|
25 | > A | |
26 | > EOS |
|
26 | > EOS | |
27 |
|
27 | |||
28 | $ hg update B -q |
|
28 | $ hg update B -q | |
29 | $ echo 2 >> B |
|
29 | $ echo 2 >> B | |
30 |
|
30 | |||
31 | $ hg amend |
|
31 | $ hg amend | |
32 | saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/112478962961-7e959a55-amend.hg (obsstore-off !) |
|
32 | saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/112478962961-7e959a55-amend.hg (obsstore-off !) | |
33 | #if obsstore-off |
|
33 | #if obsstore-off | |
34 | $ hg log -p -G --hidden -T '{rev} {node|short} {desc}\n' |
|
34 | $ hg log -p -G --hidden -T '{rev} {node|short} {desc}\n' | |
35 | @ 1 be169c7e8dbe B |
|
35 | @ 1 be169c7e8dbe B | |
36 | | diff --git a/B b/B |
|
36 | | diff --git a/B b/B | |
37 | | new file mode 100644 |
|
37 | | new file mode 100644 | |
38 | | --- /dev/null |
|
38 | | --- /dev/null | |
39 | | +++ b/B |
|
39 | | +++ b/B | |
40 | | @@ -0,0 +1,1 @@ |
|
40 | | @@ -0,0 +1,1 @@ | |
41 | | +B2 |
|
41 | | +B2 | |
42 | | |
|
42 | | | |
43 | o 0 426bada5c675 A |
|
43 | o 0 426bada5c675 A | |
44 | diff --git a/A b/A |
|
44 | diff --git a/A b/A | |
45 | new file mode 100644 |
|
45 | new file mode 100644 | |
46 | --- /dev/null |
|
46 | --- /dev/null | |
47 | +++ b/A |
|
47 | +++ b/A | |
48 | @@ -0,0 +1,1 @@ |
|
48 | @@ -0,0 +1,1 @@ | |
49 | +A |
|
49 | +A | |
50 | \ No newline at end of file |
|
50 | \ No newline at end of file | |
51 |
|
51 | |||
52 | #else |
|
52 | #else | |
53 | $ hg log -p -G --hidden -T '{rev} {node|short} {desc}\n' |
|
53 | $ hg log -p -G --hidden -T '{rev} {node|short} {desc}\n' | |
54 | @ 2 be169c7e8dbe B |
|
54 | @ 2 be169c7e8dbe B | |
55 | | diff --git a/B b/B |
|
55 | | diff --git a/B b/B | |
56 | | new file mode 100644 |
|
56 | | new file mode 100644 | |
57 | | --- /dev/null |
|
57 | | --- /dev/null | |
58 | | +++ b/B |
|
58 | | +++ b/B | |
59 | | @@ -0,0 +1,1 @@ |
|
59 | | @@ -0,0 +1,1 @@ | |
60 | | +B2 |
|
60 | | +B2 | |
61 | | |
|
61 | | | |
62 | | x 1 112478962961 B |
|
62 | | x 1 112478962961 B | |
63 | |/ diff --git a/B b/B |
|
63 | |/ diff --git a/B b/B | |
64 | | new file mode 100644 |
|
64 | | new file mode 100644 | |
65 | | --- /dev/null |
|
65 | | --- /dev/null | |
66 | | +++ b/B |
|
66 | | +++ b/B | |
67 | | @@ -0,0 +1,1 @@ |
|
67 | | @@ -0,0 +1,1 @@ | |
68 | | +B |
|
68 | | +B | |
69 | | \ No newline at end of file |
|
69 | | \ No newline at end of file | |
70 | | |
|
70 | | | |
71 | o 0 426bada5c675 A |
|
71 | o 0 426bada5c675 A | |
72 | diff --git a/A b/A |
|
72 | diff --git a/A b/A | |
73 | new file mode 100644 |
|
73 | new file mode 100644 | |
74 | --- /dev/null |
|
74 | --- /dev/null | |
75 | +++ b/A |
|
75 | +++ b/A | |
76 | @@ -0,0 +1,1 @@ |
|
76 | @@ -0,0 +1,1 @@ | |
77 | +A |
|
77 | +A | |
78 | \ No newline at end of file |
|
78 | \ No newline at end of file | |
79 |
|
79 | |||
80 | #endif |
|
80 | #endif | |
81 |
|
81 | |||
82 | Nothing changed |
|
82 | Nothing changed | |
83 |
|
83 | |||
84 | $ hg amend |
|
84 | $ hg amend | |
85 | nothing changed |
|
85 | nothing changed | |
86 | [1] |
|
86 | [1] | |
87 |
|
87 | |||
88 | $ hg amend -d "0 0" |
|
88 | $ hg amend -d "0 0" | |
89 | nothing changed |
|
89 | nothing changed | |
90 | [1] |
|
90 | [1] | |
91 |
|
91 | |||
92 | $ hg amend -d "Thu Jan 01 00:00:00 1970 UTC" |
|
92 | $ hg amend -d "Thu Jan 01 00:00:00 1970 UTC" | |
93 | nothing changed |
|
93 | nothing changed | |
94 | [1] |
|
94 | [1] | |
95 |
|
95 | |||
96 | #if obsstore-on |
|
96 | #if obsstore-on | |
97 | $ hg init repo-merge-state |
|
97 | $ hg init repo-merge-state | |
98 | $ cd repo-merge-state |
|
98 | $ cd repo-merge-state | |
99 | $ echo a > f |
|
99 | $ echo a > f | |
100 | $ hg ci -Aqm a |
|
100 | $ hg ci -Aqm a | |
101 | $ echo b > f |
|
101 | $ echo b > f | |
102 | $ hg ci -Aqm b |
|
102 | $ hg ci -Aqm b | |
103 | $ echo c > f |
|
103 | $ echo c > f | |
104 | $ hg co -m '.^' |
|
104 | $ hg co -m '.^' | |
105 | merging f |
|
105 | merging f | |
106 | warning: conflicts while merging f! (edit, then use 'hg resolve --mark') |
|
106 | warning: conflicts while merging f! (edit, then use 'hg resolve --mark') | |
107 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
107 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
108 | use 'hg resolve' to retry unresolved file merges |
|
108 | use 'hg resolve' to retry unresolved file merges | |
109 | [1] |
|
109 | [1] | |
110 | $ echo d > f |
|
110 | $ echo d > f | |
111 | $ hg resolve -m f |
|
111 | $ hg resolve -m f | |
112 | (no more unresolved files) |
|
112 | (no more unresolved files) | |
113 | $ hg ci --amend --config experimental.evolution.allowunstable=True |
|
113 | $ hg ci --amend --config experimental.evolution.allowunstable=True | |
114 | 1 new orphan changesets |
|
114 | 1 new orphan changesets | |
115 | $ hg resolve -l |
|
115 | $ hg resolve -l | |
116 | $ cd .. |
|
116 | $ cd .. | |
117 | #endif |
|
117 | #endif | |
118 |
|
118 | |||
119 | Matcher and metadata options |
|
119 | Matcher and metadata options | |
120 |
|
120 | |||
121 | $ echo 3 > C |
|
121 | $ echo 3 > C | |
122 | $ echo 4 > D |
|
122 | $ echo 4 > D | |
123 | $ hg add C D |
|
123 | $ hg add C D | |
124 | $ hg amend -m NEWMESSAGE -I C |
|
124 | $ hg amend -m NEWMESSAGE -I C | |
125 | saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/be169c7e8dbe-7684ddc5-amend.hg (obsstore-off !) |
|
125 | saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/be169c7e8dbe-7684ddc5-amend.hg (obsstore-off !) | |
126 | $ hg log -r . -T '{node|short} {desc} {files}\n' |
|
126 | $ hg log -r . -T '{node|short} {desc} {files}\n' | |
127 | c7ba14d9075b NEWMESSAGE B C |
|
127 | c7ba14d9075b NEWMESSAGE B C | |
128 | $ echo 5 > E |
|
128 | $ echo 5 > E | |
129 | $ rm C |
|
129 | $ rm C | |
130 | $ hg amend -d '2000 1000' -u 'Foo <foo@example.com>' -A C D |
|
130 | $ hg amend -d '2000 1000' -u 'Foo <foo@example.com>' -A C D | |
131 | saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/c7ba14d9075b-b3e76daa-amend.hg (obsstore-off !) |
|
131 | saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/c7ba14d9075b-b3e76daa-amend.hg (obsstore-off !) | |
132 | $ hg log -r . -T '{node|short} {desc} {files} {author} {date}\n' |
|
132 | $ hg log -r . -T '{node|short} {desc} {files} {author} {date}\n' | |
133 | 14f6c4bcc865 NEWMESSAGE B D Foo <foo@example.com> 2000.01000 |
|
133 | 14f6c4bcc865 NEWMESSAGE B D Foo <foo@example.com> 2000.01000 | |
134 |
|
134 | |||
135 | Amend with editor |
|
135 | Amend with editor | |
136 |
|
136 | |||
137 | $ cat > $TESTTMP/prefix.sh <<'EOF' |
|
137 | $ cat > $TESTTMP/prefix.sh <<'EOF' | |
138 | > printf 'EDITED: ' > $TESTTMP/msg |
|
138 | > printf 'EDITED: ' > $TESTTMP/msg | |
139 | > cat "$1" >> $TESTTMP/msg |
|
139 | > cat "$1" >> $TESTTMP/msg | |
140 | > mv $TESTTMP/msg "$1" |
|
140 | > mv $TESTTMP/msg "$1" | |
141 | > EOF |
|
141 | > EOF | |
142 | $ chmod +x $TESTTMP/prefix.sh |
|
142 | $ chmod +x $TESTTMP/prefix.sh | |
143 |
|
143 | |||
144 | $ HGEDITOR="sh $TESTTMP/prefix.sh" hg amend --edit |
|
144 | $ HGEDITOR="sh $TESTTMP/prefix.sh" hg amend --edit | |
145 | saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/14f6c4bcc865-6591f15d-amend.hg (obsstore-off !) |
|
145 | saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/14f6c4bcc865-6591f15d-amend.hg (obsstore-off !) | |
146 | $ hg log -r . -T '{node|short} {desc}\n' |
|
146 | $ hg log -r . -T '{node|short} {desc}\n' | |
147 | 298f085230c3 EDITED: NEWMESSAGE |
|
147 | 298f085230c3 EDITED: NEWMESSAGE | |
148 | $ HGEDITOR="sh $TESTTMP/prefix.sh" hg amend -e -m MSG |
|
148 | $ HGEDITOR="sh $TESTTMP/prefix.sh" hg amend -e -m MSG | |
149 | saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/298f085230c3-d81a6ad3-amend.hg (obsstore-off !) |
|
149 | saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/298f085230c3-d81a6ad3-amend.hg (obsstore-off !) | |
150 | $ hg log -r . -T '{node|short} {desc}\n' |
|
150 | $ hg log -r . -T '{node|short} {desc}\n' | |
151 | 974f07f28537 EDITED: MSG |
|
151 | 974f07f28537 EDITED: MSG | |
152 |
|
152 | |||
153 | $ echo FOO > $TESTTMP/msg |
|
153 | $ echo FOO > $TESTTMP/msg | |
154 | $ hg amend -l $TESTTMP/msg -m BAR |
|
154 | $ hg amend -l $TESTTMP/msg -m BAR | |
155 | abort: cannot specify both --message and --logfile |
|
155 | abort: cannot specify both --message and --logfile | |
156 | [10] |
|
156 | [10] | |
157 | $ hg amend -l $TESTTMP/msg |
|
157 | $ hg amend -l $TESTTMP/msg | |
158 | saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/974f07f28537-edb6470a-amend.hg (obsstore-off !) |
|
158 | saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/974f07f28537-edb6470a-amend.hg (obsstore-off !) | |
159 | $ hg log -r . -T '{node|short} {desc}\n' |
|
159 | $ hg log -r . -T '{node|short} {desc}\n' | |
160 | 507be9bdac71 FOO |
|
160 | 507be9bdac71 FOO | |
161 |
|
161 | |||
162 | Interactive mode |
|
162 | Interactive mode | |
163 |
|
163 | |||
164 | $ touch F G |
|
164 | $ touch F G | |
165 | $ hg add F G |
|
165 | $ hg add F G | |
166 | $ cat <<EOS | hg amend -i --config ui.interactive=1 |
|
166 | $ cat <<EOS | hg amend -i --config ui.interactive=1 | |
167 | > y |
|
167 | > y | |
168 | > n |
|
168 | > n | |
169 | > EOS |
|
169 | > EOS | |
170 | diff --git a/F b/F |
|
170 | diff --git a/F b/F | |
171 | new file mode 100644 |
|
171 | new file mode 100644 | |
172 | examine changes to 'F'? |
|
172 | examine changes to 'F'? | |
173 | (enter ? for help) [Ynesfdaq?] y |
|
173 | (enter ? for help) [Ynesfdaq?] y | |
174 |
|
174 | |||
175 | diff --git a/G b/G |
|
175 | diff --git a/G b/G | |
176 | new file mode 100644 |
|
176 | new file mode 100644 | |
177 | examine changes to 'G'? |
|
177 | examine changes to 'G'? | |
178 | (enter ? for help) [Ynesfdaq?] n |
|
178 | (enter ? for help) [Ynesfdaq?] n | |
179 |
|
179 | |||
180 | saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/507be9bdac71-c8077452-amend.hg (obsstore-off !) |
|
180 | saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/507be9bdac71-c8077452-amend.hg (obsstore-off !) | |
181 | $ hg log -r . -T '{files}\n' |
|
181 | $ hg log -r . -T '{files}\n' | |
182 | B D F |
|
182 | B D F | |
183 |
|
183 | |||
184 | Amend in the middle of a stack |
|
184 | Amend in the middle of a stack | |
185 |
|
185 | |||
186 | $ hg init $TESTTMP/repo2 |
|
186 | $ hg init $TESTTMP/repo2 | |
187 | $ cd $TESTTMP/repo2 |
|
187 | $ cd $TESTTMP/repo2 | |
188 | $ hg debugdrawdag <<'EOS' |
|
188 | $ hg debugdrawdag <<'EOS' | |
189 | > C |
|
189 | > C | |
190 | > | |
|
190 | > | | |
191 | > B |
|
191 | > B | |
192 | > | |
|
192 | > | | |
193 | > A |
|
193 | > A | |
194 | > EOS |
|
194 | > EOS | |
195 |
|
195 | |||
196 | $ hg update -q B |
|
196 | $ hg update -q B | |
197 | $ echo 2 >> B |
|
197 | $ echo 2 >> B | |
198 | $ hg amend |
|
198 | $ hg amend | |
199 | abort: cannot amend changeset, as that will orphan 1 descendants |
|
199 | abort: cannot amend changeset, as that will orphan 1 descendants | |
200 | (see 'hg help evolution.instability') |
|
200 | (see 'hg help evolution.instability') | |
201 | [10] |
|
201 | [10] | |
202 |
|
202 | |||
203 | #if obsstore-on |
|
203 | #if obsstore-on | |
204 |
|
204 | |||
205 | With allowunstable, amend could work in the middle of a stack |
|
205 | With allowunstable, amend could work in the middle of a stack | |
206 |
|
206 | |||
207 | $ cat >> $HGRCPATH <<EOF |
|
207 | $ cat >> $HGRCPATH <<EOF | |
208 | > [experimental] |
|
208 | > [experimental] | |
209 | > evolution.createmarkers=True |
|
209 | > evolution.createmarkers=True | |
210 | > evolution.allowunstable=True |
|
210 | > evolution.allowunstable=True | |
211 | > EOF |
|
211 | > EOF | |
212 |
|
212 | |||
213 | $ hg amend |
|
213 | $ hg amend | |
214 | 1 new orphan changesets |
|
214 | 1 new orphan changesets | |
215 | $ hg log -T '{rev} {node|short} {desc}\n' -G |
|
215 | $ hg log -T '{rev} {node|short} {desc}\n' -G | |
216 | @ 3 be169c7e8dbe B |
|
216 | @ 3 be169c7e8dbe B | |
217 | | |
|
217 | | | |
218 | | * 2 26805aba1e60 C |
|
218 | | * 2 26805aba1e60 C | |
219 | | | |
|
219 | | | | |
220 | | x 1 112478962961 B |
|
220 | | x 1 112478962961 B | |
221 | |/ |
|
221 | |/ | |
222 | o 0 426bada5c675 A |
|
222 | o 0 426bada5c675 A | |
223 |
|
223 | |||
224 | Checking the note stored in the obsmarker |
|
224 | Checking the note stored in the obsmarker | |
225 |
|
225 | |||
226 | $ echo foo > bar |
|
226 | $ echo foo > bar | |
227 | $ hg add bar |
|
227 | $ hg add bar | |
228 | $ hg amend --note 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy' |
|
228 | $ hg amend --note 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy' | |
229 | abort: cannot store a note of more than 255 bytes |
|
229 | abort: cannot store a note of more than 255 bytes | |
230 | [10] |
|
230 | [10] | |
231 | $ hg amend --note "adding bar" |
|
231 | $ hg amend --note "adding bar" | |
232 | $ hg debugobsolete -r . |
|
232 | $ hg debugobsolete -r . | |
233 | 112478962961147124edd43549aedd1a335e44bf be169c7e8dbe21cd10b3d79691cbe7f241e3c21c 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'} |
|
233 | 112478962961147124edd43549aedd1a335e44bf be169c7e8dbe21cd10b3d79691cbe7f241e3c21c 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'} | |
234 | be169c7e8dbe21cd10b3d79691cbe7f241e3c21c 16084da537dd8f84cfdb3055c633772269d62e1b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'note': 'adding bar', 'operation': 'amend', 'user': 'test'} |
|
234 | be169c7e8dbe21cd10b3d79691cbe7f241e3c21c 16084da537dd8f84cfdb3055c633772269d62e1b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'note': 'adding bar', 'operation': 'amend', 'user': 'test'} | |
235 |
|
235 | |||
236 | Cannot cause divergence by default |
|
236 | Cannot cause divergence by default | |
237 |
|
237 | |||
238 | $ hg co --hidden 1 |
|
238 | $ hg co --hidden 1 | |
239 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
239 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
240 | $ hg amend -m divergent |
|
240 | $ hg amend -m divergent | |
241 | abort: cannot amend 112478962961, as that creates content-divergence with 16084da537dd |
|
241 | abort: cannot amend 112478962961, as that creates content-divergence with 16084da537dd | |
242 | (add --verbose for details or see 'hg help evolution.instability') |
|
242 | (add --verbose for details or see 'hg help evolution.instability') | |
243 | [10] |
|
243 | [10] | |
244 | $ hg amend -m divergent --verbose |
|
244 | $ hg amend -m divergent --verbose | |
245 | abort: cannot amend 112478962961, as that creates content-divergence with 16084da537dd |
|
245 | abort: cannot amend 112478962961, as that creates content-divergence with 16084da537dd | |
246 | changeset 112478962961 already has a successor in changeset 16084da537dd |
|
246 | changeset 112478962961 already has a successor in changeset 16084da537dd | |
247 | rewriting changeset 112478962961 would create "content-divergence" |
|
247 | rewriting changeset 112478962961 would create "content-divergence" | |
248 | set experimental.evolution.allowdivergence=True to skip this check |
|
248 | set experimental.evolution.allowdivergence=True to skip this check | |
249 | (see 'hg help evolution.instability' for details on content-divergence) |
|
249 | (see 'hg help evolution.instability' for details on content-divergence) | |
250 | [10] |
|
250 | [10] | |
251 | $ hg amend -m divergent --config experimental.evolution.allowdivergence=true |
|
251 | $ hg amend -m divergent --config experimental.evolution.allowdivergence=true | |
252 | 2 new content-divergent changesets |
|
252 | 2 new content-divergent changesets | |
253 |
|
253 | |||
254 | Amending pruned part of split commit does not cause divergence (issue6262) |
|
254 | Amending pruned part of split commit does not cause divergence (issue6262) | |
255 |
|
255 | |||
256 | $ hg debugobsolete $(hg log -T '{node}' -r .) |
|
256 | $ hg debugobsolete $(hg log -T '{node}' -r .) | |
257 | 1 new obsolescence markers |
|
257 | 1 new obsolescence markers | |
258 | obsoleted 1 changesets |
|
258 | obsoleted 1 changesets | |
259 | $ hg co '.^' |
|
259 | $ hg co '.^' | |
260 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
260 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
261 | $ node_B=$(hg log -T '{node}' -r 4) |
|
261 | $ node_B=$(hg log -T '{node}' -r 4) | |
262 | $ hg revert -r $node_B -a |
|
262 | $ hg revert -r $node_B -a | |
263 | adding B |
|
263 | adding B | |
264 | adding bar |
|
264 | adding bar | |
265 | $ hg ci -m B-split1 |
|
265 | $ hg ci -m B-split1 | |
266 | created new head |
|
266 | created new head | |
267 | $ node_B_split1=$(hg log -T '{node}' -r .) |
|
267 | $ node_B_split1=$(hg log -T '{node}' -r .) | |
268 | $ hg co '.^' |
|
268 | $ hg co '.^' | |
269 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
269 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
270 | $ hg revert -r 4 -a |
|
270 | $ hg revert -r 4 -a | |
271 | adding B |
|
271 | adding B | |
272 | adding bar |
|
272 | adding bar | |
273 | $ hg ci -m B-split2 |
|
273 | $ hg ci -m B-split2 | |
274 | created new head |
|
274 | created new head | |
275 | $ node_B_split2=$(hg log -T '{node}' -r .) |
|
275 | $ node_B_split2=$(hg log -T '{node}' -r .) | |
276 | $ hg debugobsolete $node_B $node_B_split1 $node_B_split2 |
|
276 | $ hg debugobsolete $node_B $node_B_split1 $node_B_split2 | |
277 | 1 new obsolescence markers |
|
277 | 1 new obsolescence markers | |
278 | obsoleted 1 changesets |
|
278 | obsoleted 1 changesets | |
279 | $ hg debugobsolete $node_B_split2 |
|
279 | $ hg debugobsolete $node_B_split2 | |
280 | 1 new obsolescence markers |
|
280 | 1 new obsolescence markers | |
281 | obsoleted 1 changesets |
|
281 | obsoleted 1 changesets | |
282 | $ hg co --hidden $node_B_split2 |
|
282 | $ hg co --hidden $node_B_split2 | |
283 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
283 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
284 | $ hg amend -m 'revived B-split2' |
|
284 | $ hg amend -m 'revived B-split2' | |
285 | abort: cannot amend 809fe227532f, as that creates content-divergence with c68306a86921, from 16084da537dd (known-bad-output !) |
|
285 | abort: cannot amend 809fe227532f, as that creates content-divergence with c68306a86921, from 16084da537dd (known-bad-output !) | |
286 | (add --verbose for details or see 'hg help evolution.instability') (known-bad-output !) |
|
286 | (add --verbose for details or see 'hg help evolution.instability') (known-bad-output !) | |
287 | [10] |
|
287 | [10] | |
288 |
|
288 | |||
289 | Hidden common predecessor of divergence does not cause crash |
|
289 | Hidden common predecessor of divergence does not cause crash | |
290 |
|
290 | |||
291 | First create C1 as a pruned successor of C |
|
291 | First create C1 as a pruned successor of C | |
292 | $ hg co C |
|
292 | $ hg co C | |
293 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
293 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
294 | $ hg amend -m C1 |
|
294 | $ hg amend -m C1 | |
295 | $ hg tag --local C1 |
|
295 | $ hg tag --local C1 | |
296 | $ hg debugobsolete $(hg log -T '{node}' -r C1) |
|
296 | $ hg debugobsolete $(hg log -T '{node}' -r C1) | |
297 | 1 new obsolescence markers |
|
297 | 1 new obsolescence markers | |
298 | obsoleted 1 changesets |
|
298 | obsoleted 1 changesets | |
299 | Now create C2 as other side of divergence (not actually divergent because C1 is |
|
299 | Now create C2 as other side of divergence (not actually divergent because C1 is | |
300 | pruned) |
|
300 | pruned) | |
301 | $ hg co C |
|
301 | $ hg co C | |
302 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
302 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
303 | $ hg amend -m C2 |
|
303 | $ hg amend -m C2 | |
304 | 1 new orphan changesets |
|
304 | 1 new orphan changesets | |
305 | Make the common predecessor (C) pruned |
|
305 | Make the common predecessor (C) pruned | |
306 | $ hg tag --local --remove C |
|
306 | $ hg tag --local --remove C | |
307 | $ hg co C1 |
|
307 | $ hg co C1 | |
308 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
308 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
309 | Try to cause divergence |
|
309 | Try to cause divergence | |
310 | $ hg amend -m C11 |
|
310 | $ hg amend -m C11 | |
311 | abort: cannot amend 2758767f5d17, as that creates content-divergence with bfcb433a0dea, from 26805aba1e60 |
|
311 | abort: cannot amend 2758767f5d17, as that creates content-divergence with bfcb433a0dea, from 26805aba1e60 | |
312 | (add --verbose for details or see 'hg help evolution.instability') |
|
312 | (add --verbose for details or see 'hg help evolution.instability') | |
313 | [10] |
|
313 | [10] | |
314 | #endif |
|
314 | #endif | |
315 |
|
315 | |||
316 | Cannot amend public changeset |
|
316 | Cannot amend public changeset | |
317 |
|
317 | |||
318 | $ hg phase -r A --public |
|
318 | $ hg phase -r A --public | |
319 | $ hg update -C -q A |
|
319 | $ hg update -C -q A | |
320 | $ hg amend -m AMEND |
|
320 | $ hg amend -m AMEND | |
321 | abort: cannot amend public changesets: 426bada5c675 |
|
321 | abort: cannot amend public changesets: 426bada5c675 | |
322 | (see 'hg help phases' for details) |
|
322 | (see 'hg help phases' for details) | |
323 | [10] |
|
323 | [10] | |
324 |
|
324 | |||
325 | Amend a merge changeset |
|
325 | Amend a merge changeset | |
326 |
|
326 | |||
327 | $ hg init $TESTTMP/repo3 |
|
327 | $ hg init $TESTTMP/repo3 | |
328 | $ cd $TESTTMP/repo3 |
|
328 | $ cd $TESTTMP/repo3 | |
329 | $ hg debugdrawdag <<'EOS' |
|
329 | $ hg debugdrawdag <<'EOS' | |
330 | > C |
|
330 | > C | |
331 | > /| |
|
331 | > /| | |
332 | > A B |
|
332 | > A B | |
333 | > EOS |
|
333 | > EOS | |
334 | $ hg update -q C |
|
334 | $ hg update -q C | |
335 | $ hg amend -m FOO |
|
335 | $ hg amend -m FOO | |
336 | saved backup bundle to $TESTTMP/repo3/.hg/strip-backup/a35c07e8a2a4-15ff4612-amend.hg (obsstore-off !) |
|
336 | saved backup bundle to $TESTTMP/repo3/.hg/strip-backup/a35c07e8a2a4-15ff4612-amend.hg (obsstore-off !) | |
337 | $ rm .hg/localtags |
|
337 | $ rm .hg/localtags | |
338 | $ hg log -G -T '{desc}\n' |
|
338 | $ hg log -G -T '{desc}\n' | |
339 | @ FOO |
|
339 | @ FOO | |
340 | |\ |
|
340 | |\ | |
341 | | o B |
|
341 | | o B | |
342 | | |
|
342 | | | |
343 | o A |
|
343 | o A | |
344 |
|
344 | |||
345 |
|
345 | |||
346 | More complete test for status changes (issue5732) |
|
346 | More complete test for status changes (issue5732) | |
347 | ------------------------------------------------- |
|
347 | ------------------------------------------------- | |
348 |
|
348 | |||
349 | Generates history of files having 3 states, r0_r1_wc: |
|
349 | Generates history of files having 3 states, r0_r1_wc: | |
350 |
|
350 | |||
351 | r0: ground (content/missing) |
|
351 | r0: ground (content/missing) | |
352 | r1: old state to be amended (content/missing, where missing means removed) |
|
352 | r1: old state to be amended (content/missing, where missing means removed) | |
353 | wc: changes to be included in r1 (content/missing-tracked/untracked) |
|
353 | wc: changes to be included in r1 (content/missing-tracked/untracked) | |
354 |
|
354 | |||
355 | $ hg init $TESTTMP/wcstates |
|
355 | $ hg init $TESTTMP/wcstates | |
356 | $ cd $TESTTMP/wcstates |
|
356 | $ cd $TESTTMP/wcstates | |
357 |
|
357 | |||
358 | $ "$PYTHON" $TESTDIR/generate-working-copy-states.py state 2 1 |
|
358 | $ "$PYTHON" $TESTDIR/generate-working-copy-states.py state 2 1 | |
359 | $ hg addremove -q --similarity 0 |
|
359 | $ hg addremove -q --similarity 0 | |
360 | $ hg commit -m0 |
|
360 | $ hg commit -m0 | |
361 |
|
361 | |||
362 | $ "$PYTHON" $TESTDIR/generate-working-copy-states.py state 2 2 |
|
362 | $ "$PYTHON" $TESTDIR/generate-working-copy-states.py state 2 2 | |
363 | $ hg addremove -q --similarity 0 |
|
363 | $ hg addremove -q --similarity 0 | |
364 | $ hg commit -m1 |
|
364 | $ hg commit -m1 | |
365 |
|
365 | |||
366 | $ "$PYTHON" $TESTDIR/generate-working-copy-states.py state 2 wc |
|
366 | $ "$PYTHON" $TESTDIR/generate-working-copy-states.py state 2 wc | |
367 | $ hg addremove -q --similarity 0 |
|
367 | $ hg addremove -q --similarity 0 | |
368 | $ hg forget *_*_*-untracked |
|
368 | $ hg forget *_*_*-untracked | |
369 | $ rm *_*_missing-* |
|
369 | $ rm *_*_missing-* | |
370 |
|
370 | |||
371 | amend r1 to include wc changes |
|
371 | amend r1 to include wc changes | |
372 |
|
372 | |||
373 | $ hg amend |
|
373 | $ hg amend | |
374 | saved backup bundle to * (glob) (obsstore-off !) |
|
374 | saved backup bundle to * (glob) (obsstore-off !) | |
375 |
|
375 | |||
376 | clean/modified/removed/added states of the amended revision |
|
376 | clean/modified/removed/added states of the amended revision | |
377 |
|
377 | |||
378 | $ hg status --all --change . 'glob:content1_*_content1-tracked' |
|
378 | $ hg status --all --change . 'glob:content1_*_content1-tracked' | |
379 | C content1_content1_content1-tracked |
|
379 | C content1_content1_content1-tracked | |
380 | C content1_content2_content1-tracked |
|
380 | C content1_content2_content1-tracked | |
381 | C content1_missing_content1-tracked |
|
381 | C content1_missing_content1-tracked | |
382 | $ hg status --all --change . 'glob:content1_*_content[23]-tracked' |
|
382 | $ hg status --all --change . 'glob:content1_*_content[23]-tracked' | |
383 | M content1_content1_content3-tracked |
|
383 | M content1_content1_content3-tracked | |
384 | M content1_content2_content2-tracked |
|
384 | M content1_content2_content2-tracked | |
385 | M content1_content2_content3-tracked |
|
385 | M content1_content2_content3-tracked | |
386 | M content1_missing_content3-tracked |
|
386 | M content1_missing_content3-tracked | |
387 | $ hg status --all --change . 'glob:content1_*_missing-tracked' |
|
387 | $ hg status --all --change . 'glob:content1_*_missing-tracked' | |
388 | M content1_content2_missing-tracked |
|
388 | M content1_content2_missing-tracked | |
389 | R content1_missing_missing-tracked |
|
389 | R content1_missing_missing-tracked | |
390 | C content1_content1_missing-tracked |
|
390 | C content1_content1_missing-tracked | |
391 | $ hg status --all --change . 'glob:content1_*_*-untracked' |
|
391 | $ hg status --all --change . 'glob:content1_*_*-untracked' | |
392 | R content1_content1_content1-untracked |
|
392 | R content1_content1_content1-untracked | |
393 | R content1_content1_content3-untracked |
|
393 | R content1_content1_content3-untracked | |
394 | R content1_content1_missing-untracked |
|
394 | R content1_content1_missing-untracked | |
395 | R content1_content2_content1-untracked |
|
395 | R content1_content2_content1-untracked | |
396 | R content1_content2_content2-untracked |
|
396 | R content1_content2_content2-untracked | |
397 | R content1_content2_content3-untracked |
|
397 | R content1_content2_content3-untracked | |
398 | R content1_content2_missing-untracked |
|
398 | R content1_content2_missing-untracked | |
399 | R content1_missing_content1-untracked |
|
399 | R content1_missing_content1-untracked | |
400 | R content1_missing_content3-untracked |
|
400 | R content1_missing_content3-untracked | |
401 | R content1_missing_missing-untracked |
|
401 | R content1_missing_missing-untracked | |
402 | $ hg status --all --change . 'glob:missing_content2_*' |
|
402 | $ hg status --all --change . 'glob:missing_content2_*' | |
403 | A missing_content2_content2-tracked |
|
403 | A missing_content2_content2-tracked | |
404 | A missing_content2_content3-tracked |
|
404 | A missing_content2_content3-tracked | |
405 | A missing_content2_missing-tracked |
|
405 | A missing_content2_missing-tracked | |
406 | $ hg status --all --change . 'glob:missing_missing_*' |
|
406 | $ hg status --all --change . 'glob:missing_missing_*' | |
407 | A missing_missing_content3-tracked |
|
407 | A missing_missing_content3-tracked | |
408 |
|
408 | |||
409 | working directory should be all clean (with some missing/untracked files) |
|
409 | working directory should be all clean (with some missing/untracked files) | |
410 |
|
410 | |||
411 | $ hg status --all 'glob:*_content?-tracked' |
|
411 | $ hg status --all 'glob:*_content?-tracked' | |
412 | C content1_content1_content1-tracked |
|
412 | C content1_content1_content1-tracked | |
413 | C content1_content1_content3-tracked |
|
413 | C content1_content1_content3-tracked | |
414 | C content1_content2_content1-tracked |
|
414 | C content1_content2_content1-tracked | |
415 | C content1_content2_content2-tracked |
|
415 | C content1_content2_content2-tracked | |
416 | C content1_content2_content3-tracked |
|
416 | C content1_content2_content3-tracked | |
417 | C content1_missing_content1-tracked |
|
417 | C content1_missing_content1-tracked | |
418 | C content1_missing_content3-tracked |
|
418 | C content1_missing_content3-tracked | |
419 | C missing_content2_content2-tracked |
|
419 | C missing_content2_content2-tracked | |
420 | C missing_content2_content3-tracked |
|
420 | C missing_content2_content3-tracked | |
421 | C missing_missing_content3-tracked |
|
421 | C missing_missing_content3-tracked | |
422 | $ hg status --all 'glob:*_missing-tracked' |
|
422 | $ hg status --all 'glob:*_missing-tracked' | |
423 | ! content1_content1_missing-tracked |
|
423 | ! content1_content1_missing-tracked | |
424 | ! content1_content2_missing-tracked |
|
424 | ! content1_content2_missing-tracked | |
425 | ! content1_missing_missing-tracked |
|
425 | ! content1_missing_missing-tracked | |
426 | ! missing_content2_missing-tracked |
|
426 | ! missing_content2_missing-tracked | |
427 | ! missing_missing_missing-tracked |
|
427 | ! missing_missing_missing-tracked | |
428 | $ hg status --all 'glob:*-untracked' |
|
428 | $ hg status --all 'glob:*-untracked' | |
429 | ? content1_content1_content1-untracked |
|
429 | ? content1_content1_content1-untracked | |
430 | ? content1_content1_content3-untracked |
|
430 | ? content1_content1_content3-untracked | |
431 | ? content1_content2_content1-untracked |
|
431 | ? content1_content2_content1-untracked | |
432 | ? content1_content2_content2-untracked |
|
432 | ? content1_content2_content2-untracked | |
433 | ? content1_content2_content3-untracked |
|
433 | ? content1_content2_content3-untracked | |
434 | ? content1_missing_content1-untracked |
|
434 | ? content1_missing_content1-untracked | |
435 | ? content1_missing_content3-untracked |
|
435 | ? content1_missing_content3-untracked | |
436 | ? missing_content2_content2-untracked |
|
436 | ? missing_content2_content2-untracked | |
437 | ? missing_content2_content3-untracked |
|
437 | ? missing_content2_content3-untracked | |
438 | ? missing_missing_content3-untracked |
|
438 | ? missing_missing_content3-untracked | |
439 |
|
439 | |||
440 | ================================= |
|
440 | ================================= | |
441 | Test backup-bundle config option| |
|
441 | Test backup-bundle config option| | |
442 | ================================= |
|
442 | ================================= | |
443 | $ hg init $TESTTMP/repo4 |
|
443 | $ hg init $TESTTMP/repo4 | |
444 | $ cd $TESTTMP/repo4 |
|
444 | $ cd $TESTTMP/repo4 | |
445 | $ echo a>a |
|
445 | $ echo a>a | |
446 | $ hg ci -Aqma |
|
446 | $ hg ci -Aqma | |
447 | $ echo oops>b |
|
447 | $ echo oops>b | |
448 | $ hg ci -Aqm "b" |
|
448 | $ hg ci -Aqm "b" | |
449 | $ echo partiallyfixed > b |
|
449 | $ echo partiallyfixed > b | |
450 |
|
450 | |||
451 | #if obsstore-off |
|
451 | #if obsstore-off | |
452 | $ hg amend |
|
452 | $ hg amend | |
453 | saved backup bundle to $TESTTMP/repo4/.hg/strip-backup/95e899acf2ce-f11cb050-amend.hg |
|
453 | saved backup bundle to $TESTTMP/repo4/.hg/strip-backup/95e899acf2ce-f11cb050-amend.hg | |
454 | When backup-bundle config option is set: |
|
454 | When backup-bundle config option is set: | |
455 | $ cat << EOF >> $HGRCPATH |
|
455 | $ cat << EOF >> $HGRCPATH | |
456 | > [rewrite] |
|
456 | > [rewrite] | |
457 | > backup-bundle = False |
|
457 | > backup-bundle = False | |
458 | > EOF |
|
458 | > EOF | |
459 | $ echo fixed > b |
|
459 | $ echo fixed > b | |
460 | $ hg amend |
|
460 | $ hg amend | |
461 |
|
461 | |||
462 | #else |
|
462 | #else | |
463 | $ hg amend |
|
463 | $ hg amend | |
464 | When backup-bundle config option is set: |
|
464 | When backup-bundle config option is set: | |
465 | $ cat << EOF >> $HGRCPATH |
|
465 | $ cat << EOF >> $HGRCPATH | |
466 | > [rewrite] |
|
466 | > [rewrite] | |
467 | > backup-bundle = False |
|
467 | > backup-bundle = False | |
468 | > EOF |
|
468 | > EOF | |
469 | $ echo fixed > b |
|
469 | $ echo fixed > b | |
470 | $ hg amend |
|
470 | $ hg amend | |
471 |
|
471 | |||
472 | #endif |
|
472 | #endif | |
473 | ========================================== |
|
473 | ========================================== | |
474 | Test update-timestamp config option| |
|
474 | Test update-timestamp config option| | |
475 | ========================================== |
|
475 | ========================================== | |
476 |
|
476 | |||
477 | $ cat >> $HGRCPATH << EOF |
|
477 | $ cat >> $HGRCPATH << EOF | |
478 | > [extensions] |
|
478 | > [extensions] | |
479 | > amend= |
|
479 | > amend= | |
480 | > mockmakedate = $TESTDIR/mockmakedate.py |
|
480 | > mockmakedate = $TESTDIR/mockmakedate.py | |
481 | > EOF |
|
481 | > EOF | |
482 |
|
482 | |||
483 | $ hg init $TESTTMP/repo5 |
|
483 | $ hg init $TESTTMP/repo5 | |
484 | $ cd $TESTTMP/repo5 |
|
484 | $ cd $TESTTMP/repo5 | |
485 | $ cat <<'EOF' >> .hg/hgrc |
|
485 | $ cat <<'EOF' >> .hg/hgrc | |
486 | > [command-templates] |
|
486 | > [command-templates] | |
487 | > log = 'user: {user} |
|
487 | > log = 'user: {user} | |
488 | > date: {date|date} |
|
488 | > date: {date|date} | |
489 | > summary: {desc|firstline}\n' |
|
489 | > summary: {desc|firstline}\n' | |
490 | > EOF |
|
490 | > EOF | |
491 |
|
491 | |||
492 | $ echo a>a |
|
492 | $ echo a>a | |
493 | $ hg ci -Am 'commit 1' |
|
493 | $ hg ci -Am 'commit 1' | |
494 | adding a |
|
494 | adding a | |
495 |
|
495 | |||
496 | When updatetimestamp is False |
|
496 | When updatetimestamp is False | |
497 |
|
497 | |||
498 | $ hg amend --date '1997-1-1 0:1' |
|
498 | $ hg amend --date '1997-1-1 0:1' | |
499 | $ hg log --limit 1 |
|
499 | $ hg log --limit 1 | |
500 | user: test |
|
500 | user: test | |
501 | date: Wed Jan 01 00:01:00 1997 +0000 |
|
501 | date: Wed Jan 01 00:01:00 1997 +0000 | |
502 | summary: commit 1 |
|
502 | summary: commit 1 | |
503 |
|
503 | |||
504 | When update-timestamp is True and no other change than the date |
|
504 | When update-timestamp is True and no other change than the date | |
505 |
|
505 | |||
506 | $ hg amend --config rewrite.update-timestamp=True |
|
506 | $ hg amend --config rewrite.update-timestamp=True | |
507 | nothing changed |
|
507 | nothing changed | |
508 | [1] |
|
508 | [1] | |
509 | $ hg log --limit 1 |
|
509 | $ hg log --limit 1 | |
510 | user: test |
|
510 | user: test | |
511 | date: Wed Jan 01 00:01:00 1997 +0000 |
|
511 | date: Wed Jan 01 00:01:00 1997 +0000 | |
512 | summary: commit 1 |
|
512 | summary: commit 1 | |
513 |
|
513 | |||
514 | When update-timestamp is True and there is other change than the date |
|
514 | When update-timestamp is True and there is other change than the date | |
515 | $ hg amend --user foobar --config rewrite.update-timestamp=True |
|
515 | $ hg amend --user foobar --config rewrite.update-timestamp=True | |
516 | $ hg log --limit 1 |
|
516 | $ hg log --limit 1 | |
517 | user: foobar |
|
517 | user: foobar | |
518 | date: Thu Jan 01 00:00:02 1970 +0000 |
|
518 | date: Thu Jan 01 00:00:02 1970 +0000 | |
519 | summary: commit 1 |
|
519 | summary: commit 1 | |
520 |
|
520 | |||
521 | When date option is applicable and update-timestamp is True |
|
521 | When date option is applicable and update-timestamp is True | |
522 | $ hg amend --date '1998-1-1 0:1' --config rewrite.update-timestamp=True |
|
522 | $ hg amend --date '1998-1-1 0:1' --config rewrite.update-timestamp=True | |
523 | $ hg log --limit 1 |
|
523 | $ hg log --limit 1 | |
524 | user: foobar |
|
524 | user: foobar | |
525 | date: Thu Jan 01 00:01:00 1998 +0000 |
|
525 | date: Thu Jan 01 00:01:00 1998 +0000 | |
526 | summary: commit 1 |
|
526 | summary: commit 1 | |
527 |
|
527 | |||
528 | Unlike rewrite.update-timestamp, -D/--currentdate always updates the timestamp |
|
528 | Unlike rewrite.update-timestamp, -D/--currentdate always updates the timestamp | |
529 |
|
529 | |||
530 | $ hg amend -D |
|
530 | $ hg amend -D | |
531 | $ hg log --limit 1 |
|
531 | $ hg log --limit 1 | |
532 | user: foobar |
|
532 | user: foobar | |
533 | date: Thu Jan 01 00:00:04 1970 +0000 |
|
533 | date: Thu Jan 01 00:00:04 1970 +0000 | |
534 | summary: commit 1 |
|
534 | summary: commit 1 | |
535 |
|
535 | |||
536 | $ hg amend -D --config rewrite.update-timestamp=True |
|
536 | $ hg amend -D --config rewrite.update-timestamp=True | |
537 | $ hg log --limit 1 |
|
537 | $ hg log --limit 1 | |
538 | user: foobar |
|
538 | user: foobar | |
539 | date: Thu Jan 01 00:00:05 1970 +0000 |
|
539 | date: Thu Jan 01 00:00:05 1970 +0000 | |
540 | summary: commit 1 |
|
540 | summary: commit 1 | |
541 |
|
541 | |||
542 | rewrite.update-timestamp can be negated by --no-currentdate |
|
542 | rewrite.update-timestamp can be negated by --no-currentdate | |
543 |
|
543 | |||
544 | $ hg amend --config rewrite.update-timestamp=True --no-currentdate -u baz |
|
544 | $ hg amend --config rewrite.update-timestamp=True --no-currentdate -u baz | |
545 | $ hg log --limit 1 |
|
545 | $ hg log --limit 1 | |
546 | user: baz |
|
546 | user: baz | |
547 | date: Thu Jan 01 00:00:05 1970 +0000 |
|
547 | date: Thu Jan 01 00:00:05 1970 +0000 | |
548 | summary: commit 1 |
|
548 | summary: commit 1 | |
549 |
|
549 | |||
550 | Bad combination of date options: |
|
550 | Bad combination of date options: | |
551 |
|
551 | |||
552 | $ hg amend -D --date '0 0' |
|
552 | $ hg amend -D --date '0 0' | |
553 | abort: cannot specify both --date and --currentdate |
|
553 | abort: cannot specify both --date and --currentdate | |
554 | [10] |
|
554 | [10] | |
555 |
|
555 | |||
556 | Close branch |
|
556 | Close branch | |
557 |
|
557 | |||
558 | $ hg amend --secret --close-branch |
|
558 | $ hg amend --secret --close-branch | |
559 | $ hg log --limit 1 -T 'close={get(extras, "close")}\nphase={phase}\n' |
|
559 | $ hg log --limit 1 -T 'close={get(extras, "close")}\nphase={phase}\n' | |
560 | close=1 |
|
560 | close=1 | |
561 | phase=secret |
|
561 | phase=secret | |
562 |
|
562 | |||
563 | $ cd .. |
|
563 | $ cd .. | |
564 |
|
564 | |||
565 | Corner case of amend from issue6157: |
|
565 | Corner case of amend from issue6157: | |
566 | - working copy parent has a change to file `a` |
|
566 | - working copy parent has a change to file `a` | |
567 | - working copy has the inverse change |
|
567 | - working copy has the inverse change | |
568 | - we amend the working copy parent for files other than `a` |
|
568 | - we amend the working copy parent for files other than `a` | |
569 | hg used to include the changes to `a` anyway. |
|
569 | hg used to include the changes to `a` anyway. | |
570 |
|
570 | |||
571 | $ hg init 6157; cd 6157 |
|
571 | $ hg init 6157; cd 6157 | |
572 | $ echo a > a; echo b > b; hg commit -qAm_ |
|
572 | $ echo a > a; echo b > b; hg commit -qAm_ | |
573 | $ echo a2 > a; hg commit -qm_ |
|
573 | $ echo a2 > a; hg commit -qm_ | |
574 | $ hg diff --stat -c . |
|
574 | $ hg diff --stat -c . | |
575 | a | 2 +- |
|
575 | a | 2 +- | |
576 | 1 files changed, 1 insertions(+), 1 deletions(-) |
|
576 | 1 files changed, 1 insertions(+), 1 deletions(-) | |
577 | $ echo a > a; echo b2 > b; hg amend -q b |
|
577 | $ echo a > a; echo b2 > b; hg amend -q b | |
578 | $ hg diff --stat -c . |
|
578 | $ hg diff --stat -c . | |
579 | a | 2 +- |
|
579 | a | 2 +- | |
580 | b | 2 +- |
|
580 | b | 2 +- | |
581 | 2 files changed, 2 insertions(+), 2 deletions(-) |
|
581 | 2 files changed, 2 insertions(+), 2 deletions(-) | |
582 |
|
582 | |||
583 | Modifying a file while the editor is open can cause dirstate corruption |
|
583 | Modifying a file while the editor is open can cause dirstate corruption | |
584 | (issue6233) |
|
584 | (issue6233) | |
585 |
|
585 | |||
586 | $ cd $TESTTMP |
|
586 | $ cd $TESTTMP | |
587 | $ hg init modify-during-amend; cd modify-during-amend |
|
587 | $ hg init modify-during-amend; cd modify-during-amend | |
588 | $ echo r0 > foo; hg commit -qAm "r0" |
|
588 | $ echo r0 > foo; hg commit -qAm "r0" | |
589 | $ echo alpha > foo; hg commit -qm "alpha" |
|
589 | $ echo alpha > foo; hg commit -qm "alpha" | |
590 | $ echo beta >> foo |
|
590 | $ echo beta >> foo | |
591 | $ cat > $TESTTMP/touchy_editor.sh <<EOF |
|
591 | $ cat > $TESTTMP/touchy_editor.sh <<EOF | |
592 | > sleep 1 |
|
592 | > sleep 1 | |
593 | > echo delta >> "$TESTTMP/modify-during-amend/foo" |
|
593 | > echo delta >> "$TESTTMP/modify-during-amend/foo" | |
594 | > sleep 1 |
|
594 | > sleep 1 | |
595 | > echo hi > "\$1" |
|
595 | > echo hi > "\$1" | |
596 | > sleep 1 |
|
596 | > sleep 1 | |
597 | > EOF |
|
597 | > EOF | |
598 | $ HGEDITOR="sh $TESTTMP/touchy_editor.sh" hg commit --amend |
|
598 | $ HGEDITOR="sh $TESTTMP/touchy_editor.sh" hg commit --amend | |
599 | $ if (hg diff -c . | grep 'delta' >/dev/null) || [ -n "$(hg status)" ]; then |
|
599 | $ if (hg diff -c . | grep 'delta' >/dev/null) || [ -n "$(hg status)" ]; then | |
600 | > echo "OK." |
|
600 | > echo "OK." | |
601 | > else |
|
601 | > else | |
602 | > echo "Bug detected. 'delta' is not part of the commit OR the wdir" |
|
602 | > echo "Bug detected. 'delta' is not part of the commit OR the wdir" | |
603 | > echo "Diff and status before rebuild:" |
|
603 | > echo "Diff and status before rebuild:" | |
604 | > hg diff |
|
604 | > hg diff | |
605 | > hg status |
|
605 | > hg status | |
606 | > hg debugrebuilddirstate |
|
606 | > hg debugrebuilddirstate | |
607 | > echo "Diff and status after rebuild:" |
|
607 | > echo "Diff and status after rebuild:" | |
608 | > hg diff |
|
608 | > hg diff | |
609 | > hg status |
|
609 | > hg status | |
610 | > fi |
|
610 | > fi | |
611 | OK. |
|
611 | OK. | |
|
612 | ||||
|
613 | Amending a commit that has copies but not specifying those copies shouldn't | |||
|
614 | cause them to be lost | |||
|
615 | ||||
|
616 | $ cd $TESTTMP | |||
|
617 | $ hg init dont-lose-copies; cd dont-lose-copies | |||
|
618 | $ echo r0 > r0; hg commit -qAm "r0" | |||
|
619 | $ hg cp r0 r0_copied; hg commit -qm "copy r0" | |||
|
620 | $ echo hi > new_file_amend_me | |||
|
621 | $ hg status --change . --copies | |||
|
622 | A r0_copied | |||
|
623 | r0 | |||
|
624 | $ hg amend -qA new_file_amend_me | |||
|
625 | $ hg status --change . --copies | |||
|
626 | A new_file_amend_me | |||
|
627 | A r0_copied | |||
|
628 | r0 (missing-correct-output !) |
General Comments 0
You need to be logged in to leave comments.
Login now