Show More
@@ -1,234 +1,234 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 (glob) (obsstore-off !) |
|
32 | saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/112478962961-7e959a55-amend.hg (glob) (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 | Matcher and metadata options |
|
96 | Matcher and metadata options | |
97 |
|
97 | |||
98 | $ echo 3 > C |
|
98 | $ echo 3 > C | |
99 | $ echo 4 > D |
|
99 | $ echo 4 > D | |
100 | $ hg add C D |
|
100 | $ hg add C D | |
101 | $ hg amend -m NEWMESSAGE -I C |
|
101 | $ hg amend -m NEWMESSAGE -I C | |
102 | saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/be169c7e8dbe-7684ddc5-amend.hg (glob) (obsstore-off !) |
|
102 | saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/be169c7e8dbe-7684ddc5-amend.hg (glob) (obsstore-off !) | |
103 | $ hg log -r . -T '{node|short} {desc} {files}\n' |
|
103 | $ hg log -r . -T '{node|short} {desc} {files}\n' | |
104 | c7ba14d9075b NEWMESSAGE B C |
|
104 | c7ba14d9075b NEWMESSAGE B C | |
105 | $ echo 5 > E |
|
105 | $ echo 5 > E | |
106 | $ rm C |
|
106 | $ rm C | |
107 | $ hg amend -d '2000 1000' -u 'Foo <foo@example.com>' -A C D |
|
107 | $ hg amend -d '2000 1000' -u 'Foo <foo@example.com>' -A C D | |
108 | saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/c7ba14d9075b-b3e76daa-amend.hg (glob) (obsstore-off !) |
|
108 | saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/c7ba14d9075b-b3e76daa-amend.hg (glob) (obsstore-off !) | |
109 | $ hg log -r . -T '{node|short} {desc} {files} {author} {date}\n' |
|
109 | $ hg log -r . -T '{node|short} {desc} {files} {author} {date}\n' | |
110 | 14f6c4bcc865 NEWMESSAGE B D Foo <foo@example.com> 2000.01000 |
|
110 | 14f6c4bcc865 NEWMESSAGE B D Foo <foo@example.com> 2000.01000 | |
111 |
|
111 | |||
112 | Amend with editor |
|
112 | Amend with editor | |
113 |
|
113 | |||
114 | $ cat > $TESTTMP/prefix.sh <<'EOF' |
|
114 | $ cat > $TESTTMP/prefix.sh <<'EOF' | |
115 | > printf 'EDITED: ' > $TESTTMP/msg |
|
115 | > printf 'EDITED: ' > $TESTTMP/msg | |
116 | > cat "$1" >> $TESTTMP/msg |
|
116 | > cat "$1" >> $TESTTMP/msg | |
117 | > mv $TESTTMP/msg "$1" |
|
117 | > mv $TESTTMP/msg "$1" | |
118 | > EOF |
|
118 | > EOF | |
119 | $ chmod +x $TESTTMP/prefix.sh |
|
119 | $ chmod +x $TESTTMP/prefix.sh | |
120 |
|
120 | |||
121 | $ HGEDITOR="sh $TESTTMP/prefix.sh" hg amend --edit |
|
121 | $ HGEDITOR="sh $TESTTMP/prefix.sh" hg amend --edit | |
122 | saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/14f6c4bcc865-6591f15d-amend.hg (glob) (obsstore-off !) |
|
122 | saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/14f6c4bcc865-6591f15d-amend.hg (glob) (obsstore-off !) | |
123 | $ hg log -r . -T '{node|short} {desc}\n' |
|
123 | $ hg log -r . -T '{node|short} {desc}\n' | |
124 | 298f085230c3 EDITED: NEWMESSAGE |
|
124 | 298f085230c3 EDITED: NEWMESSAGE | |
125 | $ HGEDITOR="sh $TESTTMP/prefix.sh" hg amend -e -m MSG |
|
125 | $ HGEDITOR="sh $TESTTMP/prefix.sh" hg amend -e -m MSG | |
126 | saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/298f085230c3-d81a6ad3-amend.hg (glob) (obsstore-off !) |
|
126 | saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/298f085230c3-d81a6ad3-amend.hg (glob) (obsstore-off !) | |
127 | $ hg log -r . -T '{node|short} {desc}\n' |
|
127 | $ hg log -r . -T '{node|short} {desc}\n' | |
128 | 974f07f28537 EDITED: MSG |
|
128 | 974f07f28537 EDITED: MSG | |
129 |
|
129 | |||
130 | $ echo FOO > $TESTTMP/msg |
|
130 | $ echo FOO > $TESTTMP/msg | |
131 | $ hg amend -l $TESTTMP/msg -m BAR |
|
131 | $ hg amend -l $TESTTMP/msg -m BAR | |
132 | abort: options --message and --logfile are mutually exclusive |
|
132 | abort: options --message and --logfile are mutually exclusive | |
133 | [255] |
|
133 | [255] | |
134 | $ hg amend -l $TESTTMP/msg |
|
134 | $ hg amend -l $TESTTMP/msg | |
135 | saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/974f07f28537-edb6470a-amend.hg (glob) (obsstore-off !) |
|
135 | saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/974f07f28537-edb6470a-amend.hg (glob) (obsstore-off !) | |
136 | $ hg log -r . -T '{node|short} {desc}\n' |
|
136 | $ hg log -r . -T '{node|short} {desc}\n' | |
137 | 507be9bdac71 FOO |
|
137 | 507be9bdac71 FOO | |
138 |
|
138 | |||
139 | Interactive mode |
|
139 | Interactive mode | |
140 |
|
140 | |||
141 | $ touch F G |
|
141 | $ touch F G | |
142 | $ hg add F G |
|
142 | $ hg add F G | |
143 | $ cat <<EOS | hg amend -i --config ui.interactive=1 |
|
143 | $ cat <<EOS | hg amend -i --config ui.interactive=1 | |
144 | > y |
|
144 | > y | |
145 | > n |
|
145 | > n | |
146 | > EOS |
|
146 | > EOS | |
147 | diff --git a/F b/F |
|
147 | diff --git a/F b/F | |
148 | new file mode 100644 |
|
148 | new file mode 100644 | |
149 | examine changes to 'F'? [Ynesfdaq?] y |
|
149 | examine changes to 'F'? [Ynesfdaq?] y | |
150 |
|
150 | |||
151 | diff --git a/G b/G |
|
151 | diff --git a/G b/G | |
152 | new file mode 100644 |
|
152 | new file mode 100644 | |
153 | examine changes to 'G'? [Ynesfdaq?] n |
|
153 | examine changes to 'G'? [Ynesfdaq?] n | |
154 |
|
154 | |||
155 | saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/507be9bdac71-c8077452-amend.hg (glob) (obsstore-off !) |
|
155 | saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/507be9bdac71-c8077452-amend.hg (glob) (obsstore-off !) | |
156 | $ hg log -r . -T '{files}\n' |
|
156 | $ hg log -r . -T '{files}\n' | |
157 | B D F |
|
157 | B D F | |
158 |
|
158 | |||
159 | Amend in the middle of a stack |
|
159 | Amend in the middle of a stack | |
160 |
|
160 | |||
161 | $ hg init $TESTTMP/repo2 |
|
161 | $ hg init $TESTTMP/repo2 | |
162 | $ cd $TESTTMP/repo2 |
|
162 | $ cd $TESTTMP/repo2 | |
163 | $ hg debugdrawdag <<'EOS' |
|
163 | $ hg debugdrawdag <<'EOS' | |
164 | > C |
|
164 | > C | |
165 | > | |
|
165 | > | | |
166 | > B |
|
166 | > B | |
167 | > | |
|
167 | > | | |
168 | > A |
|
168 | > A | |
169 | > EOS |
|
169 | > EOS | |
170 |
|
170 | |||
171 | $ hg update -q B |
|
171 | $ hg update -q B | |
172 | $ echo 2 >> B |
|
172 | $ echo 2 >> B | |
173 | $ hg amend |
|
173 | $ hg amend | |
174 | abort: cannot amend changeset with children |
|
174 | abort: cannot amend changeset with children | |
175 | [255] |
|
175 | [255] | |
176 |
|
176 | |||
177 | #if obsstore-on |
|
177 | #if obsstore-on | |
178 |
|
178 | |||
179 | With allowunstable, amend could work in the middle of a stack |
|
179 | With allowunstable, amend could work in the middle of a stack | |
180 |
|
180 | |||
181 | $ cat >> $HGRCPATH <<EOF |
|
181 | $ cat >> $HGRCPATH <<EOF | |
182 | > [experimental] |
|
182 | > [experimental] | |
183 | > evolution=allowunstable |
|
|||
184 | > evolution.createmarkers=True |
|
183 | > evolution.createmarkers=True | |
|
184 | > evolution.allowunstable=True | |||
185 | > EOF |
|
185 | > EOF | |
186 |
|
186 | |||
187 | $ hg amend |
|
187 | $ hg amend | |
188 | $ hg log -T '{rev} {node|short} {desc}\n' -G |
|
188 | $ hg log -T '{rev} {node|short} {desc}\n' -G | |
189 | @ 3 be169c7e8dbe B |
|
189 | @ 3 be169c7e8dbe B | |
190 | | |
|
190 | | | |
191 | | o 2 26805aba1e60 C |
|
191 | | o 2 26805aba1e60 C | |
192 | | | |
|
192 | | | | |
193 | | x 1 112478962961 B |
|
193 | | x 1 112478962961 B | |
194 | |/ |
|
194 | |/ | |
195 | o 0 426bada5c675 A |
|
195 | o 0 426bada5c675 A | |
196 |
|
196 | |||
197 | Checking the note stored in the obsmarker |
|
197 | Checking the note stored in the obsmarker | |
198 |
|
198 | |||
199 | $ echo foo > bar |
|
199 | $ echo foo > bar | |
200 | $ hg add bar |
|
200 | $ hg add bar | |
201 | $ hg amend --note "adding bar" |
|
201 | $ hg amend --note "adding bar" | |
202 | $ hg debugobsolete -r . |
|
202 | $ hg debugobsolete -r . | |
203 | 112478962961147124edd43549aedd1a335e44bf be169c7e8dbe21cd10b3d79691cbe7f241e3c21c 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'} |
|
203 | 112478962961147124edd43549aedd1a335e44bf be169c7e8dbe21cd10b3d79691cbe7f241e3c21c 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'} | |
204 | be169c7e8dbe21cd10b3d79691cbe7f241e3c21c 16084da537dd8f84cfdb3055c633772269d62e1b 0 (Thu Jan 01 00:00:00 1970 +0000) {'note': 'adding bar', 'operation': 'amend', 'user': 'test'} |
|
204 | be169c7e8dbe21cd10b3d79691cbe7f241e3c21c 16084da537dd8f84cfdb3055c633772269d62e1b 0 (Thu Jan 01 00:00:00 1970 +0000) {'note': 'adding bar', 'operation': 'amend', 'user': 'test'} | |
205 | #endif |
|
205 | #endif | |
206 |
|
206 | |||
207 | Cannot amend public changeset |
|
207 | Cannot amend public changeset | |
208 |
|
208 | |||
209 | $ hg phase -r A --public |
|
209 | $ hg phase -r A --public | |
210 | $ hg update -C -q A |
|
210 | $ hg update -C -q A | |
211 | $ hg amend -m AMEND |
|
211 | $ hg amend -m AMEND | |
212 | abort: cannot amend public changesets |
|
212 | abort: cannot amend public changesets | |
213 | [255] |
|
213 | [255] | |
214 |
|
214 | |||
215 | Amend a merge changeset |
|
215 | Amend a merge changeset | |
216 |
|
216 | |||
217 | $ hg init $TESTTMP/repo3 |
|
217 | $ hg init $TESTTMP/repo3 | |
218 | $ cd $TESTTMP/repo3 |
|
218 | $ cd $TESTTMP/repo3 | |
219 | $ hg debugdrawdag <<'EOS' |
|
219 | $ hg debugdrawdag <<'EOS' | |
220 | > C |
|
220 | > C | |
221 | > /| |
|
221 | > /| | |
222 | > A B |
|
222 | > A B | |
223 | > EOS |
|
223 | > EOS | |
224 | $ hg update -q C |
|
224 | $ hg update -q C | |
225 | $ hg amend -m FOO |
|
225 | $ hg amend -m FOO | |
226 | saved backup bundle to $TESTTMP/repo3/.hg/strip-backup/a35c07e8a2a4-15ff4612-amend.hg (glob) (obsstore-off !) |
|
226 | saved backup bundle to $TESTTMP/repo3/.hg/strip-backup/a35c07e8a2a4-15ff4612-amend.hg (glob) (obsstore-off !) | |
227 | $ rm .hg/localtags |
|
227 | $ rm .hg/localtags | |
228 | $ hg log -G -T '{desc}\n' |
|
228 | $ hg log -G -T '{desc}\n' | |
229 | @ FOO |
|
229 | @ FOO | |
230 | |\ |
|
230 | |\ | |
231 | | o B |
|
231 | | o B | |
232 | | |
|
232 | | | |
233 | o A |
|
233 | o A | |
234 |
|
234 |
@@ -1,1269 +1,1269 b'' | |||||
1 | $ cat << EOF >> $HGRCPATH |
|
1 | $ cat << EOF >> $HGRCPATH | |
2 | > [format] |
|
2 | > [format] | |
3 | > usegeneraldelta=yes |
|
3 | > usegeneraldelta=yes | |
4 | > EOF |
|
4 | > EOF | |
5 |
|
5 | |||
6 | $ hg init |
|
6 | $ hg init | |
7 |
|
7 | |||
8 | Setup: |
|
8 | Setup: | |
9 |
|
9 | |||
10 | $ echo a >> a |
|
10 | $ echo a >> a | |
11 | $ hg ci -Am 'base' |
|
11 | $ hg ci -Am 'base' | |
12 | adding a |
|
12 | adding a | |
13 |
|
13 | |||
14 | Refuse to amend public csets: |
|
14 | Refuse to amend public csets: | |
15 |
|
15 | |||
16 | $ hg phase -r . -p |
|
16 | $ hg phase -r . -p | |
17 | $ hg ci --amend |
|
17 | $ hg ci --amend | |
18 | abort: cannot amend public changesets |
|
18 | abort: cannot amend public changesets | |
19 | [255] |
|
19 | [255] | |
20 | $ hg phase -r . -f -d |
|
20 | $ hg phase -r . -f -d | |
21 |
|
21 | |||
22 | $ echo a >> a |
|
22 | $ echo a >> a | |
23 | $ hg ci -Am 'base1' |
|
23 | $ hg ci -Am 'base1' | |
24 |
|
24 | |||
25 | Nothing to amend: |
|
25 | Nothing to amend: | |
26 |
|
26 | |||
27 | $ hg ci --amend -m 'base1' |
|
27 | $ hg ci --amend -m 'base1' | |
28 | nothing changed |
|
28 | nothing changed | |
29 | [1] |
|
29 | [1] | |
30 |
|
30 | |||
31 | $ cat >> $HGRCPATH <<EOF |
|
31 | $ cat >> $HGRCPATH <<EOF | |
32 | > [hooks] |
|
32 | > [hooks] | |
33 | > pretxncommit.foo = sh -c "echo \\"pretxncommit \$HG_NODE\\"; hg id -r \$HG_NODE" |
|
33 | > pretxncommit.foo = sh -c "echo \\"pretxncommit \$HG_NODE\\"; hg id -r \$HG_NODE" | |
34 | > EOF |
|
34 | > EOF | |
35 |
|
35 | |||
36 | Amending changeset with changes in working dir: |
|
36 | Amending changeset with changes in working dir: | |
37 | (and check that --message does not trigger an editor) |
|
37 | (and check that --message does not trigger an editor) | |
38 |
|
38 | |||
39 | $ echo a >> a |
|
39 | $ echo a >> a | |
40 | $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -m 'amend base1' |
|
40 | $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -m 'amend base1' | |
41 | pretxncommit 43f1ba15f28a50abf0aae529cf8a16bfced7b149 |
|
41 | pretxncommit 43f1ba15f28a50abf0aae529cf8a16bfced7b149 | |
42 | 43f1ba15f28a tip |
|
42 | 43f1ba15f28a tip | |
43 | saved backup bundle to $TESTTMP/.hg/strip-backup/489edb5b847d-5ab4f721-amend.hg (glob) |
|
43 | saved backup bundle to $TESTTMP/.hg/strip-backup/489edb5b847d-5ab4f721-amend.hg (glob) | |
44 | $ echo 'pretxncommit.foo = ' >> $HGRCPATH |
|
44 | $ echo 'pretxncommit.foo = ' >> $HGRCPATH | |
45 | $ hg diff -c . |
|
45 | $ hg diff -c . | |
46 | diff -r ad120869acf0 -r 43f1ba15f28a a |
|
46 | diff -r ad120869acf0 -r 43f1ba15f28a a | |
47 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
47 | --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
48 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 |
|
48 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 | |
49 | @@ -1,1 +1,3 @@ |
|
49 | @@ -1,1 +1,3 @@ | |
50 | a |
|
50 | a | |
51 | +a |
|
51 | +a | |
52 | +a |
|
52 | +a | |
53 | $ hg log |
|
53 | $ hg log | |
54 | changeset: 1:43f1ba15f28a |
|
54 | changeset: 1:43f1ba15f28a | |
55 | tag: tip |
|
55 | tag: tip | |
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: amend base1 |
|
58 | summary: amend base1 | |
59 |
|
59 | |||
60 | changeset: 0:ad120869acf0 |
|
60 | changeset: 0:ad120869acf0 | |
61 | user: test |
|
61 | user: test | |
62 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
62 | date: Thu Jan 01 00:00:00 1970 +0000 | |
63 | summary: base |
|
63 | summary: base | |
64 |
|
64 | |||
65 |
|
65 | |||
66 | Check proper abort for empty message |
|
66 | Check proper abort for empty message | |
67 |
|
67 | |||
68 | $ cat > editor.sh << '__EOF__' |
|
68 | $ cat > editor.sh << '__EOF__' | |
69 | > #!/bin/sh |
|
69 | > #!/bin/sh | |
70 | > echo "" > "$1" |
|
70 | > echo "" > "$1" | |
71 | > __EOF__ |
|
71 | > __EOF__ | |
72 |
|
72 | |||
73 | Update the existing file to ensure that the dirstate is not in pending state |
|
73 | Update the existing file to ensure that the dirstate is not in pending state | |
74 | (where the status of some files in the working copy is not known yet). This in |
|
74 | (where the status of some files in the working copy is not known yet). This in | |
75 | turn ensures that when the transaction is aborted due to an empty message during |
|
75 | turn ensures that when the transaction is aborted due to an empty message during | |
76 | the amend, there should be no rollback. |
|
76 | the amend, there should be no rollback. | |
77 | $ echo a >> a |
|
77 | $ echo a >> a | |
78 |
|
78 | |||
79 | $ echo b > b |
|
79 | $ echo b > b | |
80 | $ hg add b |
|
80 | $ hg add b | |
81 | $ hg summary |
|
81 | $ hg summary | |
82 | parent: 1:43f1ba15f28a tip |
|
82 | parent: 1:43f1ba15f28a tip | |
83 | amend base1 |
|
83 | amend base1 | |
84 | branch: default |
|
84 | branch: default | |
85 | commit: 1 modified, 1 added, 1 unknown |
|
85 | commit: 1 modified, 1 added, 1 unknown | |
86 | update: (current) |
|
86 | update: (current) | |
87 | phases: 2 draft |
|
87 | phases: 2 draft | |
88 | $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend |
|
88 | $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend | |
89 | abort: empty commit message |
|
89 | abort: empty commit message | |
90 | [255] |
|
90 | [255] | |
91 | $ hg summary |
|
91 | $ hg summary | |
92 | parent: 1:43f1ba15f28a tip |
|
92 | parent: 1:43f1ba15f28a tip | |
93 | amend base1 |
|
93 | amend base1 | |
94 | branch: default |
|
94 | branch: default | |
95 | commit: 1 modified, 1 added, 1 unknown |
|
95 | commit: 1 modified, 1 added, 1 unknown | |
96 | update: (current) |
|
96 | update: (current) | |
97 | phases: 2 draft |
|
97 | phases: 2 draft | |
98 |
|
98 | |||
99 | Add new file along with modified existing file: |
|
99 | Add new file along with modified existing file: | |
100 | $ hg ci --amend -m 'amend base1 new file' |
|
100 | $ hg ci --amend -m 'amend base1 new file' | |
101 | saved backup bundle to $TESTTMP/.hg/strip-backup/43f1ba15f28a-007467c2-amend.hg (glob) |
|
101 | saved backup bundle to $TESTTMP/.hg/strip-backup/43f1ba15f28a-007467c2-amend.hg (glob) | |
102 |
|
102 | |||
103 | Remove file that was added in amended commit: |
|
103 | Remove file that was added in amended commit: | |
104 | (and test logfile option) |
|
104 | (and test logfile option) | |
105 | (and test that logfile option do not trigger an editor) |
|
105 | (and test that logfile option do not trigger an editor) | |
106 |
|
106 | |||
107 | $ hg rm b |
|
107 | $ hg rm b | |
108 | $ echo 'amend base1 remove new file' > ../logfile |
|
108 | $ echo 'amend base1 remove new file' > ../logfile | |
109 | $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg ci --amend --logfile ../logfile |
|
109 | $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg ci --amend --logfile ../logfile | |
110 | saved backup bundle to $TESTTMP/.hg/strip-backup/c16295aaf401-1ada9901-amend.hg (glob) |
|
110 | saved backup bundle to $TESTTMP/.hg/strip-backup/c16295aaf401-1ada9901-amend.hg (glob) | |
111 |
|
111 | |||
112 | $ hg cat b |
|
112 | $ hg cat b | |
113 | b: no such file in rev 47343646fa3d |
|
113 | b: no such file in rev 47343646fa3d | |
114 | [1] |
|
114 | [1] | |
115 |
|
115 | |||
116 | No changes, just a different message: |
|
116 | No changes, just a different message: | |
117 |
|
117 | |||
118 | $ hg ci -v --amend -m 'no changes, new message' |
|
118 | $ hg ci -v --amend -m 'no changes, new message' | |
119 | amending changeset 47343646fa3d |
|
119 | amending changeset 47343646fa3d | |
120 | copying changeset 47343646fa3d to ad120869acf0 |
|
120 | copying changeset 47343646fa3d to ad120869acf0 | |
121 | committing files: |
|
121 | committing files: | |
122 | a |
|
122 | a | |
123 | committing manifest |
|
123 | committing manifest | |
124 | committing changelog |
|
124 | committing changelog | |
125 | 1 changesets found |
|
125 | 1 changesets found | |
126 | uncompressed size of bundle content: |
|
126 | uncompressed size of bundle content: | |
127 | 254 (changelog) |
|
127 | 254 (changelog) | |
128 | 163 (manifests) |
|
128 | 163 (manifests) | |
129 | 131 a |
|
129 | 131 a | |
130 | saved backup bundle to $TESTTMP/.hg/strip-backup/47343646fa3d-c2758885-amend.hg (glob) |
|
130 | saved backup bundle to $TESTTMP/.hg/strip-backup/47343646fa3d-c2758885-amend.hg (glob) | |
131 | 1 changesets found |
|
131 | 1 changesets found | |
132 | uncompressed size of bundle content: |
|
132 | uncompressed size of bundle content: | |
133 | 250 (changelog) |
|
133 | 250 (changelog) | |
134 | 163 (manifests) |
|
134 | 163 (manifests) | |
135 | 131 a |
|
135 | 131 a | |
136 | adding branch |
|
136 | adding branch | |
137 | adding changesets |
|
137 | adding changesets | |
138 | adding manifests |
|
138 | adding manifests | |
139 | adding file changes |
|
139 | adding file changes | |
140 | added 1 changesets with 1 changes to 1 files |
|
140 | added 1 changesets with 1 changes to 1 files | |
141 | committed changeset 1:401431e913a1 |
|
141 | committed changeset 1:401431e913a1 | |
142 | $ hg diff -c . |
|
142 | $ hg diff -c . | |
143 | diff -r ad120869acf0 -r 401431e913a1 a |
|
143 | diff -r ad120869acf0 -r 401431e913a1 a | |
144 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
144 | --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
145 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 |
|
145 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 | |
146 | @@ -1,1 +1,4 @@ |
|
146 | @@ -1,1 +1,4 @@ | |
147 | a |
|
147 | a | |
148 | +a |
|
148 | +a | |
149 | +a |
|
149 | +a | |
150 | +a |
|
150 | +a | |
151 | $ hg log |
|
151 | $ hg log | |
152 | changeset: 1:401431e913a1 |
|
152 | changeset: 1:401431e913a1 | |
153 | tag: tip |
|
153 | tag: tip | |
154 | user: test |
|
154 | user: test | |
155 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
155 | date: Thu Jan 01 00:00:00 1970 +0000 | |
156 | summary: no changes, new message |
|
156 | summary: no changes, new message | |
157 |
|
157 | |||
158 | changeset: 0:ad120869acf0 |
|
158 | changeset: 0:ad120869acf0 | |
159 | user: test |
|
159 | user: test | |
160 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
160 | date: Thu Jan 01 00:00:00 1970 +0000 | |
161 | summary: base |
|
161 | summary: base | |
162 |
|
162 | |||
163 |
|
163 | |||
164 | Disable default date on commit so when -d isn't given, the old date is preserved: |
|
164 | Disable default date on commit so when -d isn't given, the old date is preserved: | |
165 |
|
165 | |||
166 | $ echo '[defaults]' >> $HGRCPATH |
|
166 | $ echo '[defaults]' >> $HGRCPATH | |
167 | $ echo 'commit=' >> $HGRCPATH |
|
167 | $ echo 'commit=' >> $HGRCPATH | |
168 |
|
168 | |||
169 | Test -u/-d: |
|
169 | Test -u/-d: | |
170 |
|
170 | |||
171 | $ cat > .hg/checkeditform.sh <<EOF |
|
171 | $ cat > .hg/checkeditform.sh <<EOF | |
172 | > env | grep HGEDITFORM |
|
172 | > env | grep HGEDITFORM | |
173 | > true |
|
173 | > true | |
174 | > EOF |
|
174 | > EOF | |
175 | $ HGEDITOR="sh .hg/checkeditform.sh" hg ci --amend -u foo -d '1 0' |
|
175 | $ HGEDITOR="sh .hg/checkeditform.sh" hg ci --amend -u foo -d '1 0' | |
176 | HGEDITFORM=commit.amend.normal |
|
176 | HGEDITFORM=commit.amend.normal | |
177 | saved backup bundle to $TESTTMP/.hg/strip-backup/401431e913a1-5e8e532c-amend.hg (glob) |
|
177 | saved backup bundle to $TESTTMP/.hg/strip-backup/401431e913a1-5e8e532c-amend.hg (glob) | |
178 | $ echo a >> a |
|
178 | $ echo a >> a | |
179 | $ hg ci --amend -u foo -d '1 0' |
|
179 | $ hg ci --amend -u foo -d '1 0' | |
180 | saved backup bundle to $TESTTMP/.hg/strip-backup/d96b1d28ae33-677e0afb-amend.hg (glob) |
|
180 | saved backup bundle to $TESTTMP/.hg/strip-backup/d96b1d28ae33-677e0afb-amend.hg (glob) | |
181 | $ hg log -r . |
|
181 | $ hg log -r . | |
182 | changeset: 1:a9a13940fc03 |
|
182 | changeset: 1:a9a13940fc03 | |
183 | tag: tip |
|
183 | tag: tip | |
184 | user: foo |
|
184 | user: foo | |
185 | date: Thu Jan 01 00:00:01 1970 +0000 |
|
185 | date: Thu Jan 01 00:00:01 1970 +0000 | |
186 | summary: no changes, new message |
|
186 | summary: no changes, new message | |
187 |
|
187 | |||
188 |
|
188 | |||
189 | Open editor with old commit message if a message isn't given otherwise: |
|
189 | Open editor with old commit message if a message isn't given otherwise: | |
190 |
|
190 | |||
191 | $ cat > editor.sh << '__EOF__' |
|
191 | $ cat > editor.sh << '__EOF__' | |
192 | > #!/bin/sh |
|
192 | > #!/bin/sh | |
193 | > cat $1 |
|
193 | > cat $1 | |
194 | > echo "another precious commit message" > "$1" |
|
194 | > echo "another precious commit message" > "$1" | |
195 | > __EOF__ |
|
195 | > __EOF__ | |
196 |
|
196 | |||
197 | at first, test saving last-message.txt |
|
197 | at first, test saving last-message.txt | |
198 |
|
198 | |||
199 | $ cat > .hg/hgrc << '__EOF__' |
|
199 | $ cat > .hg/hgrc << '__EOF__' | |
200 | > [hooks] |
|
200 | > [hooks] | |
201 | > pretxncommit.test-saving-last-message = false |
|
201 | > pretxncommit.test-saving-last-message = false | |
202 | > __EOF__ |
|
202 | > __EOF__ | |
203 |
|
203 | |||
204 | $ rm -f .hg/last-message.txt |
|
204 | $ rm -f .hg/last-message.txt | |
205 | $ hg commit --amend -v -m "message given from command line" |
|
205 | $ hg commit --amend -v -m "message given from command line" | |
206 | amending changeset a9a13940fc03 |
|
206 | amending changeset a9a13940fc03 | |
207 | copying changeset a9a13940fc03 to ad120869acf0 |
|
207 | copying changeset a9a13940fc03 to ad120869acf0 | |
208 | committing files: |
|
208 | committing files: | |
209 | a |
|
209 | a | |
210 | committing manifest |
|
210 | committing manifest | |
211 | committing changelog |
|
211 | committing changelog | |
212 | running hook pretxncommit.test-saving-last-message: false |
|
212 | running hook pretxncommit.test-saving-last-message: false | |
213 | transaction abort! |
|
213 | transaction abort! | |
214 | rollback completed |
|
214 | rollback completed | |
215 | abort: pretxncommit.test-saving-last-message hook exited with status 1 |
|
215 | abort: pretxncommit.test-saving-last-message hook exited with status 1 | |
216 | [255] |
|
216 | [255] | |
217 | $ cat .hg/last-message.txt |
|
217 | $ cat .hg/last-message.txt | |
218 | message given from command line (no-eol) |
|
218 | message given from command line (no-eol) | |
219 |
|
219 | |||
220 | $ rm -f .hg/last-message.txt |
|
220 | $ rm -f .hg/last-message.txt | |
221 | $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v |
|
221 | $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v | |
222 | amending changeset a9a13940fc03 |
|
222 | amending changeset a9a13940fc03 | |
223 | copying changeset a9a13940fc03 to ad120869acf0 |
|
223 | copying changeset a9a13940fc03 to ad120869acf0 | |
224 | no changes, new message |
|
224 | no changes, new message | |
225 |
|
225 | |||
226 |
|
226 | |||
227 | HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
227 | HG: Enter commit message. Lines beginning with 'HG:' are removed. | |
228 | HG: Leave message empty to abort commit. |
|
228 | HG: Leave message empty to abort commit. | |
229 | HG: -- |
|
229 | HG: -- | |
230 | HG: user: foo |
|
230 | HG: user: foo | |
231 | HG: branch 'default' |
|
231 | HG: branch 'default' | |
232 | HG: changed a |
|
232 | HG: changed a | |
233 | committing files: |
|
233 | committing files: | |
234 | a |
|
234 | a | |
235 | committing manifest |
|
235 | committing manifest | |
236 | committing changelog |
|
236 | committing changelog | |
237 | running hook pretxncommit.test-saving-last-message: false |
|
237 | running hook pretxncommit.test-saving-last-message: false | |
238 | transaction abort! |
|
238 | transaction abort! | |
239 | rollback completed |
|
239 | rollback completed | |
240 | abort: pretxncommit.test-saving-last-message hook exited with status 1 |
|
240 | abort: pretxncommit.test-saving-last-message hook exited with status 1 | |
241 | [255] |
|
241 | [255] | |
242 |
|
242 | |||
243 | $ cat .hg/last-message.txt |
|
243 | $ cat .hg/last-message.txt | |
244 | another precious commit message |
|
244 | another precious commit message | |
245 |
|
245 | |||
246 | $ cat > .hg/hgrc << '__EOF__' |
|
246 | $ cat > .hg/hgrc << '__EOF__' | |
247 | > [hooks] |
|
247 | > [hooks] | |
248 | > pretxncommit.test-saving-last-message = |
|
248 | > pretxncommit.test-saving-last-message = | |
249 | > __EOF__ |
|
249 | > __EOF__ | |
250 |
|
250 | |||
251 | then, test editing custom commit message |
|
251 | then, test editing custom commit message | |
252 |
|
252 | |||
253 | $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v |
|
253 | $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v | |
254 | amending changeset a9a13940fc03 |
|
254 | amending changeset a9a13940fc03 | |
255 | copying changeset a9a13940fc03 to ad120869acf0 |
|
255 | copying changeset a9a13940fc03 to ad120869acf0 | |
256 | no changes, new message |
|
256 | no changes, new message | |
257 |
|
257 | |||
258 |
|
258 | |||
259 | HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
259 | HG: Enter commit message. Lines beginning with 'HG:' are removed. | |
260 | HG: Leave message empty to abort commit. |
|
260 | HG: Leave message empty to abort commit. | |
261 | HG: -- |
|
261 | HG: -- | |
262 | HG: user: foo |
|
262 | HG: user: foo | |
263 | HG: branch 'default' |
|
263 | HG: branch 'default' | |
264 | HG: changed a |
|
264 | HG: changed a | |
265 | committing files: |
|
265 | committing files: | |
266 | a |
|
266 | a | |
267 | committing manifest |
|
267 | committing manifest | |
268 | committing changelog |
|
268 | committing changelog | |
269 | 1 changesets found |
|
269 | 1 changesets found | |
270 | uncompressed size of bundle content: |
|
270 | uncompressed size of bundle content: | |
271 | 249 (changelog) |
|
271 | 249 (changelog) | |
272 | 163 (manifests) |
|
272 | 163 (manifests) | |
273 | 133 a |
|
273 | 133 a | |
274 | saved backup bundle to $TESTTMP/.hg/strip-backup/a9a13940fc03-7c2e8674-amend.hg (glob) |
|
274 | saved backup bundle to $TESTTMP/.hg/strip-backup/a9a13940fc03-7c2e8674-amend.hg (glob) | |
275 | 1 changesets found |
|
275 | 1 changesets found | |
276 | uncompressed size of bundle content: |
|
276 | uncompressed size of bundle content: | |
277 | 257 (changelog) |
|
277 | 257 (changelog) | |
278 | 163 (manifests) |
|
278 | 163 (manifests) | |
279 | 133 a |
|
279 | 133 a | |
280 | adding branch |
|
280 | adding branch | |
281 | adding changesets |
|
281 | adding changesets | |
282 | adding manifests |
|
282 | adding manifests | |
283 | adding file changes |
|
283 | adding file changes | |
284 | added 1 changesets with 1 changes to 1 files |
|
284 | added 1 changesets with 1 changes to 1 files | |
285 | committed changeset 1:64a124ba1b44 |
|
285 | committed changeset 1:64a124ba1b44 | |
286 |
|
286 | |||
287 | Same, but with changes in working dir (different code path): |
|
287 | Same, but with changes in working dir (different code path): | |
288 |
|
288 | |||
289 | $ echo a >> a |
|
289 | $ echo a >> a | |
290 | $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v |
|
290 | $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v | |
291 | amending changeset 64a124ba1b44 |
|
291 | amending changeset 64a124ba1b44 | |
292 | another precious commit message |
|
292 | another precious commit message | |
293 |
|
293 | |||
294 |
|
294 | |||
295 | HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
295 | HG: Enter commit message. Lines beginning with 'HG:' are removed. | |
296 | HG: Leave message empty to abort commit. |
|
296 | HG: Leave message empty to abort commit. | |
297 | HG: -- |
|
297 | HG: -- | |
298 | HG: user: foo |
|
298 | HG: user: foo | |
299 | HG: branch 'default' |
|
299 | HG: branch 'default' | |
300 | HG: changed a |
|
300 | HG: changed a | |
301 | committing files: |
|
301 | committing files: | |
302 | a |
|
302 | a | |
303 | committing manifest |
|
303 | committing manifest | |
304 | committing changelog |
|
304 | committing changelog | |
305 | 1 changesets found |
|
305 | 1 changesets found | |
306 | uncompressed size of bundle content: |
|
306 | uncompressed size of bundle content: | |
307 | 257 (changelog) |
|
307 | 257 (changelog) | |
308 | 163 (manifests) |
|
308 | 163 (manifests) | |
309 | 133 a |
|
309 | 133 a | |
310 | saved backup bundle to $TESTTMP/.hg/strip-backup/64a124ba1b44-10374b8f-amend.hg (glob) |
|
310 | saved backup bundle to $TESTTMP/.hg/strip-backup/64a124ba1b44-10374b8f-amend.hg (glob) | |
311 | 1 changesets found |
|
311 | 1 changesets found | |
312 | uncompressed size of bundle content: |
|
312 | uncompressed size of bundle content: | |
313 | 257 (changelog) |
|
313 | 257 (changelog) | |
314 | 163 (manifests) |
|
314 | 163 (manifests) | |
315 | 135 a |
|
315 | 135 a | |
316 | adding branch |
|
316 | adding branch | |
317 | adding changesets |
|
317 | adding changesets | |
318 | adding manifests |
|
318 | adding manifests | |
319 | adding file changes |
|
319 | adding file changes | |
320 | added 1 changesets with 1 changes to 1 files |
|
320 | added 1 changesets with 1 changes to 1 files | |
321 | committed changeset 1:7892795b8e38 |
|
321 | committed changeset 1:7892795b8e38 | |
322 |
|
322 | |||
323 | $ rm editor.sh |
|
323 | $ rm editor.sh | |
324 | $ hg log -r . |
|
324 | $ hg log -r . | |
325 | changeset: 1:7892795b8e38 |
|
325 | changeset: 1:7892795b8e38 | |
326 | tag: tip |
|
326 | tag: tip | |
327 | user: foo |
|
327 | user: foo | |
328 | date: Thu Jan 01 00:00:01 1970 +0000 |
|
328 | date: Thu Jan 01 00:00:01 1970 +0000 | |
329 | summary: another precious commit message |
|
329 | summary: another precious commit message | |
330 |
|
330 | |||
331 |
|
331 | |||
332 | Moving bookmarks, preserve active bookmark: |
|
332 | Moving bookmarks, preserve active bookmark: | |
333 |
|
333 | |||
334 | $ hg book book1 |
|
334 | $ hg book book1 | |
335 | $ hg book book2 |
|
335 | $ hg book book2 | |
336 | $ hg ci --amend -m 'move bookmarks' |
|
336 | $ hg ci --amend -m 'move bookmarks' | |
337 | saved backup bundle to $TESTTMP/.hg/strip-backup/7892795b8e38-3fb46217-amend.hg (glob) |
|
337 | saved backup bundle to $TESTTMP/.hg/strip-backup/7892795b8e38-3fb46217-amend.hg (glob) | |
338 | $ hg book |
|
338 | $ hg book | |
339 | book1 1:8311f17e2616 |
|
339 | book1 1:8311f17e2616 | |
340 | * book2 1:8311f17e2616 |
|
340 | * book2 1:8311f17e2616 | |
341 | $ echo a >> a |
|
341 | $ echo a >> a | |
342 | $ hg ci --amend -m 'move bookmarks' |
|
342 | $ hg ci --amend -m 'move bookmarks' | |
343 | saved backup bundle to $TESTTMP/.hg/strip-backup/8311f17e2616-f0504fe3-amend.hg (glob) |
|
343 | saved backup bundle to $TESTTMP/.hg/strip-backup/8311f17e2616-f0504fe3-amend.hg (glob) | |
344 | $ hg book |
|
344 | $ hg book | |
345 | book1 1:a3b65065808c |
|
345 | book1 1:a3b65065808c | |
346 | * book2 1:a3b65065808c |
|
346 | * book2 1:a3b65065808c | |
347 |
|
347 | |||
348 | abort does not loose bookmarks |
|
348 | abort does not loose bookmarks | |
349 |
|
349 | |||
350 | $ cat > editor.sh << '__EOF__' |
|
350 | $ cat > editor.sh << '__EOF__' | |
351 | > #!/bin/sh |
|
351 | > #!/bin/sh | |
352 | > echo "" > "$1" |
|
352 | > echo "" > "$1" | |
353 | > __EOF__ |
|
353 | > __EOF__ | |
354 | $ echo a >> a |
|
354 | $ echo a >> a | |
355 | $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend |
|
355 | $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend | |
356 | abort: empty commit message |
|
356 | abort: empty commit message | |
357 | [255] |
|
357 | [255] | |
358 | $ hg book |
|
358 | $ hg book | |
359 | book1 1:a3b65065808c |
|
359 | book1 1:a3b65065808c | |
360 | * book2 1:a3b65065808c |
|
360 | * book2 1:a3b65065808c | |
361 | $ hg revert -Caq |
|
361 | $ hg revert -Caq | |
362 | $ rm editor.sh |
|
362 | $ rm editor.sh | |
363 |
|
363 | |||
364 | $ echo '[defaults]' >> $HGRCPATH |
|
364 | $ echo '[defaults]' >> $HGRCPATH | |
365 | $ echo "commit=-d '0 0'" >> $HGRCPATH |
|
365 | $ echo "commit=-d '0 0'" >> $HGRCPATH | |
366 |
|
366 | |||
367 | Moving branches: |
|
367 | Moving branches: | |
368 |
|
368 | |||
369 | $ hg branch foo |
|
369 | $ hg branch foo | |
370 | marked working directory as branch foo |
|
370 | marked working directory as branch foo | |
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 -m 'branch foo' |
|
373 | $ hg ci -m 'branch foo' | |
374 | $ hg branch default -f |
|
374 | $ hg branch default -f | |
375 | marked working directory as branch default |
|
375 | marked working directory as branch default | |
376 | $ hg ci --amend -m 'back to default' |
|
376 | $ hg ci --amend -m 'back to default' | |
377 | saved backup bundle to $TESTTMP/.hg/strip-backup/f8339a38efe1-c18453c9-amend.hg (glob) |
|
377 | saved backup bundle to $TESTTMP/.hg/strip-backup/f8339a38efe1-c18453c9-amend.hg (glob) | |
378 | $ hg branches |
|
378 | $ hg branches | |
379 | default 2:9c07515f2650 |
|
379 | default 2:9c07515f2650 | |
380 |
|
380 | |||
381 | Close branch: |
|
381 | Close branch: | |
382 |
|
382 | |||
383 | $ hg up -q 0 |
|
383 | $ hg up -q 0 | |
384 | $ echo b >> b |
|
384 | $ echo b >> b | |
385 | $ hg branch foo |
|
385 | $ hg branch foo | |
386 | marked working directory as branch foo |
|
386 | marked working directory as branch foo | |
387 | (branches are permanent and global, did you want a bookmark?) |
|
387 | (branches are permanent and global, did you want a bookmark?) | |
388 | $ hg ci -Am 'fork' |
|
388 | $ hg ci -Am 'fork' | |
389 | adding b |
|
389 | adding b | |
390 | $ echo b >> b |
|
390 | $ echo b >> b | |
391 | $ hg ci -mb |
|
391 | $ hg ci -mb | |
392 | $ hg ci --amend --close-branch -m 'closing branch foo' |
|
392 | $ hg ci --amend --close-branch -m 'closing branch foo' | |
393 | saved backup bundle to $TESTTMP/.hg/strip-backup/c962248fa264-54245dc7-amend.hg (glob) |
|
393 | saved backup bundle to $TESTTMP/.hg/strip-backup/c962248fa264-54245dc7-amend.hg (glob) | |
394 |
|
394 | |||
395 | Same thing, different code path: |
|
395 | Same thing, different code path: | |
396 |
|
396 | |||
397 | $ echo b >> b |
|
397 | $ echo b >> b | |
398 | $ hg ci -m 'reopen branch' |
|
398 | $ hg ci -m 'reopen branch' | |
399 | reopening closed branch head 4 |
|
399 | reopening closed branch head 4 | |
400 | $ echo b >> b |
|
400 | $ echo b >> b | |
401 | $ hg ci --amend --close-branch |
|
401 | $ hg ci --amend --close-branch | |
402 | saved backup bundle to $TESTTMP/.hg/strip-backup/027371728205-b900d9fa-amend.hg (glob) |
|
402 | saved backup bundle to $TESTTMP/.hg/strip-backup/027371728205-b900d9fa-amend.hg (glob) | |
403 | $ hg branches |
|
403 | $ hg branches | |
404 | default 2:9c07515f2650 |
|
404 | default 2:9c07515f2650 | |
405 |
|
405 | |||
406 | Refuse to amend during a merge: |
|
406 | Refuse to amend during a merge: | |
407 |
|
407 | |||
408 | $ hg up -q default |
|
408 | $ hg up -q default | |
409 | $ hg merge foo |
|
409 | $ hg merge foo | |
410 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
410 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
411 | (branch merge, don't forget to commit) |
|
411 | (branch merge, don't forget to commit) | |
412 | $ hg ci --amend |
|
412 | $ hg ci --amend | |
413 | abort: cannot amend while merging |
|
413 | abort: cannot amend while merging | |
414 | [255] |
|
414 | [255] | |
415 | $ hg ci -m 'merge' |
|
415 | $ hg ci -m 'merge' | |
416 |
|
416 | |||
417 | Follow copies/renames: |
|
417 | Follow copies/renames: | |
418 |
|
418 | |||
419 | $ hg mv b c |
|
419 | $ hg mv b c | |
420 | $ hg ci -m 'b -> c' |
|
420 | $ hg ci -m 'b -> c' | |
421 | $ hg mv c d |
|
421 | $ hg mv c d | |
422 | $ hg ci --amend -m 'b -> d' |
|
422 | $ hg ci --amend -m 'b -> d' | |
423 | saved backup bundle to $TESTTMP/.hg/strip-backup/42f3f27a067d-f23cc9f7-amend.hg (glob) |
|
423 | saved backup bundle to $TESTTMP/.hg/strip-backup/42f3f27a067d-f23cc9f7-amend.hg (glob) | |
424 | $ hg st --rev '.^' --copies d |
|
424 | $ hg st --rev '.^' --copies d | |
425 | A d |
|
425 | A d | |
426 | b |
|
426 | b | |
427 | $ hg cp d e |
|
427 | $ hg cp d e | |
428 | $ hg ci -m 'e = d' |
|
428 | $ hg ci -m 'e = d' | |
429 | $ hg cp e f |
|
429 | $ hg cp e f | |
430 | $ hg ci --amend -m 'f = d' |
|
430 | $ hg ci --amend -m 'f = d' | |
431 | saved backup bundle to $TESTTMP/.hg/strip-backup/9198f73182d5-251d584a-amend.hg (glob) |
|
431 | saved backup bundle to $TESTTMP/.hg/strip-backup/9198f73182d5-251d584a-amend.hg (glob) | |
432 | $ hg st --rev '.^' --copies f |
|
432 | $ hg st --rev '.^' --copies f | |
433 | A f |
|
433 | A f | |
434 | d |
|
434 | d | |
435 |
|
435 | |||
436 | $ mv f f.orig |
|
436 | $ mv f f.orig | |
437 | $ hg rm -A f |
|
437 | $ hg rm -A f | |
438 | $ hg ci -m removef |
|
438 | $ hg ci -m removef | |
439 | $ hg cp a f |
|
439 | $ hg cp a f | |
440 | $ mv f.orig f |
|
440 | $ mv f.orig f | |
441 | $ hg ci --amend -m replacef |
|
441 | $ hg ci --amend -m replacef | |
442 | saved backup bundle to $TESTTMP/.hg/strip-backup/f0993ab6b482-eda301bf-amend.hg (glob) |
|
442 | saved backup bundle to $TESTTMP/.hg/strip-backup/f0993ab6b482-eda301bf-amend.hg (glob) | |
443 | $ hg st --change . --copies |
|
443 | $ hg st --change . --copies | |
444 | $ hg log -r . --template "{file_copies}\n" |
|
444 | $ hg log -r . --template "{file_copies}\n" | |
445 |
|
445 | |||
446 |
|
446 | |||
447 | Move added file (issue3410): |
|
447 | Move added file (issue3410): | |
448 |
|
448 | |||
449 | $ echo g >> g |
|
449 | $ echo g >> g | |
450 | $ hg ci -Am g |
|
450 | $ hg ci -Am g | |
451 | adding g |
|
451 | adding g | |
452 | $ hg mv g h |
|
452 | $ hg mv g h | |
453 | $ hg ci --amend |
|
453 | $ hg ci --amend | |
454 | saved backup bundle to $TESTTMP/.hg/strip-backup/58585e3f095c-0f5ebcda-amend.hg (glob) |
|
454 | saved backup bundle to $TESTTMP/.hg/strip-backup/58585e3f095c-0f5ebcda-amend.hg (glob) | |
455 | $ hg st --change . --copies h |
|
455 | $ hg st --change . --copies h | |
456 | A h |
|
456 | A h | |
457 | $ hg log -r . --template "{file_copies}\n" |
|
457 | $ hg log -r . --template "{file_copies}\n" | |
458 |
|
458 | |||
459 |
|
459 | |||
460 | Can't rollback an amend: |
|
460 | Can't rollback an amend: | |
461 |
|
461 | |||
462 | $ hg rollback |
|
462 | $ hg rollback | |
463 | no rollback information available |
|
463 | no rollback information available | |
464 | [1] |
|
464 | [1] | |
465 |
|
465 | |||
466 | Preserve extra dict (issue3430): |
|
466 | Preserve extra dict (issue3430): | |
467 |
|
467 | |||
468 | $ hg branch a |
|
468 | $ hg branch a | |
469 | marked working directory as branch a |
|
469 | marked working directory as branch a | |
470 | (branches are permanent and global, did you want a bookmark?) |
|
470 | (branches are permanent and global, did you want a bookmark?) | |
471 | $ echo a >> a |
|
471 | $ echo a >> a | |
472 | $ hg ci -ma |
|
472 | $ hg ci -ma | |
473 | $ hg ci --amend -m "a'" |
|
473 | $ hg ci --amend -m "a'" | |
474 | saved backup bundle to $TESTTMP/.hg/strip-backup/39a162f1d65e-9dfe13d8-amend.hg (glob) |
|
474 | saved backup bundle to $TESTTMP/.hg/strip-backup/39a162f1d65e-9dfe13d8-amend.hg (glob) | |
475 | $ hg log -r . --template "{branch}\n" |
|
475 | $ hg log -r . --template "{branch}\n" | |
476 | a |
|
476 | a | |
477 | $ hg ci --amend -m "a''" |
|
477 | $ hg ci --amend -m "a''" | |
478 | saved backup bundle to $TESTTMP/.hg/strip-backup/d5ca7b1ac72b-0b4c1a34-amend.hg (glob) |
|
478 | saved backup bundle to $TESTTMP/.hg/strip-backup/d5ca7b1ac72b-0b4c1a34-amend.hg (glob) | |
479 | $ hg log -r . --template "{branch}\n" |
|
479 | $ hg log -r . --template "{branch}\n" | |
480 | a |
|
480 | a | |
481 |
|
481 | |||
482 | Also preserve other entries in the dict that are in the old commit, |
|
482 | Also preserve other entries in the dict that are in the old commit, | |
483 | first graft something so there's an additional entry: |
|
483 | first graft something so there's an additional entry: | |
484 |
|
484 | |||
485 | $ hg up 0 -q |
|
485 | $ hg up 0 -q | |
486 | $ echo z > z |
|
486 | $ echo z > z | |
487 | $ hg ci -Am 'fork' |
|
487 | $ hg ci -Am 'fork' | |
488 | adding z |
|
488 | adding z | |
489 | created new head |
|
489 | created new head | |
490 | $ hg up 11 |
|
490 | $ hg up 11 | |
491 | 5 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
491 | 5 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
492 | $ hg graft 12 |
|
492 | $ hg graft 12 | |
493 | grafting 12:2647734878ef "fork" (tip) |
|
493 | grafting 12:2647734878ef "fork" (tip) | |
494 | $ hg ci --amend -m 'graft amend' |
|
494 | $ hg ci --amend -m 'graft amend' | |
495 | saved backup bundle to $TESTTMP/.hg/strip-backup/fe8c6f7957ca-25638666-amend.hg (glob) |
|
495 | saved backup bundle to $TESTTMP/.hg/strip-backup/fe8c6f7957ca-25638666-amend.hg (glob) | |
496 | $ hg log -r . --debug | grep extra |
|
496 | $ hg log -r . --debug | grep extra | |
497 | extra: amend_source=fe8c6f7957ca1665ed77496ed7a07657d469ac60 |
|
497 | extra: amend_source=fe8c6f7957ca1665ed77496ed7a07657d469ac60 | |
498 | extra: branch=a |
|
498 | extra: branch=a | |
499 | extra: source=2647734878ef0236dda712fae9c1651cf694ea8a |
|
499 | extra: source=2647734878ef0236dda712fae9c1651cf694ea8a | |
500 |
|
500 | |||
501 | Preserve phase |
|
501 | Preserve phase | |
502 |
|
502 | |||
503 | $ hg phase '.^::.' |
|
503 | $ hg phase '.^::.' | |
504 | 11: draft |
|
504 | 11: draft | |
505 | 13: draft |
|
505 | 13: draft | |
506 | $ hg phase --secret --force . |
|
506 | $ hg phase --secret --force . | |
507 | $ hg phase '.^::.' |
|
507 | $ hg phase '.^::.' | |
508 | 11: draft |
|
508 | 11: draft | |
509 | 13: secret |
|
509 | 13: secret | |
510 | $ hg commit --amend -m 'amend for phase' -q |
|
510 | $ hg commit --amend -m 'amend for phase' -q | |
511 | $ hg phase '.^::.' |
|
511 | $ hg phase '.^::.' | |
512 | 11: draft |
|
512 | 11: draft | |
513 | 13: secret |
|
513 | 13: secret | |
514 |
|
514 | |||
515 | Test amend with obsolete |
|
515 | Test amend with obsolete | |
516 | --------------------------- |
|
516 | --------------------------- | |
517 |
|
517 | |||
518 | Enable obsolete |
|
518 | Enable obsolete | |
519 |
|
519 | |||
520 | $ cat >> $HGRCPATH << EOF |
|
520 | $ cat >> $HGRCPATH << EOF | |
521 | > [experimental] |
|
521 | > [experimental] | |
522 | > evolution=allowunstable |
|
|||
523 | > evolution.createmarkers=True |
|
522 | > evolution.createmarkers=True | |
|
523 | > evolution.allowunstable=True | |||
524 | > EOF |
|
524 | > EOF | |
525 |
|
525 | |||
526 | Amend with no files changes |
|
526 | Amend with no files changes | |
527 |
|
527 | |||
528 | $ hg id -n |
|
528 | $ hg id -n | |
529 | 13 |
|
529 | 13 | |
530 | $ hg ci --amend -m 'babar' |
|
530 | $ hg ci --amend -m 'babar' | |
531 | $ hg id -n |
|
531 | $ hg id -n | |
532 | 14 |
|
532 | 14 | |
533 | $ hg log -Gl 3 --style=compact |
|
533 | $ hg log -Gl 3 --style=compact | |
534 | @ 14[tip]:11 682950e85999 1970-01-01 00:00 +0000 test |
|
534 | @ 14[tip]:11 682950e85999 1970-01-01 00:00 +0000 test | |
535 | | babar |
|
535 | | babar | |
536 | | |
|
536 | | | |
537 | | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test |
|
537 | | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test | |
538 | | | fork |
|
538 | | | fork | |
539 | | ~ |
|
539 | | ~ | |
540 | o 11 0ddb275cfad1 1970-01-01 00:00 +0000 test |
|
540 | o 11 0ddb275cfad1 1970-01-01 00:00 +0000 test | |
541 | | a'' |
|
541 | | a'' | |
542 | ~ |
|
542 | ~ | |
543 | $ hg log -Gl 4 --hidden --style=compact |
|
543 | $ hg log -Gl 4 --hidden --style=compact | |
544 | @ 14[tip]:11 682950e85999 1970-01-01 00:00 +0000 test |
|
544 | @ 14[tip]:11 682950e85999 1970-01-01 00:00 +0000 test | |
545 | | babar |
|
545 | | babar | |
546 | | |
|
546 | | | |
547 | | x 13:11 5167600b0f7a 1970-01-01 00:00 +0000 test |
|
547 | | x 13:11 5167600b0f7a 1970-01-01 00:00 +0000 test | |
548 | |/ amend for phase |
|
548 | |/ amend for phase | |
549 | | |
|
549 | | | |
550 | | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test |
|
550 | | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test | |
551 | | | fork |
|
551 | | | fork | |
552 | | ~ |
|
552 | | ~ | |
553 | o 11 0ddb275cfad1 1970-01-01 00:00 +0000 test |
|
553 | o 11 0ddb275cfad1 1970-01-01 00:00 +0000 test | |
554 | | a'' |
|
554 | | a'' | |
555 | ~ |
|
555 | ~ | |
556 |
|
556 | |||
557 | Amend with files changes |
|
557 | Amend with files changes | |
558 |
|
558 | |||
559 | (note: the extra commit over 15 is a temporary junk I would be happy to get |
|
559 | (note: the extra commit over 15 is a temporary junk I would be happy to get | |
560 | ride of) |
|
560 | ride of) | |
561 |
|
561 | |||
562 | $ echo 'babar' >> a |
|
562 | $ echo 'babar' >> a | |
563 | $ hg commit --amend |
|
563 | $ hg commit --amend | |
564 | $ hg log -Gl 6 --hidden --style=compact |
|
564 | $ hg log -Gl 6 --hidden --style=compact | |
565 | @ 15[tip]:11 a5b42b49b0d5 1970-01-01 00:00 +0000 test |
|
565 | @ 15[tip]:11 a5b42b49b0d5 1970-01-01 00:00 +0000 test | |
566 | | babar |
|
566 | | babar | |
567 | | |
|
567 | | | |
568 | | x 14:11 682950e85999 1970-01-01 00:00 +0000 test |
|
568 | | x 14:11 682950e85999 1970-01-01 00:00 +0000 test | |
569 | |/ babar |
|
569 | |/ babar | |
570 | | |
|
570 | | | |
571 | | x 13:11 5167600b0f7a 1970-01-01 00:00 +0000 test |
|
571 | | x 13:11 5167600b0f7a 1970-01-01 00:00 +0000 test | |
572 | |/ amend for phase |
|
572 | |/ amend for phase | |
573 | | |
|
573 | | | |
574 | | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test |
|
574 | | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test | |
575 | | | fork |
|
575 | | | fork | |
576 | | ~ |
|
576 | | ~ | |
577 | o 11 0ddb275cfad1 1970-01-01 00:00 +0000 test |
|
577 | o 11 0ddb275cfad1 1970-01-01 00:00 +0000 test | |
578 | | a'' |
|
578 | | a'' | |
579 | | |
|
579 | | | |
580 | o 10 5fa75032e226 1970-01-01 00:00 +0000 test |
|
580 | o 10 5fa75032e226 1970-01-01 00:00 +0000 test | |
581 | | g |
|
581 | | g | |
582 | ~ |
|
582 | ~ | |
583 |
|
583 | |||
584 |
|
584 | |||
585 | Test that amend does not make it easy to create obsolescence cycle |
|
585 | Test that amend does not make it easy to create obsolescence cycle | |
586 | --------------------------------------------------------------------- |
|
586 | --------------------------------------------------------------------- | |
587 |
|
587 | |||
588 | $ hg id -r 14 --hidden |
|
588 | $ hg id -r 14 --hidden | |
589 | 682950e85999 (a) |
|
589 | 682950e85999 (a) | |
590 | $ hg revert -ar 14 --hidden |
|
590 | $ hg revert -ar 14 --hidden | |
591 | reverting a |
|
591 | reverting a | |
592 | $ hg commit --amend |
|
592 | $ hg commit --amend | |
593 | $ hg id |
|
593 | $ hg id | |
594 | 37973c7e0b61 (a) tip |
|
594 | 37973c7e0b61 (a) tip | |
595 |
|
595 | |||
596 | Test that rewriting leaving instability behind is allowed |
|
596 | Test that rewriting leaving instability behind is allowed | |
597 | --------------------------------------------------------------------- |
|
597 | --------------------------------------------------------------------- | |
598 |
|
598 | |||
599 | $ hg up '.^' |
|
599 | $ hg up '.^' | |
600 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
600 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
601 | $ echo 'b' >> a |
|
601 | $ echo 'b' >> a | |
602 | $ hg log --style compact -r 'children(.)' |
|
602 | $ hg log --style compact -r 'children(.)' | |
603 | 16[tip]:11 37973c7e0b61 1970-01-01 00:00 +0000 test |
|
603 | 16[tip]:11 37973c7e0b61 1970-01-01 00:00 +0000 test | |
604 | babar |
|
604 | babar | |
605 |
|
605 | |||
606 | $ hg commit --amend |
|
606 | $ hg commit --amend | |
607 | $ hg log -r 'orphan()' |
|
607 | $ hg log -r 'orphan()' | |
608 | changeset: 16:37973c7e0b61 |
|
608 | changeset: 16:37973c7e0b61 | |
609 | branch: a |
|
609 | branch: a | |
610 | parent: 11:0ddb275cfad1 |
|
610 | parent: 11:0ddb275cfad1 | |
611 | user: test |
|
611 | user: test | |
612 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
612 | date: Thu Jan 01 00:00:00 1970 +0000 | |
613 | instability: orphan |
|
613 | instability: orphan | |
614 | summary: babar |
|
614 | summary: babar | |
615 |
|
615 | |||
616 |
|
616 | |||
617 | Amend a merge changeset (with renames and conflicts from the second parent): |
|
617 | Amend a merge changeset (with renames and conflicts from the second parent): | |
618 |
|
618 | |||
619 | $ hg up -q default |
|
619 | $ hg up -q default | |
620 | $ hg branch -q bar |
|
620 | $ hg branch -q bar | |
621 | $ hg cp a aa |
|
621 | $ hg cp a aa | |
622 | $ hg mv z zz |
|
622 | $ hg mv z zz | |
623 | $ echo cc > cc |
|
623 | $ echo cc > cc | |
624 | $ hg add cc |
|
624 | $ hg add cc | |
625 | $ hg ci -m aazzcc |
|
625 | $ hg ci -m aazzcc | |
626 | $ hg up -q default |
|
626 | $ hg up -q default | |
627 | $ echo a >> a |
|
627 | $ echo a >> a | |
628 | $ echo dd > cc |
|
628 | $ echo dd > cc | |
629 | $ hg add cc |
|
629 | $ hg add cc | |
630 | $ hg ci -m aa |
|
630 | $ hg ci -m aa | |
631 | $ hg merge -q bar |
|
631 | $ hg merge -q bar | |
632 | warning: conflicts while merging cc! (edit, then use 'hg resolve --mark') |
|
632 | warning: conflicts while merging cc! (edit, then use 'hg resolve --mark') | |
633 | [1] |
|
633 | [1] | |
634 | $ hg resolve -m cc |
|
634 | $ hg resolve -m cc | |
635 | (no more unresolved files) |
|
635 | (no more unresolved files) | |
636 | $ hg ci -m 'merge bar' |
|
636 | $ hg ci -m 'merge bar' | |
637 | $ hg log --config diff.git=1 -pr . |
|
637 | $ hg log --config diff.git=1 -pr . | |
638 | changeset: 20:163cfd7219f7 |
|
638 | changeset: 20:163cfd7219f7 | |
639 | tag: tip |
|
639 | tag: tip | |
640 | parent: 19:30d96aeaf27b |
|
640 | parent: 19:30d96aeaf27b | |
641 | parent: 18:1aa437659d19 |
|
641 | parent: 18:1aa437659d19 | |
642 | user: test |
|
642 | user: test | |
643 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
643 | date: Thu Jan 01 00:00:00 1970 +0000 | |
644 | summary: merge bar |
|
644 | summary: merge bar | |
645 |
|
645 | |||
646 | diff --git a/a b/aa |
|
646 | diff --git a/a b/aa | |
647 | copy from a |
|
647 | copy from a | |
648 | copy to aa |
|
648 | copy to aa | |
649 | diff --git a/cc b/cc |
|
649 | diff --git a/cc b/cc | |
650 | --- a/cc |
|
650 | --- a/cc | |
651 | +++ b/cc |
|
651 | +++ b/cc | |
652 | @@ -1,1 +1,5 @@ |
|
652 | @@ -1,1 +1,5 @@ | |
653 | +<<<<<<< working copy: 30d96aeaf27b - test: aa |
|
653 | +<<<<<<< working copy: 30d96aeaf27b - test: aa | |
654 | dd |
|
654 | dd | |
655 | +======= |
|
655 | +======= | |
656 | +cc |
|
656 | +cc | |
657 | +>>>>>>> merge rev: 1aa437659d19 bar - test: aazzcc |
|
657 | +>>>>>>> merge rev: 1aa437659d19 bar - test: aazzcc | |
658 | diff --git a/z b/zz |
|
658 | diff --git a/z b/zz | |
659 | rename from z |
|
659 | rename from z | |
660 | rename to zz |
|
660 | rename to zz | |
661 |
|
661 | |||
662 | $ hg debugrename aa |
|
662 | $ hg debugrename aa | |
663 | aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e |
|
663 | aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e | |
664 | $ hg debugrename zz |
|
664 | $ hg debugrename zz | |
665 | zz renamed from z:69a1b67522704ec122181c0890bd16e9d3e7516a |
|
665 | zz renamed from z:69a1b67522704ec122181c0890bd16e9d3e7516a | |
666 | $ hg debugrename cc |
|
666 | $ hg debugrename cc | |
667 | cc not renamed |
|
667 | cc not renamed | |
668 | $ HGEDITOR="sh .hg/checkeditform.sh" hg ci --amend -m 'merge bar (amend message)' --edit |
|
668 | $ HGEDITOR="sh .hg/checkeditform.sh" hg ci --amend -m 'merge bar (amend message)' --edit | |
669 | HGEDITFORM=commit.amend.merge |
|
669 | HGEDITFORM=commit.amend.merge | |
670 | $ hg log --config diff.git=1 -pr . |
|
670 | $ hg log --config diff.git=1 -pr . | |
671 | changeset: 21:bca52d4ed186 |
|
671 | changeset: 21:bca52d4ed186 | |
672 | tag: tip |
|
672 | tag: tip | |
673 | parent: 19:30d96aeaf27b |
|
673 | parent: 19:30d96aeaf27b | |
674 | parent: 18:1aa437659d19 |
|
674 | parent: 18:1aa437659d19 | |
675 | user: test |
|
675 | user: test | |
676 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
676 | date: Thu Jan 01 00:00:00 1970 +0000 | |
677 | summary: merge bar (amend message) |
|
677 | summary: merge bar (amend message) | |
678 |
|
678 | |||
679 | diff --git a/a b/aa |
|
679 | diff --git a/a b/aa | |
680 | copy from a |
|
680 | copy from a | |
681 | copy to aa |
|
681 | copy to aa | |
682 | diff --git a/cc b/cc |
|
682 | diff --git a/cc b/cc | |
683 | --- a/cc |
|
683 | --- a/cc | |
684 | +++ b/cc |
|
684 | +++ b/cc | |
685 | @@ -1,1 +1,5 @@ |
|
685 | @@ -1,1 +1,5 @@ | |
686 | +<<<<<<< working copy: 30d96aeaf27b - test: aa |
|
686 | +<<<<<<< working copy: 30d96aeaf27b - test: aa | |
687 | dd |
|
687 | dd | |
688 | +======= |
|
688 | +======= | |
689 | +cc |
|
689 | +cc | |
690 | +>>>>>>> merge rev: 1aa437659d19 bar - test: aazzcc |
|
690 | +>>>>>>> merge rev: 1aa437659d19 bar - test: aazzcc | |
691 | diff --git a/z b/zz |
|
691 | diff --git a/z b/zz | |
692 | rename from z |
|
692 | rename from z | |
693 | rename to zz |
|
693 | rename to zz | |
694 |
|
694 | |||
695 | $ hg debugrename aa |
|
695 | $ hg debugrename aa | |
696 | aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e |
|
696 | aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e | |
697 | $ hg debugrename zz |
|
697 | $ hg debugrename zz | |
698 | zz renamed from z:69a1b67522704ec122181c0890bd16e9d3e7516a |
|
698 | zz renamed from z:69a1b67522704ec122181c0890bd16e9d3e7516a | |
699 | $ hg debugrename cc |
|
699 | $ hg debugrename cc | |
700 | cc not renamed |
|
700 | cc not renamed | |
701 | $ hg mv zz z |
|
701 | $ hg mv zz z | |
702 | $ hg ci --amend -m 'merge bar (undo rename)' |
|
702 | $ hg ci --amend -m 'merge bar (undo rename)' | |
703 | $ hg log --config diff.git=1 -pr . |
|
703 | $ hg log --config diff.git=1 -pr . | |
704 | changeset: 22:12594a98ca3f |
|
704 | changeset: 22:12594a98ca3f | |
705 | tag: tip |
|
705 | tag: tip | |
706 | parent: 19:30d96aeaf27b |
|
706 | parent: 19:30d96aeaf27b | |
707 | parent: 18:1aa437659d19 |
|
707 | parent: 18:1aa437659d19 | |
708 | user: test |
|
708 | user: test | |
709 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
709 | date: Thu Jan 01 00:00:00 1970 +0000 | |
710 | summary: merge bar (undo rename) |
|
710 | summary: merge bar (undo rename) | |
711 |
|
711 | |||
712 | diff --git a/a b/aa |
|
712 | diff --git a/a b/aa | |
713 | copy from a |
|
713 | copy from a | |
714 | copy to aa |
|
714 | copy to aa | |
715 | diff --git a/cc b/cc |
|
715 | diff --git a/cc b/cc | |
716 | --- a/cc |
|
716 | --- a/cc | |
717 | +++ b/cc |
|
717 | +++ b/cc | |
718 | @@ -1,1 +1,5 @@ |
|
718 | @@ -1,1 +1,5 @@ | |
719 | +<<<<<<< working copy: 30d96aeaf27b - test: aa |
|
719 | +<<<<<<< working copy: 30d96aeaf27b - test: aa | |
720 | dd |
|
720 | dd | |
721 | +======= |
|
721 | +======= | |
722 | +cc |
|
722 | +cc | |
723 | +>>>>>>> merge rev: 1aa437659d19 bar - test: aazzcc |
|
723 | +>>>>>>> merge rev: 1aa437659d19 bar - test: aazzcc | |
724 |
|
724 | |||
725 | $ hg debugrename z |
|
725 | $ hg debugrename z | |
726 | z not renamed |
|
726 | z not renamed | |
727 |
|
727 | |||
728 | Amend a merge changeset (with renames during the merge): |
|
728 | Amend a merge changeset (with renames during the merge): | |
729 |
|
729 | |||
730 | $ hg up -q bar |
|
730 | $ hg up -q bar | |
731 | $ echo x > x |
|
731 | $ echo x > x | |
732 | $ hg add x |
|
732 | $ hg add x | |
733 | $ hg ci -m x |
|
733 | $ hg ci -m x | |
734 | $ hg up -q default |
|
734 | $ hg up -q default | |
735 | $ hg merge -q bar |
|
735 | $ hg merge -q bar | |
736 | $ hg mv aa aaa |
|
736 | $ hg mv aa aaa | |
737 | $ echo aa >> aaa |
|
737 | $ echo aa >> aaa | |
738 | $ hg ci -m 'merge bar again' |
|
738 | $ hg ci -m 'merge bar again' | |
739 | $ hg log --config diff.git=1 -pr . |
|
739 | $ hg log --config diff.git=1 -pr . | |
740 | changeset: 24:dffde028b388 |
|
740 | changeset: 24:dffde028b388 | |
741 | tag: tip |
|
741 | tag: tip | |
742 | parent: 22:12594a98ca3f |
|
742 | parent: 22:12594a98ca3f | |
743 | parent: 23:4c94d5bc65f5 |
|
743 | parent: 23:4c94d5bc65f5 | |
744 | user: test |
|
744 | user: test | |
745 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
745 | date: Thu Jan 01 00:00:00 1970 +0000 | |
746 | summary: merge bar again |
|
746 | summary: merge bar again | |
747 |
|
747 | |||
748 | diff --git a/aa b/aa |
|
748 | diff --git a/aa b/aa | |
749 | deleted file mode 100644 |
|
749 | deleted file mode 100644 | |
750 | --- a/aa |
|
750 | --- a/aa | |
751 | +++ /dev/null |
|
751 | +++ /dev/null | |
752 | @@ -1,2 +0,0 @@ |
|
752 | @@ -1,2 +0,0 @@ | |
753 | -a |
|
753 | -a | |
754 | -a |
|
754 | -a | |
755 | diff --git a/aaa b/aaa |
|
755 | diff --git a/aaa b/aaa | |
756 | new file mode 100644 |
|
756 | new file mode 100644 | |
757 | --- /dev/null |
|
757 | --- /dev/null | |
758 | +++ b/aaa |
|
758 | +++ b/aaa | |
759 | @@ -0,0 +1,3 @@ |
|
759 | @@ -0,0 +1,3 @@ | |
760 | +a |
|
760 | +a | |
761 | +a |
|
761 | +a | |
762 | +aa |
|
762 | +aa | |
763 | diff --git a/x b/x |
|
763 | diff --git a/x b/x | |
764 | new file mode 100644 |
|
764 | new file mode 100644 | |
765 | --- /dev/null |
|
765 | --- /dev/null | |
766 | +++ b/x |
|
766 | +++ b/x | |
767 | @@ -0,0 +1,1 @@ |
|
767 | @@ -0,0 +1,1 @@ | |
768 | +x |
|
768 | +x | |
769 |
|
769 | |||
770 | $ hg debugrename aaa |
|
770 | $ hg debugrename aaa | |
771 | aaa renamed from aa:37d9b5d994eab34eda9c16b195ace52c7b129980 |
|
771 | aaa renamed from aa:37d9b5d994eab34eda9c16b195ace52c7b129980 | |
772 | $ hg mv aaa aa |
|
772 | $ hg mv aaa aa | |
773 | $ hg ci --amend -m 'merge bar again (undo rename)' |
|
773 | $ hg ci --amend -m 'merge bar again (undo rename)' | |
774 | $ hg log --config diff.git=1 -pr . |
|
774 | $ hg log --config diff.git=1 -pr . | |
775 | changeset: 25:18e3ba160489 |
|
775 | changeset: 25:18e3ba160489 | |
776 | tag: tip |
|
776 | tag: tip | |
777 | parent: 22:12594a98ca3f |
|
777 | parent: 22:12594a98ca3f | |
778 | parent: 23:4c94d5bc65f5 |
|
778 | parent: 23:4c94d5bc65f5 | |
779 | user: test |
|
779 | user: test | |
780 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
780 | date: Thu Jan 01 00:00:00 1970 +0000 | |
781 | summary: merge bar again (undo rename) |
|
781 | summary: merge bar again (undo rename) | |
782 |
|
782 | |||
783 | diff --git a/aa b/aa |
|
783 | diff --git a/aa b/aa | |
784 | --- a/aa |
|
784 | --- a/aa | |
785 | +++ b/aa |
|
785 | +++ b/aa | |
786 | @@ -1,2 +1,3 @@ |
|
786 | @@ -1,2 +1,3 @@ | |
787 | a |
|
787 | a | |
788 | a |
|
788 | a | |
789 | +aa |
|
789 | +aa | |
790 | diff --git a/x b/x |
|
790 | diff --git a/x b/x | |
791 | new file mode 100644 |
|
791 | new file mode 100644 | |
792 | --- /dev/null |
|
792 | --- /dev/null | |
793 | +++ b/x |
|
793 | +++ b/x | |
794 | @@ -0,0 +1,1 @@ |
|
794 | @@ -0,0 +1,1 @@ | |
795 | +x |
|
795 | +x | |
796 |
|
796 | |||
797 | $ hg debugrename aa |
|
797 | $ hg debugrename aa | |
798 | aa not renamed |
|
798 | aa not renamed | |
799 | $ hg debugrename -r '.^' aa |
|
799 | $ hg debugrename -r '.^' aa | |
800 | aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e |
|
800 | aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e | |
801 |
|
801 | |||
802 | Amend a merge changeset (with manifest-level conflicts): |
|
802 | Amend a merge changeset (with manifest-level conflicts): | |
803 |
|
803 | |||
804 | $ hg up -q bar |
|
804 | $ hg up -q bar | |
805 | $ hg rm aa |
|
805 | $ hg rm aa | |
806 | $ hg ci -m 'rm aa' |
|
806 | $ hg ci -m 'rm aa' | |
807 | $ hg up -q default |
|
807 | $ hg up -q default | |
808 | $ echo aa >> aa |
|
808 | $ echo aa >> aa | |
809 | $ hg ci -m aa |
|
809 | $ hg ci -m aa | |
810 | $ hg merge -q bar --config ui.interactive=True << EOF |
|
810 | $ hg merge -q bar --config ui.interactive=True << EOF | |
811 | > c |
|
811 | > c | |
812 | > EOF |
|
812 | > EOF | |
813 | local [working copy] changed aa which other [merge rev] deleted |
|
813 | local [working copy] changed aa which other [merge rev] deleted | |
814 | use (c)hanged version, (d)elete, or leave (u)nresolved? c |
|
814 | use (c)hanged version, (d)elete, or leave (u)nresolved? c | |
815 | $ hg ci -m 'merge bar (with conflicts)' |
|
815 | $ hg ci -m 'merge bar (with conflicts)' | |
816 | $ hg log --config diff.git=1 -pr . |
|
816 | $ hg log --config diff.git=1 -pr . | |
817 | changeset: 28:b4c3035e2544 |
|
817 | changeset: 28:b4c3035e2544 | |
818 | tag: tip |
|
818 | tag: tip | |
819 | parent: 27:4b216ca5ba97 |
|
819 | parent: 27:4b216ca5ba97 | |
820 | parent: 26:67db8847a540 |
|
820 | parent: 26:67db8847a540 | |
821 | user: test |
|
821 | user: test | |
822 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
822 | date: Thu Jan 01 00:00:00 1970 +0000 | |
823 | summary: merge bar (with conflicts) |
|
823 | summary: merge bar (with conflicts) | |
824 |
|
824 | |||
825 |
|
825 | |||
826 | $ hg rm aa |
|
826 | $ hg rm aa | |
827 | $ hg ci --amend -m 'merge bar (with conflicts, amended)' |
|
827 | $ hg ci --amend -m 'merge bar (with conflicts, amended)' | |
828 | $ hg log --config diff.git=1 -pr . |
|
828 | $ hg log --config diff.git=1 -pr . | |
829 | changeset: 29:1205ed810051 |
|
829 | changeset: 29:1205ed810051 | |
830 | tag: tip |
|
830 | tag: tip | |
831 | parent: 27:4b216ca5ba97 |
|
831 | parent: 27:4b216ca5ba97 | |
832 | parent: 26:67db8847a540 |
|
832 | parent: 26:67db8847a540 | |
833 | user: test |
|
833 | user: test | |
834 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
834 | date: Thu Jan 01 00:00:00 1970 +0000 | |
835 | summary: merge bar (with conflicts, amended) |
|
835 | summary: merge bar (with conflicts, amended) | |
836 |
|
836 | |||
837 | diff --git a/aa b/aa |
|
837 | diff --git a/aa b/aa | |
838 | deleted file mode 100644 |
|
838 | deleted file mode 100644 | |
839 | --- a/aa |
|
839 | --- a/aa | |
840 | +++ /dev/null |
|
840 | +++ /dev/null | |
841 | @@ -1,4 +0,0 @@ |
|
841 | @@ -1,4 +0,0 @@ | |
842 | -a |
|
842 | -a | |
843 | -a |
|
843 | -a | |
844 | -aa |
|
844 | -aa | |
845 | -aa |
|
845 | -aa | |
846 |
|
846 | |||
847 | Issue 3445: amending with --close-branch a commit that created a new head should fail |
|
847 | Issue 3445: amending with --close-branch a commit that created a new head should fail | |
848 | This shouldn't be possible: |
|
848 | This shouldn't be possible: | |
849 |
|
849 | |||
850 | $ hg up -q default |
|
850 | $ hg up -q default | |
851 | $ hg branch closewithamend |
|
851 | $ hg branch closewithamend | |
852 | marked working directory as branch closewithamend |
|
852 | marked working directory as branch closewithamend | |
853 | $ echo foo > foo |
|
853 | $ echo foo > foo | |
854 | $ hg add foo |
|
854 | $ hg add foo | |
855 | $ hg ci -m.. |
|
855 | $ hg ci -m.. | |
856 | $ hg ci --amend --close-branch -m 'closing' |
|
856 | $ hg ci --amend --close-branch -m 'closing' | |
857 | abort: can only close branch heads |
|
857 | abort: can only close branch heads | |
858 | [255] |
|
858 | [255] | |
859 |
|
859 | |||
860 | This silliness fails: |
|
860 | This silliness fails: | |
861 |
|
861 | |||
862 | $ hg branch silliness |
|
862 | $ hg branch silliness | |
863 | marked working directory as branch silliness |
|
863 | marked working directory as branch silliness | |
864 | $ echo b >> b |
|
864 | $ echo b >> b | |
865 | $ hg ci --close-branch -m'open and close' |
|
865 | $ hg ci --close-branch -m'open and close' | |
866 | abort: can only close branch heads |
|
866 | abort: can only close branch heads | |
867 | [255] |
|
867 | [255] | |
868 |
|
868 | |||
869 | Test that amend with --secret creates new secret changeset forcibly |
|
869 | Test that amend with --secret creates new secret changeset forcibly | |
870 | --------------------------------------------------------------------- |
|
870 | --------------------------------------------------------------------- | |
871 |
|
871 | |||
872 | $ hg phase '.^::.' |
|
872 | $ hg phase '.^::.' | |
873 | 29: draft |
|
873 | 29: draft | |
874 | 30: draft |
|
874 | 30: draft | |
875 | $ hg commit --amend --secret -m 'amend as secret' -q |
|
875 | $ hg commit --amend --secret -m 'amend as secret' -q | |
876 | $ hg phase '.^::.' |
|
876 | $ hg phase '.^::.' | |
877 | 29: draft |
|
877 | 29: draft | |
878 | 31: secret |
|
878 | 31: secret | |
879 |
|
879 | |||
880 | Test that amend with --edit invokes editor forcibly |
|
880 | Test that amend with --edit invokes editor forcibly | |
881 | --------------------------------------------------- |
|
881 | --------------------------------------------------- | |
882 |
|
882 | |||
883 | $ hg parents --template "{desc}\n" |
|
883 | $ hg parents --template "{desc}\n" | |
884 | amend as secret |
|
884 | amend as secret | |
885 | $ HGEDITOR=cat hg commit --amend -m "editor should be suppressed" |
|
885 | $ HGEDITOR=cat hg commit --amend -m "editor should be suppressed" | |
886 | $ hg parents --template "{desc}\n" |
|
886 | $ hg parents --template "{desc}\n" | |
887 | editor should be suppressed |
|
887 | editor should be suppressed | |
888 |
|
888 | |||
889 | $ hg status --rev '.^1::.' |
|
889 | $ hg status --rev '.^1::.' | |
890 | A foo |
|
890 | A foo | |
891 | $ HGEDITOR=cat hg commit --amend -m "editor should be invoked" --edit |
|
891 | $ HGEDITOR=cat hg commit --amend -m "editor should be invoked" --edit | |
892 | editor should be invoked |
|
892 | editor should be invoked | |
893 |
|
893 | |||
894 |
|
894 | |||
895 | HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
895 | HG: Enter commit message. Lines beginning with 'HG:' are removed. | |
896 | HG: Leave message empty to abort commit. |
|
896 | HG: Leave message empty to abort commit. | |
897 | HG: -- |
|
897 | HG: -- | |
898 | HG: user: test |
|
898 | HG: user: test | |
899 | HG: branch 'silliness' |
|
899 | HG: branch 'silliness' | |
900 | HG: added foo |
|
900 | HG: added foo | |
901 | $ hg parents --template "{desc}\n" |
|
901 | $ hg parents --template "{desc}\n" | |
902 | editor should be invoked |
|
902 | editor should be invoked | |
903 |
|
903 | |||
904 | Test that "diff()" in committemplate works correctly for amending |
|
904 | Test that "diff()" in committemplate works correctly for amending | |
905 | ----------------------------------------------------------------- |
|
905 | ----------------------------------------------------------------- | |
906 |
|
906 | |||
907 | $ cat >> .hg/hgrc <<EOF |
|
907 | $ cat >> .hg/hgrc <<EOF | |
908 | > [committemplate] |
|
908 | > [committemplate] | |
909 | > changeset.commit.amend = {desc}\n |
|
909 | > changeset.commit.amend = {desc}\n | |
910 | > HG: M: {file_mods} |
|
910 | > HG: M: {file_mods} | |
911 | > HG: A: {file_adds} |
|
911 | > HG: A: {file_adds} | |
912 | > HG: R: {file_dels} |
|
912 | > HG: R: {file_dels} | |
913 | > {splitlines(diff()) % 'HG: {line}\n'} |
|
913 | > {splitlines(diff()) % 'HG: {line}\n'} | |
914 | > EOF |
|
914 | > EOF | |
915 |
|
915 | |||
916 | $ hg parents --template "M: {file_mods}\nA: {file_adds}\nR: {file_dels}\n" |
|
916 | $ hg parents --template "M: {file_mods}\nA: {file_adds}\nR: {file_dels}\n" | |
917 | M: |
|
917 | M: | |
918 | A: foo |
|
918 | A: foo | |
919 | R: |
|
919 | R: | |
920 | $ hg status -amr |
|
920 | $ hg status -amr | |
921 | $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of foo" |
|
921 | $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of foo" | |
922 | expecting diff of foo |
|
922 | expecting diff of foo | |
923 |
|
923 | |||
924 | HG: M: |
|
924 | HG: M: | |
925 | HG: A: foo |
|
925 | HG: A: foo | |
926 | HG: R: |
|
926 | HG: R: | |
927 | HG: diff -r 1205ed810051 foo |
|
927 | HG: diff -r 1205ed810051 foo | |
928 | HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
928 | HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
929 | HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000 |
|
929 | HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000 | |
930 | HG: @@ -0,0 +1,1 @@ |
|
930 | HG: @@ -0,0 +1,1 @@ | |
931 | HG: +foo |
|
931 | HG: +foo | |
932 |
|
932 | |||
933 | $ echo y > y |
|
933 | $ echo y > y | |
934 | $ hg add y |
|
934 | $ hg add y | |
935 | $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of foo and y" |
|
935 | $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of foo and y" | |
936 | expecting diff of foo and y |
|
936 | expecting diff of foo and y | |
937 |
|
937 | |||
938 | HG: M: |
|
938 | HG: M: | |
939 | HG: A: foo y |
|
939 | HG: A: foo y | |
940 | HG: R: |
|
940 | HG: R: | |
941 | HG: diff -r 1205ed810051 foo |
|
941 | HG: diff -r 1205ed810051 foo | |
942 | HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
942 | HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
943 | HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000 |
|
943 | HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000 | |
944 | HG: @@ -0,0 +1,1 @@ |
|
944 | HG: @@ -0,0 +1,1 @@ | |
945 | HG: +foo |
|
945 | HG: +foo | |
946 | HG: diff -r 1205ed810051 y |
|
946 | HG: diff -r 1205ed810051 y | |
947 | HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
947 | HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
948 | HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000 |
|
948 | HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000 | |
949 | HG: @@ -0,0 +1,1 @@ |
|
949 | HG: @@ -0,0 +1,1 @@ | |
950 | HG: +y |
|
950 | HG: +y | |
951 |
|
951 | |||
952 | $ hg rm a |
|
952 | $ hg rm a | |
953 | $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of a, foo and y" |
|
953 | $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of a, foo and y" | |
954 | expecting diff of a, foo and y |
|
954 | expecting diff of a, foo and y | |
955 |
|
955 | |||
956 | HG: M: |
|
956 | HG: M: | |
957 | HG: A: foo y |
|
957 | HG: A: foo y | |
958 | HG: R: a |
|
958 | HG: R: a | |
959 | HG: diff -r 1205ed810051 a |
|
959 | HG: diff -r 1205ed810051 a | |
960 | HG: --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
960 | HG: --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
961 | HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
961 | HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
962 | HG: @@ -1,2 +0,0 @@ |
|
962 | HG: @@ -1,2 +0,0 @@ | |
963 | HG: -a |
|
963 | HG: -a | |
964 | HG: -a |
|
964 | HG: -a | |
965 | HG: diff -r 1205ed810051 foo |
|
965 | HG: diff -r 1205ed810051 foo | |
966 | HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
966 | HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
967 | HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000 |
|
967 | HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000 | |
968 | HG: @@ -0,0 +1,1 @@ |
|
968 | HG: @@ -0,0 +1,1 @@ | |
969 | HG: +foo |
|
969 | HG: +foo | |
970 | HG: diff -r 1205ed810051 y |
|
970 | HG: diff -r 1205ed810051 y | |
971 | HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
971 | HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
972 | HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000 |
|
972 | HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000 | |
973 | HG: @@ -0,0 +1,1 @@ |
|
973 | HG: @@ -0,0 +1,1 @@ | |
974 | HG: +y |
|
974 | HG: +y | |
975 |
|
975 | |||
976 | $ hg rm x |
|
976 | $ hg rm x | |
977 | $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of a, foo, x and y" |
|
977 | $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of a, foo, x and y" | |
978 | expecting diff of a, foo, x and y |
|
978 | expecting diff of a, foo, x and y | |
979 |
|
979 | |||
980 | HG: M: |
|
980 | HG: M: | |
981 | HG: A: foo y |
|
981 | HG: A: foo y | |
982 | HG: R: a x |
|
982 | HG: R: a x | |
983 | HG: diff -r 1205ed810051 a |
|
983 | HG: diff -r 1205ed810051 a | |
984 | HG: --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
984 | HG: --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
985 | HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
985 | HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
986 | HG: @@ -1,2 +0,0 @@ |
|
986 | HG: @@ -1,2 +0,0 @@ | |
987 | HG: -a |
|
987 | HG: -a | |
988 | HG: -a |
|
988 | HG: -a | |
989 | HG: diff -r 1205ed810051 foo |
|
989 | HG: diff -r 1205ed810051 foo | |
990 | HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
990 | HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
991 | HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000 |
|
991 | HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000 | |
992 | HG: @@ -0,0 +1,1 @@ |
|
992 | HG: @@ -0,0 +1,1 @@ | |
993 | HG: +foo |
|
993 | HG: +foo | |
994 | HG: diff -r 1205ed810051 x |
|
994 | HG: diff -r 1205ed810051 x | |
995 | HG: --- a/x Thu Jan 01 00:00:00 1970 +0000 |
|
995 | HG: --- a/x Thu Jan 01 00:00:00 1970 +0000 | |
996 | HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
996 | HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
997 | HG: @@ -1,1 +0,0 @@ |
|
997 | HG: @@ -1,1 +0,0 @@ | |
998 | HG: -x |
|
998 | HG: -x | |
999 | HG: diff -r 1205ed810051 y |
|
999 | HG: diff -r 1205ed810051 y | |
1000 | HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
1000 | HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
1001 | HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000 |
|
1001 | HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000 | |
1002 | HG: @@ -0,0 +1,1 @@ |
|
1002 | HG: @@ -0,0 +1,1 @@ | |
1003 | HG: +y |
|
1003 | HG: +y | |
1004 |
|
1004 | |||
1005 | $ echo cccc >> cc |
|
1005 | $ echo cccc >> cc | |
1006 | $ hg status -amr |
|
1006 | $ hg status -amr | |
1007 | M cc |
|
1007 | M cc | |
1008 | $ HGEDITOR=cat hg commit --amend -e -m "cc should be excluded" -X cc |
|
1008 | $ HGEDITOR=cat hg commit --amend -e -m "cc should be excluded" -X cc | |
1009 | cc should be excluded |
|
1009 | cc should be excluded | |
1010 |
|
1010 | |||
1011 | HG: M: |
|
1011 | HG: M: | |
1012 | HG: A: foo y |
|
1012 | HG: A: foo y | |
1013 | HG: R: a x |
|
1013 | HG: R: a x | |
1014 | HG: diff -r 1205ed810051 a |
|
1014 | HG: diff -r 1205ed810051 a | |
1015 | HG: --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
1015 | HG: --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
1016 | HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
1016 | HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
1017 | HG: @@ -1,2 +0,0 @@ |
|
1017 | HG: @@ -1,2 +0,0 @@ | |
1018 | HG: -a |
|
1018 | HG: -a | |
1019 | HG: -a |
|
1019 | HG: -a | |
1020 | HG: diff -r 1205ed810051 foo |
|
1020 | HG: diff -r 1205ed810051 foo | |
1021 | HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
1021 | HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
1022 | HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000 |
|
1022 | HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000 | |
1023 | HG: @@ -0,0 +1,1 @@ |
|
1023 | HG: @@ -0,0 +1,1 @@ | |
1024 | HG: +foo |
|
1024 | HG: +foo | |
1025 | HG: diff -r 1205ed810051 x |
|
1025 | HG: diff -r 1205ed810051 x | |
1026 | HG: --- a/x Thu Jan 01 00:00:00 1970 +0000 |
|
1026 | HG: --- a/x Thu Jan 01 00:00:00 1970 +0000 | |
1027 | HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
1027 | HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
1028 | HG: @@ -1,1 +0,0 @@ |
|
1028 | HG: @@ -1,1 +0,0 @@ | |
1029 | HG: -x |
|
1029 | HG: -x | |
1030 | HG: diff -r 1205ed810051 y |
|
1030 | HG: diff -r 1205ed810051 y | |
1031 | HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
1031 | HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
1032 | HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000 |
|
1032 | HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000 | |
1033 | HG: @@ -0,0 +1,1 @@ |
|
1033 | HG: @@ -0,0 +1,1 @@ | |
1034 | HG: +y |
|
1034 | HG: +y | |
1035 |
|
1035 | |||
1036 | Check for issue4405 |
|
1036 | Check for issue4405 | |
1037 | ------------------- |
|
1037 | ------------------- | |
1038 |
|
1038 | |||
1039 | Setup the repo with a file that gets moved in a second commit. |
|
1039 | Setup the repo with a file that gets moved in a second commit. | |
1040 | $ hg init repo |
|
1040 | $ hg init repo | |
1041 | $ cd repo |
|
1041 | $ cd repo | |
1042 | $ touch a0 |
|
1042 | $ touch a0 | |
1043 | $ hg add a0 |
|
1043 | $ hg add a0 | |
1044 | $ hg commit -m a0 |
|
1044 | $ hg commit -m a0 | |
1045 | $ hg mv a0 a1 |
|
1045 | $ hg mv a0 a1 | |
1046 | $ hg commit -m a1 |
|
1046 | $ hg commit -m a1 | |
1047 | $ hg up -q 0 |
|
1047 | $ hg up -q 0 | |
1048 | $ hg log -G --template '{rev} {desc}' |
|
1048 | $ hg log -G --template '{rev} {desc}' | |
1049 | o 1 a1 |
|
1049 | o 1 a1 | |
1050 | | |
|
1050 | | | |
1051 | @ 0 a0 |
|
1051 | @ 0 a0 | |
1052 |
|
1052 | |||
1053 |
|
1053 | |||
1054 | Now we branch the repro, but re-use the file contents, so we have a divergence |
|
1054 | Now we branch the repro, but re-use the file contents, so we have a divergence | |
1055 | in the file revlog topology and the changelog topology. |
|
1055 | in the file revlog topology and the changelog topology. | |
1056 | $ hg revert --rev 1 --all |
|
1056 | $ hg revert --rev 1 --all | |
1057 | removing a0 |
|
1057 | removing a0 | |
1058 | adding a1 |
|
1058 | adding a1 | |
1059 | $ hg ci -qm 'a1-amend' |
|
1059 | $ hg ci -qm 'a1-amend' | |
1060 | $ hg log -G --template '{rev} {desc}' |
|
1060 | $ hg log -G --template '{rev} {desc}' | |
1061 | @ 2 a1-amend |
|
1061 | @ 2 a1-amend | |
1062 | | |
|
1062 | | | |
1063 | | o 1 a1 |
|
1063 | | o 1 a1 | |
1064 | |/ |
|
1064 | |/ | |
1065 | o 0 a0 |
|
1065 | o 0 a0 | |
1066 |
|
1066 | |||
1067 |
|
1067 | |||
1068 | The way mercurial does amends is by folding the working copy and old commit |
|
1068 | The way mercurial does amends is by folding the working copy and old commit | |
1069 | together into another commit (rev 3). During this process, _findlimit is called |
|
1069 | together into another commit (rev 3). During this process, _findlimit is called | |
1070 | to check how far back to look for the transitive closure of file copy |
|
1070 | to check how far back to look for the transitive closure of file copy | |
1071 | information, but due to the divergence of the filelog and changelog graph |
|
1071 | information, but due to the divergence of the filelog and changelog graph | |
1072 | topologies, before _findlimit was fixed, it returned a rev which was not far |
|
1072 | topologies, before _findlimit was fixed, it returned a rev which was not far | |
1073 | enough back in this case. |
|
1073 | enough back in this case. | |
1074 | $ hg mv a1 a2 |
|
1074 | $ hg mv a1 a2 | |
1075 | $ hg status --copies --rev 0 |
|
1075 | $ hg status --copies --rev 0 | |
1076 | A a2 |
|
1076 | A a2 | |
1077 | a0 |
|
1077 | a0 | |
1078 | R a0 |
|
1078 | R a0 | |
1079 | $ hg ci --amend -q |
|
1079 | $ hg ci --amend -q | |
1080 | $ hg log -G --template '{rev} {desc}' |
|
1080 | $ hg log -G --template '{rev} {desc}' | |
1081 | @ 3 a1-amend |
|
1081 | @ 3 a1-amend | |
1082 | | |
|
1082 | | | |
1083 | | o 1 a1 |
|
1083 | | o 1 a1 | |
1084 | |/ |
|
1084 | |/ | |
1085 | o 0 a0 |
|
1085 | o 0 a0 | |
1086 |
|
1086 | |||
1087 |
|
1087 | |||
1088 | Before the fix, the copy information was lost. |
|
1088 | Before the fix, the copy information was lost. | |
1089 | $ hg status --copies --rev 0 |
|
1089 | $ hg status --copies --rev 0 | |
1090 | A a2 |
|
1090 | A a2 | |
1091 | a0 |
|
1091 | a0 | |
1092 | R a0 |
|
1092 | R a0 | |
1093 | $ cd .. |
|
1093 | $ cd .. | |
1094 |
|
1094 | |||
1095 | Check that amend properly preserve rename from directory rename (issue-4516) |
|
1095 | Check that amend properly preserve rename from directory rename (issue-4516) | |
1096 |
|
1096 | |||
1097 | If a parent of the merge renames a full directory, any files added to the old |
|
1097 | If a parent of the merge renames a full directory, any files added to the old | |
1098 | directory in the other parent will be renamed to the new directory. For some |
|
1098 | directory in the other parent will be renamed to the new directory. For some | |
1099 | reason, the rename metadata was when amending such merge. This test ensure we |
|
1099 | reason, the rename metadata was when amending such merge. This test ensure we | |
1100 | do not regress. We have a dedicated repo because it needs a setup with renamed |
|
1100 | do not regress. We have a dedicated repo because it needs a setup with renamed | |
1101 | directory) |
|
1101 | directory) | |
1102 |
|
1102 | |||
1103 | $ hg init issue4516 |
|
1103 | $ hg init issue4516 | |
1104 | $ cd issue4516 |
|
1104 | $ cd issue4516 | |
1105 | $ mkdir olddirname |
|
1105 | $ mkdir olddirname | |
1106 | $ echo line1 > olddirname/commonfile.py |
|
1106 | $ echo line1 > olddirname/commonfile.py | |
1107 | $ hg add olddirname/commonfile.py |
|
1107 | $ hg add olddirname/commonfile.py | |
1108 | $ hg ci -m first |
|
1108 | $ hg ci -m first | |
1109 |
|
1109 | |||
1110 | $ hg branch newdirname |
|
1110 | $ hg branch newdirname | |
1111 | marked working directory as branch newdirname |
|
1111 | marked working directory as branch newdirname | |
1112 | (branches are permanent and global, did you want a bookmark?) |
|
1112 | (branches are permanent and global, did you want a bookmark?) | |
1113 | $ hg mv olddirname newdirname |
|
1113 | $ hg mv olddirname newdirname | |
1114 | moving olddirname/commonfile.py to newdirname/commonfile.py (glob) |
|
1114 | moving olddirname/commonfile.py to newdirname/commonfile.py (glob) | |
1115 | $ hg ci -m rename |
|
1115 | $ hg ci -m rename | |
1116 |
|
1116 | |||
1117 | $ hg update default |
|
1117 | $ hg update default | |
1118 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
1118 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
1119 | $ echo line1 > olddirname/newfile.py |
|
1119 | $ echo line1 > olddirname/newfile.py | |
1120 | $ hg add olddirname/newfile.py |
|
1120 | $ hg add olddirname/newfile.py | |
1121 | $ hg ci -m log |
|
1121 | $ hg ci -m log | |
1122 |
|
1122 | |||
1123 | $ hg up newdirname |
|
1123 | $ hg up newdirname | |
1124 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
1124 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
1125 | $ # create newdirname/newfile.py |
|
1125 | $ # create newdirname/newfile.py | |
1126 | $ hg merge default |
|
1126 | $ hg merge default | |
1127 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1127 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1128 | (branch merge, don't forget to commit) |
|
1128 | (branch merge, don't forget to commit) | |
1129 | $ hg ci -m add |
|
1129 | $ hg ci -m add | |
1130 | $ |
|
1130 | $ | |
1131 | $ hg debugrename newdirname/newfile.py |
|
1131 | $ hg debugrename newdirname/newfile.py | |
1132 | newdirname/newfile.py renamed from olddirname/newfile.py:690b295714aed510803d3020da9c70fca8336def (glob) |
|
1132 | newdirname/newfile.py renamed from olddirname/newfile.py:690b295714aed510803d3020da9c70fca8336def (glob) | |
1133 | $ hg status -C --change . |
|
1133 | $ hg status -C --change . | |
1134 | A newdirname/newfile.py |
|
1134 | A newdirname/newfile.py | |
1135 | $ hg status -C --rev 1 |
|
1135 | $ hg status -C --rev 1 | |
1136 | A newdirname/newfile.py |
|
1136 | A newdirname/newfile.py | |
1137 | $ hg status -C --rev 2 |
|
1137 | $ hg status -C --rev 2 | |
1138 | A newdirname/commonfile.py |
|
1138 | A newdirname/commonfile.py | |
1139 | olddirname/commonfile.py |
|
1139 | olddirname/commonfile.py | |
1140 | A newdirname/newfile.py |
|
1140 | A newdirname/newfile.py | |
1141 | olddirname/newfile.py |
|
1141 | olddirname/newfile.py | |
1142 | R olddirname/commonfile.py |
|
1142 | R olddirname/commonfile.py | |
1143 | R olddirname/newfile.py |
|
1143 | R olddirname/newfile.py | |
1144 | $ hg debugindex newdirname/newfile.py |
|
1144 | $ hg debugindex newdirname/newfile.py | |
1145 | rev offset length delta linkrev nodeid p1 p2 |
|
1145 | rev offset length delta linkrev nodeid p1 p2 | |
1146 | 0 0 89 -1 3 34a4d536c0c0 000000000000 000000000000 |
|
1146 | 0 0 89 -1 3 34a4d536c0c0 000000000000 000000000000 | |
1147 |
|
1147 | |||
1148 | $ echo a >> newdirname/commonfile.py |
|
1148 | $ echo a >> newdirname/commonfile.py | |
1149 | $ hg ci --amend -m bug |
|
1149 | $ hg ci --amend -m bug | |
1150 | $ hg debugrename newdirname/newfile.py |
|
1150 | $ hg debugrename newdirname/newfile.py | |
1151 | newdirname/newfile.py renamed from olddirname/newfile.py:690b295714aed510803d3020da9c70fca8336def (glob) |
|
1151 | newdirname/newfile.py renamed from olddirname/newfile.py:690b295714aed510803d3020da9c70fca8336def (glob) | |
1152 | $ hg debugindex newdirname/newfile.py |
|
1152 | $ hg debugindex newdirname/newfile.py | |
1153 | rev offset length delta linkrev nodeid p1 p2 |
|
1153 | rev offset length delta linkrev nodeid p1 p2 | |
1154 | 0 0 89 -1 3 34a4d536c0c0 000000000000 000000000000 |
|
1154 | 0 0 89 -1 3 34a4d536c0c0 000000000000 000000000000 | |
1155 |
|
1155 | |||
1156 | #if execbit |
|
1156 | #if execbit | |
1157 |
|
1157 | |||
1158 | Test if amend preserves executable bit changes |
|
1158 | Test if amend preserves executable bit changes | |
1159 | $ chmod +x newdirname/commonfile.py |
|
1159 | $ chmod +x newdirname/commonfile.py | |
1160 | $ hg ci -m chmod |
|
1160 | $ hg ci -m chmod | |
1161 | $ hg ci --amend -m "chmod amended" |
|
1161 | $ hg ci --amend -m "chmod amended" | |
1162 | $ hg ci --amend -m "chmod amended second time" |
|
1162 | $ hg ci --amend -m "chmod amended second time" | |
1163 | $ hg log -p --git -r . |
|
1163 | $ hg log -p --git -r . | |
1164 | changeset: 7:b1326f52dddf |
|
1164 | changeset: 7:b1326f52dddf | |
1165 | branch: newdirname |
|
1165 | branch: newdirname | |
1166 | tag: tip |
|
1166 | tag: tip | |
1167 | parent: 4:7fd235f7cb2f |
|
1167 | parent: 4:7fd235f7cb2f | |
1168 | user: test |
|
1168 | user: test | |
1169 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1169 | date: Thu Jan 01 00:00:00 1970 +0000 | |
1170 | summary: chmod amended second time |
|
1170 | summary: chmod amended second time | |
1171 |
|
1171 | |||
1172 | diff --git a/newdirname/commonfile.py b/newdirname/commonfile.py |
|
1172 | diff --git a/newdirname/commonfile.py b/newdirname/commonfile.py | |
1173 | old mode 100644 |
|
1173 | old mode 100644 | |
1174 | new mode 100755 |
|
1174 | new mode 100755 | |
1175 |
|
1175 | |||
1176 | #endif |
|
1176 | #endif | |
1177 |
|
1177 | |||
1178 | Test amend with file inclusion options |
|
1178 | Test amend with file inclusion options | |
1179 | -------------------------------------- |
|
1179 | -------------------------------------- | |
1180 |
|
1180 | |||
1181 | These tests ensure that we are always amending some files that were part of the |
|
1181 | These tests ensure that we are always amending some files that were part of the | |
1182 | pre-amend commit. We want to test that the remaining files in the pre-amend |
|
1182 | pre-amend commit. We want to test that the remaining files in the pre-amend | |
1183 | commit were not changed in the amended commit. We do so by performing a diff of |
|
1183 | commit were not changed in the amended commit. We do so by performing a diff of | |
1184 | the amended commit against its parent commit. |
|
1184 | the amended commit against its parent commit. | |
1185 | $ cd .. |
|
1185 | $ cd .. | |
1186 | $ hg init testfileinclusions |
|
1186 | $ hg init testfileinclusions | |
1187 | $ cd testfileinclusions |
|
1187 | $ cd testfileinclusions | |
1188 | $ echo a > a |
|
1188 | $ echo a > a | |
1189 | $ echo b > b |
|
1189 | $ echo b > b | |
1190 | $ hg commit -Aqm "Adding a and b" |
|
1190 | $ hg commit -Aqm "Adding a and b" | |
1191 |
|
1191 | |||
1192 | Only add changes to a particular file |
|
1192 | Only add changes to a particular file | |
1193 | $ echo a >> a |
|
1193 | $ echo a >> a | |
1194 | $ echo b >> b |
|
1194 | $ echo b >> b | |
1195 | $ hg commit --amend -I a |
|
1195 | $ hg commit --amend -I a | |
1196 | $ hg diff --git -r null -r . |
|
1196 | $ hg diff --git -r null -r . | |
1197 | diff --git a/a b/a |
|
1197 | diff --git a/a b/a | |
1198 | new file mode 100644 |
|
1198 | new file mode 100644 | |
1199 | --- /dev/null |
|
1199 | --- /dev/null | |
1200 | +++ b/a |
|
1200 | +++ b/a | |
1201 | @@ -0,0 +1,2 @@ |
|
1201 | @@ -0,0 +1,2 @@ | |
1202 | +a |
|
1202 | +a | |
1203 | +a |
|
1203 | +a | |
1204 | diff --git a/b b/b |
|
1204 | diff --git a/b b/b | |
1205 | new file mode 100644 |
|
1205 | new file mode 100644 | |
1206 | --- /dev/null |
|
1206 | --- /dev/null | |
1207 | +++ b/b |
|
1207 | +++ b/b | |
1208 | @@ -0,0 +1,1 @@ |
|
1208 | @@ -0,0 +1,1 @@ | |
1209 | +b |
|
1209 | +b | |
1210 |
|
1210 | |||
1211 | $ echo a >> a |
|
1211 | $ echo a >> a | |
1212 | $ hg commit --amend b |
|
1212 | $ hg commit --amend b | |
1213 | $ hg diff --git -r null -r . |
|
1213 | $ hg diff --git -r null -r . | |
1214 | diff --git a/a b/a |
|
1214 | diff --git a/a b/a | |
1215 | new file mode 100644 |
|
1215 | new file mode 100644 | |
1216 | --- /dev/null |
|
1216 | --- /dev/null | |
1217 | +++ b/a |
|
1217 | +++ b/a | |
1218 | @@ -0,0 +1,2 @@ |
|
1218 | @@ -0,0 +1,2 @@ | |
1219 | +a |
|
1219 | +a | |
1220 | +a |
|
1220 | +a | |
1221 | diff --git a/b b/b |
|
1221 | diff --git a/b b/b | |
1222 | new file mode 100644 |
|
1222 | new file mode 100644 | |
1223 | --- /dev/null |
|
1223 | --- /dev/null | |
1224 | +++ b/b |
|
1224 | +++ b/b | |
1225 | @@ -0,0 +1,2 @@ |
|
1225 | @@ -0,0 +1,2 @@ | |
1226 | +b |
|
1226 | +b | |
1227 | +b |
|
1227 | +b | |
1228 |
|
1228 | |||
1229 | Exclude changes to a particular file |
|
1229 | Exclude changes to a particular file | |
1230 | $ echo b >> b |
|
1230 | $ echo b >> b | |
1231 | $ hg commit --amend -X a |
|
1231 | $ hg commit --amend -X a | |
1232 | $ hg diff --git -r null -r . |
|
1232 | $ hg diff --git -r null -r . | |
1233 | diff --git a/a b/a |
|
1233 | diff --git a/a b/a | |
1234 | new file mode 100644 |
|
1234 | new file mode 100644 | |
1235 | --- /dev/null |
|
1235 | --- /dev/null | |
1236 | +++ b/a |
|
1236 | +++ b/a | |
1237 | @@ -0,0 +1,2 @@ |
|
1237 | @@ -0,0 +1,2 @@ | |
1238 | +a |
|
1238 | +a | |
1239 | +a |
|
1239 | +a | |
1240 | diff --git a/b b/b |
|
1240 | diff --git a/b b/b | |
1241 | new file mode 100644 |
|
1241 | new file mode 100644 | |
1242 | --- /dev/null |
|
1242 | --- /dev/null | |
1243 | +++ b/b |
|
1243 | +++ b/b | |
1244 | @@ -0,0 +1,3 @@ |
|
1244 | @@ -0,0 +1,3 @@ | |
1245 | +b |
|
1245 | +b | |
1246 | +b |
|
1246 | +b | |
1247 | +b |
|
1247 | +b | |
1248 |
|
1248 | |||
1249 | Check the addremove flag |
|
1249 | Check the addremove flag | |
1250 | $ echo c > c |
|
1250 | $ echo c > c | |
1251 | $ rm a |
|
1251 | $ rm a | |
1252 | $ hg commit --amend -A |
|
1252 | $ hg commit --amend -A | |
1253 | removing a |
|
1253 | removing a | |
1254 | adding c |
|
1254 | adding c | |
1255 | $ hg diff --git -r null -r . |
|
1255 | $ hg diff --git -r null -r . | |
1256 | diff --git a/b b/b |
|
1256 | diff --git a/b b/b | |
1257 | new file mode 100644 |
|
1257 | new file mode 100644 | |
1258 | --- /dev/null |
|
1258 | --- /dev/null | |
1259 | +++ b/b |
|
1259 | +++ b/b | |
1260 | @@ -0,0 +1,3 @@ |
|
1260 | @@ -0,0 +1,3 @@ | |
1261 | +b |
|
1261 | +b | |
1262 | +b |
|
1262 | +b | |
1263 | +b |
|
1263 | +b | |
1264 | diff --git a/c b/c |
|
1264 | diff --git a/c b/c | |
1265 | new file mode 100644 |
|
1265 | new file mode 100644 | |
1266 | --- /dev/null |
|
1266 | --- /dev/null | |
1267 | +++ b/c |
|
1267 | +++ b/c | |
1268 | @@ -0,0 +1,1 @@ |
|
1268 | @@ -0,0 +1,1 @@ | |
1269 | +c |
|
1269 | +c |
@@ -1,553 +1,553 b'' | |||||
1 | Test argument handling and various data parsing |
|
1 | Test argument handling and various data parsing | |
2 | ================================================== |
|
2 | ================================================== | |
3 |
|
3 | |||
4 |
|
4 | |||
5 | Enable extensions used by this test. |
|
5 | Enable extensions used by this test. | |
6 | $ cat >>$HGRCPATH <<EOF |
|
6 | $ cat >>$HGRCPATH <<EOF | |
7 | > [extensions] |
|
7 | > [extensions] | |
8 | > histedit= |
|
8 | > histedit= | |
9 | > EOF |
|
9 | > EOF | |
10 |
|
10 | |||
11 | Repo setup. |
|
11 | Repo setup. | |
12 | $ hg init foo |
|
12 | $ hg init foo | |
13 | $ cd foo |
|
13 | $ cd foo | |
14 | $ echo alpha >> alpha |
|
14 | $ echo alpha >> alpha | |
15 | $ hg addr |
|
15 | $ hg addr | |
16 | adding alpha |
|
16 | adding alpha | |
17 | $ hg ci -m one |
|
17 | $ hg ci -m one | |
18 | $ echo alpha >> alpha |
|
18 | $ echo alpha >> alpha | |
19 | $ hg ci -m two |
|
19 | $ hg ci -m two | |
20 | $ echo alpha >> alpha |
|
20 | $ echo alpha >> alpha | |
21 | $ hg ci -m three |
|
21 | $ hg ci -m three | |
22 | $ echo alpha >> alpha |
|
22 | $ echo alpha >> alpha | |
23 | $ hg ci -m four |
|
23 | $ hg ci -m four | |
24 | $ echo alpha >> alpha |
|
24 | $ echo alpha >> alpha | |
25 | $ hg ci -m five |
|
25 | $ hg ci -m five | |
26 |
|
26 | |||
27 | $ hg log --style compact --graph |
|
27 | $ hg log --style compact --graph | |
28 | @ 4[tip] 08d98a8350f3 1970-01-01 00:00 +0000 test |
|
28 | @ 4[tip] 08d98a8350f3 1970-01-01 00:00 +0000 test | |
29 | | five |
|
29 | | five | |
30 | | |
|
30 | | | |
31 | o 3 c8e68270e35a 1970-01-01 00:00 +0000 test |
|
31 | o 3 c8e68270e35a 1970-01-01 00:00 +0000 test | |
32 | | four |
|
32 | | four | |
33 | | |
|
33 | | | |
34 | o 2 eb57da33312f 1970-01-01 00:00 +0000 test |
|
34 | o 2 eb57da33312f 1970-01-01 00:00 +0000 test | |
35 | | three |
|
35 | | three | |
36 | | |
|
36 | | | |
37 | o 1 579e40513370 1970-01-01 00:00 +0000 test |
|
37 | o 1 579e40513370 1970-01-01 00:00 +0000 test | |
38 | | two |
|
38 | | two | |
39 | | |
|
39 | | | |
40 | o 0 6058cbb6cfd7 1970-01-01 00:00 +0000 test |
|
40 | o 0 6058cbb6cfd7 1970-01-01 00:00 +0000 test | |
41 | one |
|
41 | one | |
42 |
|
42 | |||
43 |
|
43 | |||
44 | histedit --continue/--abort with no existing state |
|
44 | histedit --continue/--abort with no existing state | |
45 | -------------------------------------------------- |
|
45 | -------------------------------------------------- | |
46 |
|
46 | |||
47 | $ hg histedit --continue |
|
47 | $ hg histedit --continue | |
48 | abort: no histedit in progress |
|
48 | abort: no histedit in progress | |
49 | [255] |
|
49 | [255] | |
50 | $ hg histedit --abort |
|
50 | $ hg histedit --abort | |
51 | abort: no histedit in progress |
|
51 | abort: no histedit in progress | |
52 | [255] |
|
52 | [255] | |
53 |
|
53 | |||
54 | Run a dummy edit to make sure we get tip^^ correctly via revsingle. |
|
54 | Run a dummy edit to make sure we get tip^^ correctly via revsingle. | |
55 | -------------------------------------------------------------------- |
|
55 | -------------------------------------------------------------------- | |
56 |
|
56 | |||
57 | $ HGEDITOR=cat hg histedit "tip^^" |
|
57 | $ HGEDITOR=cat hg histedit "tip^^" | |
58 | pick eb57da33312f 2 three |
|
58 | pick eb57da33312f 2 three | |
59 | pick c8e68270e35a 3 four |
|
59 | pick c8e68270e35a 3 four | |
60 | pick 08d98a8350f3 4 five |
|
60 | pick 08d98a8350f3 4 five | |
61 |
|
61 | |||
62 | # Edit history between eb57da33312f and 08d98a8350f3 |
|
62 | # Edit history between eb57da33312f and 08d98a8350f3 | |
63 | # |
|
63 | # | |
64 | # Commits are listed from least to most recent |
|
64 | # Commits are listed from least to most recent | |
65 | # |
|
65 | # | |
66 | # You can reorder changesets by reordering the lines |
|
66 | # You can reorder changesets by reordering the lines | |
67 | # |
|
67 | # | |
68 | # Commands: |
|
68 | # Commands: | |
69 | # |
|
69 | # | |
70 | # e, edit = use commit, but stop for amending |
|
70 | # e, edit = use commit, but stop for amending | |
71 | # m, mess = edit commit message without changing commit content |
|
71 | # m, mess = edit commit message without changing commit content | |
72 | # p, pick = use commit |
|
72 | # p, pick = use commit | |
73 | # b, base = checkout changeset and apply further changesets from there |
|
73 | # b, base = checkout changeset and apply further changesets from there | |
74 | # d, drop = remove commit from history |
|
74 | # d, drop = remove commit from history | |
75 | # f, fold = use commit, but combine it with the one above |
|
75 | # f, fold = use commit, but combine it with the one above | |
76 | # r, roll = like fold, but discard this commit's description and date |
|
76 | # r, roll = like fold, but discard this commit's description and date | |
77 | # |
|
77 | # | |
78 |
|
78 | |||
79 | Run on a revision not ancestors of the current working directory. |
|
79 | Run on a revision not ancestors of the current working directory. | |
80 | -------------------------------------------------------------------- |
|
80 | -------------------------------------------------------------------- | |
81 |
|
81 | |||
82 | $ hg up 2 |
|
82 | $ hg up 2 | |
83 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
83 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
84 | $ hg histedit -r 4 |
|
84 | $ hg histedit -r 4 | |
85 | abort: 08d98a8350f3 is not an ancestor of working directory |
|
85 | abort: 08d98a8350f3 is not an ancestor of working directory | |
86 | [255] |
|
86 | [255] | |
87 | $ hg up --quiet |
|
87 | $ hg up --quiet | |
88 |
|
88 | |||
89 |
|
89 | |||
90 | Test that we pick the minimum of a revrange |
|
90 | Test that we pick the minimum of a revrange | |
91 | --------------------------------------- |
|
91 | --------------------------------------- | |
92 |
|
92 | |||
93 | $ HGEDITOR=cat hg histedit '2::' --commands - << EOF |
|
93 | $ HGEDITOR=cat hg histedit '2::' --commands - << EOF | |
94 | > pick eb57da33312f 2 three |
|
94 | > pick eb57da33312f 2 three | |
95 | > pick c8e68270e35a 3 four |
|
95 | > pick c8e68270e35a 3 four | |
96 | > pick 08d98a8350f3 4 five |
|
96 | > pick 08d98a8350f3 4 five | |
97 | > EOF |
|
97 | > EOF | |
98 | $ hg up --quiet |
|
98 | $ hg up --quiet | |
99 |
|
99 | |||
100 | $ HGEDITOR=cat hg histedit 'tip:2' --commands - << EOF |
|
100 | $ HGEDITOR=cat hg histedit 'tip:2' --commands - << EOF | |
101 | > pick eb57da33312f 2 three |
|
101 | > pick eb57da33312f 2 three | |
102 | > pick c8e68270e35a 3 four |
|
102 | > pick c8e68270e35a 3 four | |
103 | > pick 08d98a8350f3 4 five |
|
103 | > pick 08d98a8350f3 4 five | |
104 | > EOF |
|
104 | > EOF | |
105 | $ hg up --quiet |
|
105 | $ hg up --quiet | |
106 |
|
106 | |||
107 | Test config specified default |
|
107 | Test config specified default | |
108 | ----------------------------- |
|
108 | ----------------------------- | |
109 |
|
109 | |||
110 | $ HGEDITOR=cat hg histedit --config "histedit.defaultrev=only(.) - ::eb57da33312f" --commands - << EOF |
|
110 | $ HGEDITOR=cat hg histedit --config "histedit.defaultrev=only(.) - ::eb57da33312f" --commands - << EOF | |
111 | > pick c8e68270e35a 3 four |
|
111 | > pick c8e68270e35a 3 four | |
112 | > pick 08d98a8350f3 4 five |
|
112 | > pick 08d98a8350f3 4 five | |
113 | > EOF |
|
113 | > EOF | |
114 |
|
114 | |||
115 | Run on a revision not descendants of the initial parent |
|
115 | Run on a revision not descendants of the initial parent | |
116 | -------------------------------------------------------------------- |
|
116 | -------------------------------------------------------------------- | |
117 |
|
117 | |||
118 | Test the message shown for inconsistent histedit state, which may be |
|
118 | Test the message shown for inconsistent histedit state, which may be | |
119 | created (and forgotten) by Mercurial earlier than 2.7. This emulates |
|
119 | created (and forgotten) by Mercurial earlier than 2.7. This emulates | |
120 | Mercurial earlier than 2.7 by renaming ".hg/histedit-state" |
|
120 | Mercurial earlier than 2.7 by renaming ".hg/histedit-state" | |
121 | temporarily. |
|
121 | temporarily. | |
122 |
|
122 | |||
123 | $ hg log -G -T '{rev} {shortest(node)} {desc}\n' -r 2:: |
|
123 | $ hg log -G -T '{rev} {shortest(node)} {desc}\n' -r 2:: | |
124 | @ 4 08d9 five |
|
124 | @ 4 08d9 five | |
125 | | |
|
125 | | | |
126 | o 3 c8e6 four |
|
126 | o 3 c8e6 four | |
127 | | |
|
127 | | | |
128 | o 2 eb57 three |
|
128 | o 2 eb57 three | |
129 | | |
|
129 | | | |
130 | ~ |
|
130 | ~ | |
131 | $ HGEDITOR=cat hg histedit -r 4 --commands - << EOF |
|
131 | $ HGEDITOR=cat hg histedit -r 4 --commands - << EOF | |
132 | > edit 08d98a8350f3 4 five |
|
132 | > edit 08d98a8350f3 4 five | |
133 | > EOF |
|
133 | > EOF | |
134 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
134 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
135 | reverting alpha |
|
135 | reverting alpha | |
136 | Editing (08d98a8350f3), you may commit or record as needed now. |
|
136 | Editing (08d98a8350f3), you may commit or record as needed now. | |
137 | (hg histedit --continue to resume) |
|
137 | (hg histedit --continue to resume) | |
138 | [1] |
|
138 | [1] | |
139 |
|
139 | |||
140 | $ hg graft --continue |
|
140 | $ hg graft --continue | |
141 | abort: no graft in progress |
|
141 | abort: no graft in progress | |
142 | (continue: hg histedit --continue) |
|
142 | (continue: hg histedit --continue) | |
143 | [255] |
|
143 | [255] | |
144 |
|
144 | |||
145 | $ mv .hg/histedit-state .hg/histedit-state.back |
|
145 | $ mv .hg/histedit-state .hg/histedit-state.back | |
146 | $ hg update --quiet --clean 2 |
|
146 | $ hg update --quiet --clean 2 | |
147 | $ echo alpha >> alpha |
|
147 | $ echo alpha >> alpha | |
148 | $ mv .hg/histedit-state.back .hg/histedit-state |
|
148 | $ mv .hg/histedit-state.back .hg/histedit-state | |
149 |
|
149 | |||
150 | $ hg histedit --continue |
|
150 | $ hg histedit --continue | |
151 | saved backup bundle to $TESTTMP/foo/.hg/strip-backup/08d98a8350f3-02594089-histedit.hg (glob) |
|
151 | saved backup bundle to $TESTTMP/foo/.hg/strip-backup/08d98a8350f3-02594089-histedit.hg (glob) | |
152 | $ hg log -G -T '{rev} {shortest(node)} {desc}\n' -r 2:: |
|
152 | $ hg log -G -T '{rev} {shortest(node)} {desc}\n' -r 2:: | |
153 | @ 4 f5ed five |
|
153 | @ 4 f5ed five | |
154 | | |
|
154 | | | |
155 | | o 3 c8e6 four |
|
155 | | o 3 c8e6 four | |
156 | |/ |
|
156 | |/ | |
157 | o 2 eb57 three |
|
157 | o 2 eb57 three | |
158 | | |
|
158 | | | |
159 | ~ |
|
159 | ~ | |
160 |
|
160 | |||
161 | $ hg unbundle -q $TESTTMP/foo/.hg/strip-backup/08d98a8350f3-02594089-histedit.hg |
|
161 | $ hg unbundle -q $TESTTMP/foo/.hg/strip-backup/08d98a8350f3-02594089-histedit.hg | |
162 | $ hg strip -q -r f5ed --config extensions.strip= |
|
162 | $ hg strip -q -r f5ed --config extensions.strip= | |
163 | $ hg up -q 08d98a8350f3 |
|
163 | $ hg up -q 08d98a8350f3 | |
164 |
|
164 | |||
165 | Test that missing revisions are detected |
|
165 | Test that missing revisions are detected | |
166 | --------------------------------------- |
|
166 | --------------------------------------- | |
167 |
|
167 | |||
168 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF |
|
168 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF | |
169 | > pick eb57da33312f 2 three |
|
169 | > pick eb57da33312f 2 three | |
170 | > pick 08d98a8350f3 4 five |
|
170 | > pick 08d98a8350f3 4 five | |
171 | > EOF |
|
171 | > EOF | |
172 | hg: parse error: missing rules for changeset c8e68270e35a |
|
172 | hg: parse error: missing rules for changeset c8e68270e35a | |
173 | (use "drop c8e68270e35a" to discard, see also: 'hg help -e histedit.config') |
|
173 | (use "drop c8e68270e35a" to discard, see also: 'hg help -e histedit.config') | |
174 | [255] |
|
174 | [255] | |
175 |
|
175 | |||
176 | Test that extra revisions are detected |
|
176 | Test that extra revisions are detected | |
177 | --------------------------------------- |
|
177 | --------------------------------------- | |
178 |
|
178 | |||
179 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF |
|
179 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF | |
180 | > pick 6058cbb6cfd7 0 one |
|
180 | > pick 6058cbb6cfd7 0 one | |
181 | > pick c8e68270e35a 3 four |
|
181 | > pick c8e68270e35a 3 four | |
182 | > pick 08d98a8350f3 4 five |
|
182 | > pick 08d98a8350f3 4 five | |
183 | > EOF |
|
183 | > EOF | |
184 | hg: parse error: pick "6058cbb6cfd7" changeset was not a candidate |
|
184 | hg: parse error: pick "6058cbb6cfd7" changeset was not a candidate | |
185 | (only use listed changesets) |
|
185 | (only use listed changesets) | |
186 | [255] |
|
186 | [255] | |
187 |
|
187 | |||
188 | Test malformed line |
|
188 | Test malformed line | |
189 | --------------------------------------- |
|
189 | --------------------------------------- | |
190 |
|
190 | |||
191 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF |
|
191 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF | |
192 | > pickeb57da33312f2three |
|
192 | > pickeb57da33312f2three | |
193 | > pick c8e68270e35a 3 four |
|
193 | > pick c8e68270e35a 3 four | |
194 | > pick 08d98a8350f3 4 five |
|
194 | > pick 08d98a8350f3 4 five | |
195 | > EOF |
|
195 | > EOF | |
196 | hg: parse error: malformed line "pickeb57da33312f2three" |
|
196 | hg: parse error: malformed line "pickeb57da33312f2three" | |
197 | [255] |
|
197 | [255] | |
198 |
|
198 | |||
199 | Test unknown changeset |
|
199 | Test unknown changeset | |
200 | --------------------------------------- |
|
200 | --------------------------------------- | |
201 |
|
201 | |||
202 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF |
|
202 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF | |
203 | > pick 0123456789ab 2 three |
|
203 | > pick 0123456789ab 2 three | |
204 | > pick c8e68270e35a 3 four |
|
204 | > pick c8e68270e35a 3 four | |
205 | > pick 08d98a8350f3 4 five |
|
205 | > pick 08d98a8350f3 4 five | |
206 | > EOF |
|
206 | > EOF | |
207 | hg: parse error: unknown changeset 0123456789ab listed |
|
207 | hg: parse error: unknown changeset 0123456789ab listed | |
208 | [255] |
|
208 | [255] | |
209 |
|
209 | |||
210 | Test unknown command |
|
210 | Test unknown command | |
211 | --------------------------------------- |
|
211 | --------------------------------------- | |
212 |
|
212 | |||
213 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF |
|
213 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF | |
214 | > coin eb57da33312f 2 three |
|
214 | > coin eb57da33312f 2 three | |
215 | > pick c8e68270e35a 3 four |
|
215 | > pick c8e68270e35a 3 four | |
216 | > pick 08d98a8350f3 4 five |
|
216 | > pick 08d98a8350f3 4 five | |
217 | > EOF |
|
217 | > EOF | |
218 | hg: parse error: unknown action "coin" |
|
218 | hg: parse error: unknown action "coin" | |
219 | [255] |
|
219 | [255] | |
220 |
|
220 | |||
221 | Test duplicated changeset |
|
221 | Test duplicated changeset | |
222 | --------------------------------------- |
|
222 | --------------------------------------- | |
223 |
|
223 | |||
224 | So one is missing and one appear twice. |
|
224 | So one is missing and one appear twice. | |
225 |
|
225 | |||
226 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF |
|
226 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF | |
227 | > pick eb57da33312f 2 three |
|
227 | > pick eb57da33312f 2 three | |
228 | > pick eb57da33312f 2 three |
|
228 | > pick eb57da33312f 2 three | |
229 | > pick 08d98a8350f3 4 five |
|
229 | > pick 08d98a8350f3 4 five | |
230 | > EOF |
|
230 | > EOF | |
231 | hg: parse error: duplicated command for changeset eb57da33312f |
|
231 | hg: parse error: duplicated command for changeset eb57da33312f | |
232 | [255] |
|
232 | [255] | |
233 |
|
233 | |||
234 | Test bogus rev |
|
234 | Test bogus rev | |
235 | --------------------------------------- |
|
235 | --------------------------------------- | |
236 |
|
236 | |||
237 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF |
|
237 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF | |
238 | > pick eb57da33312f 2 three |
|
238 | > pick eb57da33312f 2 three | |
239 | > pick 0 |
|
239 | > pick 0 | |
240 | > pick 08d98a8350f3 4 five |
|
240 | > pick 08d98a8350f3 4 five | |
241 | > EOF |
|
241 | > EOF | |
242 | hg: parse error: invalid changeset 0 |
|
242 | hg: parse error: invalid changeset 0 | |
243 | [255] |
|
243 | [255] | |
244 |
|
244 | |||
245 | Test short version of command |
|
245 | Test short version of command | |
246 | --------------------------------------- |
|
246 | --------------------------------------- | |
247 |
|
247 | |||
248 | Note: we use varying amounts of white space between command name and changeset |
|
248 | Note: we use varying amounts of white space between command name and changeset | |
249 | short hash. This tests issue3893. |
|
249 | short hash. This tests issue3893. | |
250 |
|
250 | |||
251 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF |
|
251 | $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF | |
252 | > pick eb57da33312f 2 three |
|
252 | > pick eb57da33312f 2 three | |
253 | > p c8e68270e35a 3 four |
|
253 | > p c8e68270e35a 3 four | |
254 | > f 08d98a8350f3 4 five |
|
254 | > f 08d98a8350f3 4 five | |
255 | > EOF |
|
255 | > EOF | |
256 | four |
|
256 | four | |
257 | *** |
|
257 | *** | |
258 | five |
|
258 | five | |
259 |
|
259 | |||
260 |
|
260 | |||
261 |
|
261 | |||
262 | HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
262 | HG: Enter commit message. Lines beginning with 'HG:' are removed. | |
263 | HG: Leave message empty to abort commit. |
|
263 | HG: Leave message empty to abort commit. | |
264 | HG: -- |
|
264 | HG: -- | |
265 | HG: user: test |
|
265 | HG: user: test | |
266 | HG: branch 'default' |
|
266 | HG: branch 'default' | |
267 | HG: changed alpha |
|
267 | HG: changed alpha | |
268 | saved backup bundle to $TESTTMP/foo/.hg/strip-backup/c8e68270e35a-63d8b8d8-histedit.hg (glob) |
|
268 | saved backup bundle to $TESTTMP/foo/.hg/strip-backup/c8e68270e35a-63d8b8d8-histedit.hg (glob) | |
269 |
|
269 | |||
270 | $ hg update -q 2 |
|
270 | $ hg update -q 2 | |
271 | $ echo x > x |
|
271 | $ echo x > x | |
272 | $ hg add x |
|
272 | $ hg add x | |
273 | $ hg commit -m'x' x |
|
273 | $ hg commit -m'x' x | |
274 | created new head |
|
274 | created new head | |
275 | $ hg histedit -r 'heads(all())' |
|
275 | $ hg histedit -r 'heads(all())' | |
276 | abort: The specified revisions must have exactly one common root |
|
276 | abort: The specified revisions must have exactly one common root | |
277 | [255] |
|
277 | [255] | |
278 |
|
278 | |||
279 | Test that trimming description using multi-byte characters |
|
279 | Test that trimming description using multi-byte characters | |
280 | -------------------------------------------------------------------- |
|
280 | -------------------------------------------------------------------- | |
281 |
|
281 | |||
282 | $ $PYTHON <<EOF |
|
282 | $ $PYTHON <<EOF | |
283 | > fp = open('logfile', 'w') |
|
283 | > fp = open('logfile', 'w') | |
284 | > fp.write('12345678901234567890123456789012345678901234567890' + |
|
284 | > fp.write('12345678901234567890123456789012345678901234567890' + | |
285 | > '12345') # there are 5 more columns for 80 columns |
|
285 | > '12345') # there are 5 more columns for 80 columns | |
286 | > |
|
286 | > | |
287 | > # 2 x 4 = 8 columns, but 3 x 4 = 12 bytes |
|
287 | > # 2 x 4 = 8 columns, but 3 x 4 = 12 bytes | |
288 | > fp.write(u'\u3042\u3044\u3046\u3048'.encode('utf-8')) |
|
288 | > fp.write(u'\u3042\u3044\u3046\u3048'.encode('utf-8')) | |
289 | > |
|
289 | > | |
290 | > fp.close() |
|
290 | > fp.close() | |
291 | > EOF |
|
291 | > EOF | |
292 | $ echo xx >> x |
|
292 | $ echo xx >> x | |
293 | $ hg --encoding utf-8 commit --logfile logfile |
|
293 | $ hg --encoding utf-8 commit --logfile logfile | |
294 |
|
294 | |||
295 | $ HGEDITOR=cat hg --encoding utf-8 histedit tip |
|
295 | $ HGEDITOR=cat hg --encoding utf-8 histedit tip | |
296 | pick 3d3ea1f3a10b 5 1234567890123456789012345678901234567890123456789012345\xe3\x81\x82... (esc) |
|
296 | pick 3d3ea1f3a10b 5 1234567890123456789012345678901234567890123456789012345\xe3\x81\x82... (esc) | |
297 |
|
297 | |||
298 | # Edit history between 3d3ea1f3a10b and 3d3ea1f3a10b |
|
298 | # Edit history between 3d3ea1f3a10b and 3d3ea1f3a10b | |
299 | # |
|
299 | # | |
300 | # Commits are listed from least to most recent |
|
300 | # Commits are listed from least to most recent | |
301 | # |
|
301 | # | |
302 | # You can reorder changesets by reordering the lines |
|
302 | # You can reorder changesets by reordering the lines | |
303 | # |
|
303 | # | |
304 | # Commands: |
|
304 | # Commands: | |
305 | # |
|
305 | # | |
306 | # e, edit = use commit, but stop for amending |
|
306 | # e, edit = use commit, but stop for amending | |
307 | # m, mess = edit commit message without changing commit content |
|
307 | # m, mess = edit commit message without changing commit content | |
308 | # p, pick = use commit |
|
308 | # p, pick = use commit | |
309 | # b, base = checkout changeset and apply further changesets from there |
|
309 | # b, base = checkout changeset and apply further changesets from there | |
310 | # d, drop = remove commit from history |
|
310 | # d, drop = remove commit from history | |
311 | # f, fold = use commit, but combine it with the one above |
|
311 | # f, fold = use commit, but combine it with the one above | |
312 | # r, roll = like fold, but discard this commit's description and date |
|
312 | # r, roll = like fold, but discard this commit's description and date | |
313 | # |
|
313 | # | |
314 |
|
314 | |||
315 | Test --continue with --keep |
|
315 | Test --continue with --keep | |
316 |
|
316 | |||
317 | $ hg strip -q -r . --config extensions.strip= |
|
317 | $ hg strip -q -r . --config extensions.strip= | |
318 | $ hg histedit '.^' -q --keep --commands - << EOF |
|
318 | $ hg histedit '.^' -q --keep --commands - << EOF | |
319 | > edit eb57da33312f 2 three |
|
319 | > edit eb57da33312f 2 three | |
320 | > pick f3cfcca30c44 4 x |
|
320 | > pick f3cfcca30c44 4 x | |
321 | > EOF |
|
321 | > EOF | |
322 | Editing (eb57da33312f), you may commit or record as needed now. |
|
322 | Editing (eb57da33312f), you may commit or record as needed now. | |
323 | (hg histedit --continue to resume) |
|
323 | (hg histedit --continue to resume) | |
324 | [1] |
|
324 | [1] | |
325 | $ echo edit >> alpha |
|
325 | $ echo edit >> alpha | |
326 | $ hg histedit -q --continue |
|
326 | $ hg histedit -q --continue | |
327 | $ hg log -G -T '{rev}:{node|short} {desc}' |
|
327 | $ hg log -G -T '{rev}:{node|short} {desc}' | |
328 | @ 6:8fda0c726bf2 x |
|
328 | @ 6:8fda0c726bf2 x | |
329 | | |
|
329 | | | |
330 | o 5:63379946892c three |
|
330 | o 5:63379946892c three | |
331 | | |
|
331 | | | |
332 | | o 4:f3cfcca30c44 x |
|
332 | | o 4:f3cfcca30c44 x | |
333 | | | |
|
333 | | | | |
334 | | | o 3:2a30f3cfee78 four |
|
334 | | | o 3:2a30f3cfee78 four | |
335 | | |/ *** |
|
335 | | |/ *** | |
336 | | | five |
|
336 | | | five | |
337 | | o 2:eb57da33312f three |
|
337 | | o 2:eb57da33312f three | |
338 | |/ |
|
338 | |/ | |
339 | o 1:579e40513370 two |
|
339 | o 1:579e40513370 two | |
340 | | |
|
340 | | | |
341 | o 0:6058cbb6cfd7 one |
|
341 | o 0:6058cbb6cfd7 one | |
342 |
|
342 | |||
343 |
|
343 | |||
344 | Test that abort fails gracefully on exception |
|
344 | Test that abort fails gracefully on exception | |
345 | ---------------------------------------------- |
|
345 | ---------------------------------------------- | |
346 | $ hg histedit . -q --commands - << EOF |
|
346 | $ hg histedit . -q --commands - << EOF | |
347 | > edit 8fda0c726bf2 6 x |
|
347 | > edit 8fda0c726bf2 6 x | |
348 | > EOF |
|
348 | > EOF | |
349 | Editing (8fda0c726bf2), you may commit or record as needed now. |
|
349 | Editing (8fda0c726bf2), you may commit or record as needed now. | |
350 | (hg histedit --continue to resume) |
|
350 | (hg histedit --continue to resume) | |
351 | [1] |
|
351 | [1] | |
352 | Corrupt histedit state file |
|
352 | Corrupt histedit state file | |
353 | $ sed 's/8fda0c726bf2/123456789012/' .hg/histedit-state > ../corrupt-histedit |
|
353 | $ sed 's/8fda0c726bf2/123456789012/' .hg/histedit-state > ../corrupt-histedit | |
354 | $ mv ../corrupt-histedit .hg/histedit-state |
|
354 | $ mv ../corrupt-histedit .hg/histedit-state | |
355 | $ hg histedit --abort |
|
355 | $ hg histedit --abort | |
356 | warning: encountered an exception during histedit --abort; the repository may not have been completely cleaned up |
|
356 | warning: encountered an exception during histedit --abort; the repository may not have been completely cleaned up | |
357 | abort: .*(No such file or directory:|The system cannot find the file specified).* (re) |
|
357 | abort: .*(No such file or directory:|The system cannot find the file specified).* (re) | |
358 | [255] |
|
358 | [255] | |
359 | Histedit state has been exited |
|
359 | Histedit state has been exited | |
360 | $ hg summary -q |
|
360 | $ hg summary -q | |
361 | parent: 5:63379946892c |
|
361 | parent: 5:63379946892c | |
362 | commit: 1 added, 1 unknown (new branch head) |
|
362 | commit: 1 added, 1 unknown (new branch head) | |
363 | update: 4 new changesets (update) |
|
363 | update: 4 new changesets (update) | |
364 |
|
364 | |||
365 | $ cd .. |
|
365 | $ cd .. | |
366 |
|
366 | |||
367 | Set up default base revision tests |
|
367 | Set up default base revision tests | |
368 |
|
368 | |||
369 | $ hg init defaultbase |
|
369 | $ hg init defaultbase | |
370 | $ cd defaultbase |
|
370 | $ cd defaultbase | |
371 | $ touch foo |
|
371 | $ touch foo | |
372 | $ hg -q commit -A -m root |
|
372 | $ hg -q commit -A -m root | |
373 | $ echo 1 > foo |
|
373 | $ echo 1 > foo | |
374 | $ hg commit -m 'public 1' |
|
374 | $ hg commit -m 'public 1' | |
375 | $ hg phase --force --public -r . |
|
375 | $ hg phase --force --public -r . | |
376 | $ echo 2 > foo |
|
376 | $ echo 2 > foo | |
377 | $ hg commit -m 'draft after public' |
|
377 | $ hg commit -m 'draft after public' | |
378 | $ hg -q up -r 1 |
|
378 | $ hg -q up -r 1 | |
379 | $ echo 3 > foo |
|
379 | $ echo 3 > foo | |
380 | $ hg commit -m 'head 1 public' |
|
380 | $ hg commit -m 'head 1 public' | |
381 | created new head |
|
381 | created new head | |
382 | $ hg phase --force --public -r . |
|
382 | $ hg phase --force --public -r . | |
383 | $ echo 4 > foo |
|
383 | $ echo 4 > foo | |
384 | $ hg commit -m 'head 1 draft 1' |
|
384 | $ hg commit -m 'head 1 draft 1' | |
385 | $ echo 5 > foo |
|
385 | $ echo 5 > foo | |
386 | $ hg commit -m 'head 1 draft 2' |
|
386 | $ hg commit -m 'head 1 draft 2' | |
387 | $ hg -q up -r 2 |
|
387 | $ hg -q up -r 2 | |
388 | $ echo 6 > foo |
|
388 | $ echo 6 > foo | |
389 | $ hg commit -m 'head 2 commit 1' |
|
389 | $ hg commit -m 'head 2 commit 1' | |
390 | $ echo 7 > foo |
|
390 | $ echo 7 > foo | |
391 | $ hg commit -m 'head 2 commit 2' |
|
391 | $ hg commit -m 'head 2 commit 2' | |
392 | $ hg -q up -r 2 |
|
392 | $ hg -q up -r 2 | |
393 | $ echo 8 > foo |
|
393 | $ echo 8 > foo | |
394 | $ hg commit -m 'head 3' |
|
394 | $ hg commit -m 'head 3' | |
395 | created new head |
|
395 | created new head | |
396 | $ hg -q up -r 2 |
|
396 | $ hg -q up -r 2 | |
397 | $ echo 9 > foo |
|
397 | $ echo 9 > foo | |
398 | $ hg commit -m 'head 4' |
|
398 | $ hg commit -m 'head 4' | |
399 | created new head |
|
399 | created new head | |
400 | $ hg merge --tool :local -r 8 |
|
400 | $ hg merge --tool :local -r 8 | |
401 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
401 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
402 | (branch merge, don't forget to commit) |
|
402 | (branch merge, don't forget to commit) | |
403 | $ hg commit -m 'merge head 3 into head 4' |
|
403 | $ hg commit -m 'merge head 3 into head 4' | |
404 | $ echo 11 > foo |
|
404 | $ echo 11 > foo | |
405 | $ hg commit -m 'commit 1 after merge' |
|
405 | $ hg commit -m 'commit 1 after merge' | |
406 | $ echo 12 > foo |
|
406 | $ echo 12 > foo | |
407 | $ hg commit -m 'commit 2 after merge' |
|
407 | $ hg commit -m 'commit 2 after merge' | |
408 |
|
408 | |||
409 | $ hg log -G -T '{rev}:{node|short} {phase} {desc}\n' |
|
409 | $ hg log -G -T '{rev}:{node|short} {phase} {desc}\n' | |
410 | @ 12:8cde254db839 draft commit 2 after merge |
|
410 | @ 12:8cde254db839 draft commit 2 after merge | |
411 | | |
|
411 | | | |
412 | o 11:6f2f0241f119 draft commit 1 after merge |
|
412 | o 11:6f2f0241f119 draft commit 1 after merge | |
413 | | |
|
413 | | | |
414 | o 10:90506cc76b00 draft merge head 3 into head 4 |
|
414 | o 10:90506cc76b00 draft merge head 3 into head 4 | |
415 | |\ |
|
415 | |\ | |
416 | | o 9:f8607a373a97 draft head 4 |
|
416 | | o 9:f8607a373a97 draft head 4 | |
417 | | | |
|
417 | | | | |
418 | o | 8:0da92be05148 draft head 3 |
|
418 | o | 8:0da92be05148 draft head 3 | |
419 | |/ |
|
419 | |/ | |
420 | | o 7:4c35cdf97d5e draft head 2 commit 2 |
|
420 | | o 7:4c35cdf97d5e draft head 2 commit 2 | |
421 | | | |
|
421 | | | | |
422 | | o 6:931820154288 draft head 2 commit 1 |
|
422 | | o 6:931820154288 draft head 2 commit 1 | |
423 | |/ |
|
423 | |/ | |
424 | | o 5:8cdc02b9bc63 draft head 1 draft 2 |
|
424 | | o 5:8cdc02b9bc63 draft head 1 draft 2 | |
425 | | | |
|
425 | | | | |
426 | | o 4:463b8c0d2973 draft head 1 draft 1 |
|
426 | | o 4:463b8c0d2973 draft head 1 draft 1 | |
427 | | | |
|
427 | | | | |
428 | | o 3:23a0c4eefcbf public head 1 public |
|
428 | | o 3:23a0c4eefcbf public head 1 public | |
429 | | | |
|
429 | | | | |
430 | o | 2:4117331c3abb draft draft after public |
|
430 | o | 2:4117331c3abb draft draft after public | |
431 | |/ |
|
431 | |/ | |
432 | o 1:4426d359ea59 public public 1 |
|
432 | o 1:4426d359ea59 public public 1 | |
433 | | |
|
433 | | | |
434 | o 0:54136a8ddf32 public root |
|
434 | o 0:54136a8ddf32 public root | |
435 |
|
435 | |||
436 |
|
436 | |||
437 | Default base revision should stop at public changesets |
|
437 | Default base revision should stop at public changesets | |
438 |
|
438 | |||
439 | $ hg -q up 8cdc02b9bc63 |
|
439 | $ hg -q up 8cdc02b9bc63 | |
440 | $ hg histedit --commands - <<EOF |
|
440 | $ hg histedit --commands - <<EOF | |
441 | > pick 463b8c0d2973 |
|
441 | > pick 463b8c0d2973 | |
442 | > pick 8cdc02b9bc63 |
|
442 | > pick 8cdc02b9bc63 | |
443 | > EOF |
|
443 | > EOF | |
444 |
|
444 | |||
445 | Default base revision should stop at branchpoint |
|
445 | Default base revision should stop at branchpoint | |
446 |
|
446 | |||
447 | $ hg -q up 4c35cdf97d5e |
|
447 | $ hg -q up 4c35cdf97d5e | |
448 | $ hg histedit --commands - <<EOF |
|
448 | $ hg histedit --commands - <<EOF | |
449 | > pick 931820154288 |
|
449 | > pick 931820154288 | |
450 | > pick 4c35cdf97d5e |
|
450 | > pick 4c35cdf97d5e | |
451 | > EOF |
|
451 | > EOF | |
452 |
|
452 | |||
453 | Default base revision should stop at merge commit |
|
453 | Default base revision should stop at merge commit | |
454 |
|
454 | |||
455 | $ hg -q up 8cde254db839 |
|
455 | $ hg -q up 8cde254db839 | |
456 | $ hg histedit --commands - <<EOF |
|
456 | $ hg histedit --commands - <<EOF | |
457 | > pick 6f2f0241f119 |
|
457 | > pick 6f2f0241f119 | |
458 | > pick 8cde254db839 |
|
458 | > pick 8cde254db839 | |
459 | > EOF |
|
459 | > EOF | |
460 |
|
460 | |||
461 | commit --amend should abort if histedit is in progress |
|
461 | commit --amend should abort if histedit is in progress | |
462 | (issue4800) and markers are not being created. |
|
462 | (issue4800) and markers are not being created. | |
463 | Eventually, histedit could perhaps look at `source` extra, |
|
463 | Eventually, histedit could perhaps look at `source` extra, | |
464 | in which case this test should be revisited. |
|
464 | in which case this test should be revisited. | |
465 |
|
465 | |||
466 | $ hg -q up 8cde254db839 |
|
466 | $ hg -q up 8cde254db839 | |
467 | $ hg histedit 6f2f0241f119 --commands - <<EOF |
|
467 | $ hg histedit 6f2f0241f119 --commands - <<EOF | |
468 | > pick 8cde254db839 |
|
468 | > pick 8cde254db839 | |
469 | > edit 6f2f0241f119 |
|
469 | > edit 6f2f0241f119 | |
470 | > EOF |
|
470 | > EOF | |
471 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
471 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
472 | merging foo |
|
472 | merging foo | |
473 | warning: conflicts while merging foo! (edit, then use 'hg resolve --mark') |
|
473 | warning: conflicts while merging foo! (edit, then use 'hg resolve --mark') | |
474 | Fix up the change (pick 8cde254db839) |
|
474 | Fix up the change (pick 8cde254db839) | |
475 | (hg histedit --continue to resume) |
|
475 | (hg histedit --continue to resume) | |
476 | [1] |
|
476 | [1] | |
477 | $ hg resolve -m --all |
|
477 | $ hg resolve -m --all | |
478 | (no more unresolved files) |
|
478 | (no more unresolved files) | |
479 | continue: hg histedit --continue |
|
479 | continue: hg histedit --continue | |
480 | $ hg histedit --cont |
|
480 | $ hg histedit --cont | |
481 | merging foo |
|
481 | merging foo | |
482 | warning: conflicts while merging foo! (edit, then use 'hg resolve --mark') |
|
482 | warning: conflicts while merging foo! (edit, then use 'hg resolve --mark') | |
483 | Editing (6f2f0241f119), you may commit or record as needed now. |
|
483 | Editing (6f2f0241f119), you may commit or record as needed now. | |
484 | (hg histedit --continue to resume) |
|
484 | (hg histedit --continue to resume) | |
485 | [1] |
|
485 | [1] | |
486 | $ hg resolve -m --all |
|
486 | $ hg resolve -m --all | |
487 | (no more unresolved files) |
|
487 | (no more unresolved files) | |
488 | continue: hg histedit --continue |
|
488 | continue: hg histedit --continue | |
489 | $ hg commit --amend -m 'reject this fold' |
|
489 | $ hg commit --amend -m 'reject this fold' | |
490 | abort: histedit in progress |
|
490 | abort: histedit in progress | |
491 | (use 'hg histedit --continue' or 'hg histedit --abort') |
|
491 | (use 'hg histedit --continue' or 'hg histedit --abort') | |
492 | [255] |
|
492 | [255] | |
493 |
|
493 | |||
494 | With markers enabled, histedit does not get confused, and |
|
494 | With markers enabled, histedit does not get confused, and | |
495 | amend should not be blocked by the ongoing histedit. |
|
495 | amend should not be blocked by the ongoing histedit. | |
496 |
|
496 | |||
497 | $ cat >>$HGRCPATH <<EOF |
|
497 | $ cat >>$HGRCPATH <<EOF | |
498 | > [experimental] |
|
498 | > [experimental] | |
499 | > evolution=allowunstable |
|
|||
500 | > evolution.createmarkers=True |
|
499 | > evolution.createmarkers=True | |
|
500 | > evolution.allowunstable=True | |||
501 | > EOF |
|
501 | > EOF | |
502 | $ hg commit --amend -m 'allow this fold' |
|
502 | $ hg commit --amend -m 'allow this fold' | |
503 | $ hg histedit --continue |
|
503 | $ hg histedit --continue | |
504 |
|
504 | |||
505 | $ cd .. |
|
505 | $ cd .. | |
506 |
|
506 | |||
507 | Test autoverb feature |
|
507 | Test autoverb feature | |
508 |
|
508 | |||
509 | $ hg init autoverb |
|
509 | $ hg init autoverb | |
510 | $ cd autoverb |
|
510 | $ cd autoverb | |
511 | $ echo alpha >> alpha |
|
511 | $ echo alpha >> alpha | |
512 | $ hg ci -qAm one |
|
512 | $ hg ci -qAm one | |
513 | $ echo alpha >> alpha |
|
513 | $ echo alpha >> alpha | |
514 | $ hg ci -qm two |
|
514 | $ hg ci -qm two | |
515 | $ echo beta >> beta |
|
515 | $ echo beta >> beta | |
516 | $ hg ci -qAm "roll! one" |
|
516 | $ hg ci -qAm "roll! one" | |
517 |
|
517 | |||
518 | $ hg log --style compact --graph |
|
518 | $ hg log --style compact --graph | |
519 | @ 2[tip] 4f34d0f8b5fa 1970-01-01 00:00 +0000 test |
|
519 | @ 2[tip] 4f34d0f8b5fa 1970-01-01 00:00 +0000 test | |
520 | | roll! one |
|
520 | | roll! one | |
521 | | |
|
521 | | | |
522 | o 1 579e40513370 1970-01-01 00:00 +0000 test |
|
522 | o 1 579e40513370 1970-01-01 00:00 +0000 test | |
523 | | two |
|
523 | | two | |
524 | | |
|
524 | | | |
525 | o 0 6058cbb6cfd7 1970-01-01 00:00 +0000 test |
|
525 | o 0 6058cbb6cfd7 1970-01-01 00:00 +0000 test | |
526 | one |
|
526 | one | |
527 |
|
527 | |||
528 |
|
528 | |||
529 | Check that 'roll' is selected by default |
|
529 | Check that 'roll' is selected by default | |
530 |
|
530 | |||
531 | $ HGEDITOR=cat hg histedit 0 --config experimental.histedit.autoverb=True |
|
531 | $ HGEDITOR=cat hg histedit 0 --config experimental.histedit.autoverb=True | |
532 | pick 6058cbb6cfd7 0 one |
|
532 | pick 6058cbb6cfd7 0 one | |
533 | roll 4f34d0f8b5fa 2 roll! one |
|
533 | roll 4f34d0f8b5fa 2 roll! one | |
534 | pick 579e40513370 1 two |
|
534 | pick 579e40513370 1 two | |
535 |
|
535 | |||
536 | # Edit history between 6058cbb6cfd7 and 4f34d0f8b5fa |
|
536 | # Edit history between 6058cbb6cfd7 and 4f34d0f8b5fa | |
537 | # |
|
537 | # | |
538 | # Commits are listed from least to most recent |
|
538 | # Commits are listed from least to most recent | |
539 | # |
|
539 | # | |
540 | # You can reorder changesets by reordering the lines |
|
540 | # You can reorder changesets by reordering the lines | |
541 | # |
|
541 | # | |
542 | # Commands: |
|
542 | # Commands: | |
543 | # |
|
543 | # | |
544 | # e, edit = use commit, but stop for amending |
|
544 | # e, edit = use commit, but stop for amending | |
545 | # m, mess = edit commit message without changing commit content |
|
545 | # m, mess = edit commit message without changing commit content | |
546 | # p, pick = use commit |
|
546 | # p, pick = use commit | |
547 | # b, base = checkout changeset and apply further changesets from there |
|
547 | # b, base = checkout changeset and apply further changesets from there | |
548 | # d, drop = remove commit from history |
|
548 | # d, drop = remove commit from history | |
549 | # f, fold = use commit, but combine it with the one above |
|
549 | # f, fold = use commit, but combine it with the one above | |
550 | # r, roll = like fold, but discard this commit's description and date |
|
550 | # r, roll = like fold, but discard this commit's description and date | |
551 | # |
|
551 | # | |
552 |
|
552 | |||
553 | $ cd .. |
|
553 | $ cd .. |
@@ -1,578 +1,578 b'' | |||||
1 | $ . "$TESTDIR/histedit-helpers.sh" |
|
1 | $ . "$TESTDIR/histedit-helpers.sh" | |
2 |
|
2 | |||
3 | Enable obsolete |
|
3 | Enable obsolete | |
4 |
|
4 | |||
5 | $ cat >> $HGRCPATH << EOF |
|
5 | $ cat >> $HGRCPATH << EOF | |
6 | > [ui] |
|
6 | > [ui] | |
7 | > logtemplate= {rev}:{node|short} {desc|firstline} |
|
7 | > logtemplate= {rev}:{node|short} {desc|firstline} | |
8 | > [phases] |
|
8 | > [phases] | |
9 | > publish=False |
|
9 | > publish=False | |
10 | > [experimental] |
|
10 | > [experimental] | |
11 | > evolution=allowunstable |
|
|||
12 | > evolution.createmarkers=True |
|
11 | > evolution.createmarkers=True | |
|
12 | > evolution.allowunstable=True | |||
13 | > [extensions] |
|
13 | > [extensions] | |
14 | > histedit= |
|
14 | > histedit= | |
15 | > rebase= |
|
15 | > rebase= | |
16 | > EOF |
|
16 | > EOF | |
17 |
|
17 | |||
18 | Test that histedit learns about obsolescence not stored in histedit state |
|
18 | Test that histedit learns about obsolescence not stored in histedit state | |
19 | $ hg init boo |
|
19 | $ hg init boo | |
20 | $ cd boo |
|
20 | $ cd boo | |
21 | $ echo a > a |
|
21 | $ echo a > a | |
22 | $ hg ci -Am a |
|
22 | $ hg ci -Am a | |
23 | adding a |
|
23 | adding a | |
24 | $ echo a > b |
|
24 | $ echo a > b | |
25 | $ echo a > c |
|
25 | $ echo a > c | |
26 | $ echo a > c |
|
26 | $ echo a > c | |
27 | $ hg ci -Am b |
|
27 | $ hg ci -Am b | |
28 | adding b |
|
28 | adding b | |
29 | adding c |
|
29 | adding c | |
30 | $ echo a > d |
|
30 | $ echo a > d | |
31 | $ hg ci -Am c |
|
31 | $ hg ci -Am c | |
32 | adding d |
|
32 | adding d | |
33 | $ echo "pick `hg log -r 0 -T '{node|short}'`" > plan |
|
33 | $ echo "pick `hg log -r 0 -T '{node|short}'`" > plan | |
34 | $ echo "pick `hg log -r 2 -T '{node|short}'`" >> plan |
|
34 | $ echo "pick `hg log -r 2 -T '{node|short}'`" >> plan | |
35 | $ echo "edit `hg log -r 1 -T '{node|short}'`" >> plan |
|
35 | $ echo "edit `hg log -r 1 -T '{node|short}'`" >> plan | |
36 | $ hg histedit -r 'all()' --commands plan |
|
36 | $ hg histedit -r 'all()' --commands plan | |
37 | Editing (1b2d564fad96), you may commit or record as needed now. |
|
37 | Editing (1b2d564fad96), you may commit or record as needed now. | |
38 | (hg histedit --continue to resume) |
|
38 | (hg histedit --continue to resume) | |
39 | [1] |
|
39 | [1] | |
40 | $ hg st |
|
40 | $ hg st | |
41 | A b |
|
41 | A b | |
42 | A c |
|
42 | A c | |
43 | ? plan |
|
43 | ? plan | |
44 | $ hg commit --amend b |
|
44 | $ hg commit --amend b | |
45 | $ hg histedit --continue |
|
45 | $ hg histedit --continue | |
46 | $ hg log -G |
|
46 | $ hg log -G | |
47 | @ 5:46abc7c4d873 b |
|
47 | @ 5:46abc7c4d873 b | |
48 | | |
|
48 | | | |
49 | o 4:49d44ab2be1b c |
|
49 | o 4:49d44ab2be1b c | |
50 | | |
|
50 | | | |
51 | o 0:cb9a9f314b8b a |
|
51 | o 0:cb9a9f314b8b a | |
52 |
|
52 | |||
53 | $ hg debugobsolete |
|
53 | $ hg debugobsolete | |
54 | e72d22b19f8ecf4150ab4f91d0973fd9955d3ddf 49d44ab2be1b67a79127568a67c9c99430633b48 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'} |
|
54 | e72d22b19f8ecf4150ab4f91d0973fd9955d3ddf 49d44ab2be1b67a79127568a67c9c99430633b48 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'} | |
55 | 1b2d564fad96311b45362f17c2aa855150efb35f 46abc7c4d8738e8563e577f7889e1b6db3da4199 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'histedit', 'user': 'test'} |
|
55 | 1b2d564fad96311b45362f17c2aa855150efb35f 46abc7c4d8738e8563e577f7889e1b6db3da4199 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'histedit', 'user': 'test'} | |
56 | 114f4176969ef342759a8a57e6bccefc4234829b 49d44ab2be1b67a79127568a67c9c99430633b48 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'histedit', 'user': 'test'} |
|
56 | 114f4176969ef342759a8a57e6bccefc4234829b 49d44ab2be1b67a79127568a67c9c99430633b48 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'histedit', 'user': 'test'} | |
57 |
|
57 | |||
58 | With some node gone missing during the edit. |
|
58 | With some node gone missing during the edit. | |
59 |
|
59 | |||
60 | $ echo "pick `hg log -r 0 -T '{node|short}'`" > plan |
|
60 | $ echo "pick `hg log -r 0 -T '{node|short}'`" > plan | |
61 | $ echo "pick `hg log -r 5 -T '{node|short}'`" >> plan |
|
61 | $ echo "pick `hg log -r 5 -T '{node|short}'`" >> plan | |
62 | $ echo "edit `hg log -r 4 -T '{node|short}'`" >> plan |
|
62 | $ echo "edit `hg log -r 4 -T '{node|short}'`" >> plan | |
63 | $ hg histedit -r 'all()' --commands plan |
|
63 | $ hg histedit -r 'all()' --commands plan | |
64 | Editing (49d44ab2be1b), you may commit or record as needed now. |
|
64 | Editing (49d44ab2be1b), you may commit or record as needed now. | |
65 | (hg histedit --continue to resume) |
|
65 | (hg histedit --continue to resume) | |
66 | [1] |
|
66 | [1] | |
67 | $ hg st |
|
67 | $ hg st | |
68 | A b |
|
68 | A b | |
69 | A d |
|
69 | A d | |
70 | ? plan |
|
70 | ? plan | |
71 | $ hg commit --amend -X . -m XXXXXX |
|
71 | $ hg commit --amend -X . -m XXXXXX | |
72 | $ hg commit --amend -X . -m b2 |
|
72 | $ hg commit --amend -X . -m b2 | |
73 | $ hg --hidden --config extensions.strip= strip 'desc(XXXXXX)' --no-backup |
|
73 | $ hg --hidden --config extensions.strip= strip 'desc(XXXXXX)' --no-backup | |
74 | $ hg histedit --continue |
|
74 | $ hg histedit --continue | |
75 | $ hg log -G |
|
75 | $ hg log -G | |
76 | @ 8:273c1f3b8626 c |
|
76 | @ 8:273c1f3b8626 c | |
77 | | |
|
77 | | | |
78 | o 7:aba7da937030 b2 |
|
78 | o 7:aba7da937030 b2 | |
79 | | |
|
79 | | | |
80 | o 0:cb9a9f314b8b a |
|
80 | o 0:cb9a9f314b8b a | |
81 |
|
81 | |||
82 | $ hg debugobsolete |
|
82 | $ hg debugobsolete | |
83 | e72d22b19f8ecf4150ab4f91d0973fd9955d3ddf 49d44ab2be1b67a79127568a67c9c99430633b48 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'} |
|
83 | e72d22b19f8ecf4150ab4f91d0973fd9955d3ddf 49d44ab2be1b67a79127568a67c9c99430633b48 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'} | |
84 | 1b2d564fad96311b45362f17c2aa855150efb35f 46abc7c4d8738e8563e577f7889e1b6db3da4199 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'histedit', 'user': 'test'} |
|
84 | 1b2d564fad96311b45362f17c2aa855150efb35f 46abc7c4d8738e8563e577f7889e1b6db3da4199 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'histedit', 'user': 'test'} | |
85 | 114f4176969ef342759a8a57e6bccefc4234829b 49d44ab2be1b67a79127568a67c9c99430633b48 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'histedit', 'user': 'test'} |
|
85 | 114f4176969ef342759a8a57e6bccefc4234829b 49d44ab2be1b67a79127568a67c9c99430633b48 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'histedit', 'user': 'test'} | |
86 | 76f72745eac0643d16530e56e2f86e36e40631f1 2ca853e48edbd6453a0674dc0fe28a0974c51b9c 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'} |
|
86 | 76f72745eac0643d16530e56e2f86e36e40631f1 2ca853e48edbd6453a0674dc0fe28a0974c51b9c 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'} | |
87 | 2ca853e48edbd6453a0674dc0fe28a0974c51b9c aba7da93703075eec9fb1dbaf143ff2bc1c49d46 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'} |
|
87 | 2ca853e48edbd6453a0674dc0fe28a0974c51b9c aba7da93703075eec9fb1dbaf143ff2bc1c49d46 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'} | |
88 | 49d44ab2be1b67a79127568a67c9c99430633b48 273c1f3b86267ed3ec684bb13af1fa4d6ba56e02 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'histedit', 'user': 'test'} |
|
88 | 49d44ab2be1b67a79127568a67c9c99430633b48 273c1f3b86267ed3ec684bb13af1fa4d6ba56e02 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'histedit', 'user': 'test'} | |
89 | 46abc7c4d8738e8563e577f7889e1b6db3da4199 aba7da93703075eec9fb1dbaf143ff2bc1c49d46 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'histedit', 'user': 'test'} |
|
89 | 46abc7c4d8738e8563e577f7889e1b6db3da4199 aba7da93703075eec9fb1dbaf143ff2bc1c49d46 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'histedit', 'user': 'test'} | |
90 | $ cd .. |
|
90 | $ cd .. | |
91 |
|
91 | |||
92 | Base setup for the rest of the testing |
|
92 | Base setup for the rest of the testing | |
93 | ====================================== |
|
93 | ====================================== | |
94 |
|
94 | |||
95 | $ hg init base |
|
95 | $ hg init base | |
96 | $ cd base |
|
96 | $ cd base | |
97 |
|
97 | |||
98 | $ for x in a b c d e f ; do |
|
98 | $ for x in a b c d e f ; do | |
99 | > echo $x > $x |
|
99 | > echo $x > $x | |
100 | > hg add $x |
|
100 | > hg add $x | |
101 | > hg ci -m $x |
|
101 | > hg ci -m $x | |
102 | > done |
|
102 | > done | |
103 |
|
103 | |||
104 | $ hg log --graph |
|
104 | $ hg log --graph | |
105 | @ 5:652413bf663e f |
|
105 | @ 5:652413bf663e f | |
106 | | |
|
106 | | | |
107 | o 4:e860deea161a e |
|
107 | o 4:e860deea161a e | |
108 | | |
|
108 | | | |
109 | o 3:055a42cdd887 d |
|
109 | o 3:055a42cdd887 d | |
110 | | |
|
110 | | | |
111 | o 2:177f92b77385 c |
|
111 | o 2:177f92b77385 c | |
112 | | |
|
112 | | | |
113 | o 1:d2ae7f538514 b |
|
113 | o 1:d2ae7f538514 b | |
114 | | |
|
114 | | | |
115 | o 0:cb9a9f314b8b a |
|
115 | o 0:cb9a9f314b8b a | |
116 |
|
116 | |||
117 |
|
117 | |||
118 | $ HGEDITOR=cat hg histedit 1 |
|
118 | $ HGEDITOR=cat hg histedit 1 | |
119 | pick d2ae7f538514 1 b |
|
119 | pick d2ae7f538514 1 b | |
120 | pick 177f92b77385 2 c |
|
120 | pick 177f92b77385 2 c | |
121 | pick 055a42cdd887 3 d |
|
121 | pick 055a42cdd887 3 d | |
122 | pick e860deea161a 4 e |
|
122 | pick e860deea161a 4 e | |
123 | pick 652413bf663e 5 f |
|
123 | pick 652413bf663e 5 f | |
124 |
|
124 | |||
125 | # Edit history between d2ae7f538514 and 652413bf663e |
|
125 | # Edit history between d2ae7f538514 and 652413bf663e | |
126 | # |
|
126 | # | |
127 | # Commits are listed from least to most recent |
|
127 | # Commits are listed from least to most recent | |
128 | # |
|
128 | # | |
129 | # You can reorder changesets by reordering the lines |
|
129 | # You can reorder changesets by reordering the lines | |
130 | # |
|
130 | # | |
131 | # Commands: |
|
131 | # Commands: | |
132 | # |
|
132 | # | |
133 | # e, edit = use commit, but stop for amending |
|
133 | # e, edit = use commit, but stop for amending | |
134 | # m, mess = edit commit message without changing commit content |
|
134 | # m, mess = edit commit message without changing commit content | |
135 | # p, pick = use commit |
|
135 | # p, pick = use commit | |
136 | # b, base = checkout changeset and apply further changesets from there |
|
136 | # b, base = checkout changeset and apply further changesets from there | |
137 | # d, drop = remove commit from history |
|
137 | # d, drop = remove commit from history | |
138 | # f, fold = use commit, but combine it with the one above |
|
138 | # f, fold = use commit, but combine it with the one above | |
139 | # r, roll = like fold, but discard this commit's description and date |
|
139 | # r, roll = like fold, but discard this commit's description and date | |
140 | # |
|
140 | # | |
141 | $ hg histedit 1 --commands - --verbose <<EOF | grep histedit |
|
141 | $ hg histedit 1 --commands - --verbose <<EOF | grep histedit | |
142 | > pick 177f92b77385 2 c |
|
142 | > pick 177f92b77385 2 c | |
143 | > drop d2ae7f538514 1 b |
|
143 | > drop d2ae7f538514 1 b | |
144 | > pick 055a42cdd887 3 d |
|
144 | > pick 055a42cdd887 3 d | |
145 | > fold e860deea161a 4 e |
|
145 | > fold e860deea161a 4 e | |
146 | > pick 652413bf663e 5 f |
|
146 | > pick 652413bf663e 5 f | |
147 | > EOF |
|
147 | > EOF | |
148 | [1] |
|
148 | [1] | |
149 | $ hg log --graph --hidden |
|
149 | $ hg log --graph --hidden | |
150 | @ 10:cacdfd884a93 f |
|
150 | @ 10:cacdfd884a93 f | |
151 | | |
|
151 | | | |
152 | o 9:59d9f330561f d |
|
152 | o 9:59d9f330561f d | |
153 | | |
|
153 | | | |
154 | | x 8:b558abc46d09 fold-temp-revision e860deea161a |
|
154 | | x 8:b558abc46d09 fold-temp-revision e860deea161a | |
155 | | | |
|
155 | | | | |
156 | | x 7:96e494a2d553 d |
|
156 | | x 7:96e494a2d553 d | |
157 | |/ |
|
157 | |/ | |
158 | o 6:b346ab9a313d c |
|
158 | o 6:b346ab9a313d c | |
159 | | |
|
159 | | | |
160 | | x 5:652413bf663e f |
|
160 | | x 5:652413bf663e f | |
161 | | | |
|
161 | | | | |
162 | | x 4:e860deea161a e |
|
162 | | x 4:e860deea161a e | |
163 | | | |
|
163 | | | | |
164 | | x 3:055a42cdd887 d |
|
164 | | x 3:055a42cdd887 d | |
165 | | | |
|
165 | | | | |
166 | | x 2:177f92b77385 c |
|
166 | | x 2:177f92b77385 c | |
167 | | | |
|
167 | | | | |
168 | | x 1:d2ae7f538514 b |
|
168 | | x 1:d2ae7f538514 b | |
169 | |/ |
|
169 | |/ | |
170 | o 0:cb9a9f314b8b a |
|
170 | o 0:cb9a9f314b8b a | |
171 |
|
171 | |||
172 | $ hg debugobsolete |
|
172 | $ hg debugobsolete | |
173 | d2ae7f538514cd87c17547b0de4cea71fe1af9fb 0 {cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b} (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'histedit', 'user': 'test'} |
|
173 | d2ae7f538514cd87c17547b0de4cea71fe1af9fb 0 {cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b} (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'histedit', 'user': 'test'} | |
174 | 177f92b773850b59254aa5e923436f921b55483b b346ab9a313db8537ecf96fca3ca3ca984ef3bd7 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'histedit', 'user': 'test'} |
|
174 | 177f92b773850b59254aa5e923436f921b55483b b346ab9a313db8537ecf96fca3ca3ca984ef3bd7 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'histedit', 'user': 'test'} | |
175 | 055a42cdd88768532f9cf79daa407fc8d138de9b 59d9f330561fd6c88b1a6b32f0e45034d88db784 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'histedit', 'user': 'test'} |
|
175 | 055a42cdd88768532f9cf79daa407fc8d138de9b 59d9f330561fd6c88b1a6b32f0e45034d88db784 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'histedit', 'user': 'test'} | |
176 | e860deea161a2f77de56603b340ebbb4536308ae 59d9f330561fd6c88b1a6b32f0e45034d88db784 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'histedit', 'user': 'test'} |
|
176 | e860deea161a2f77de56603b340ebbb4536308ae 59d9f330561fd6c88b1a6b32f0e45034d88db784 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'histedit', 'user': 'test'} | |
177 | 652413bf663ef2a641cab26574e46d5f5a64a55a cacdfd884a9321ec4e1de275ef3949fa953a1f83 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'histedit', 'user': 'test'} |
|
177 | 652413bf663ef2a641cab26574e46d5f5a64a55a cacdfd884a9321ec4e1de275ef3949fa953a1f83 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'histedit', 'user': 'test'} | |
178 | 96e494a2d553dd05902ba1cee1d94d4cb7b8faed 0 {b346ab9a313db8537ecf96fca3ca3ca984ef3bd7} (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'histedit', 'user': 'test'} |
|
178 | 96e494a2d553dd05902ba1cee1d94d4cb7b8faed 0 {b346ab9a313db8537ecf96fca3ca3ca984ef3bd7} (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'histedit', 'user': 'test'} | |
179 | b558abc46d09c30f57ac31e85a8a3d64d2e906e4 0 {96e494a2d553dd05902ba1cee1d94d4cb7b8faed} (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'histedit', 'user': 'test'} |
|
179 | b558abc46d09c30f57ac31e85a8a3d64d2e906e4 0 {96e494a2d553dd05902ba1cee1d94d4cb7b8faed} (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'histedit', 'user': 'test'} | |
180 |
|
180 | |||
181 |
|
181 | |||
182 | Ensure hidden revision does not prevent histedit |
|
182 | Ensure hidden revision does not prevent histedit | |
183 | ------------------------------------------------- |
|
183 | ------------------------------------------------- | |
184 |
|
184 | |||
185 | create an hidden revision |
|
185 | create an hidden revision | |
186 |
|
186 | |||
187 | $ hg histedit 6 --commands - << EOF |
|
187 | $ hg histedit 6 --commands - << EOF | |
188 | > pick b346ab9a313d 6 c |
|
188 | > pick b346ab9a313d 6 c | |
189 | > drop 59d9f330561f 7 d |
|
189 | > drop 59d9f330561f 7 d | |
190 | > pick cacdfd884a93 8 f |
|
190 | > pick cacdfd884a93 8 f | |
191 | > EOF |
|
191 | > EOF | |
192 | $ hg log --graph |
|
192 | $ hg log --graph | |
193 | @ 11:c13eb81022ca f |
|
193 | @ 11:c13eb81022ca f | |
194 | | |
|
194 | | | |
195 | o 6:b346ab9a313d c |
|
195 | o 6:b346ab9a313d c | |
196 | | |
|
196 | | | |
197 | o 0:cb9a9f314b8b a |
|
197 | o 0:cb9a9f314b8b a | |
198 |
|
198 | |||
199 | check hidden revision are ignored (6 have hidden children 7 and 8) |
|
199 | check hidden revision are ignored (6 have hidden children 7 and 8) | |
200 |
|
200 | |||
201 | $ hg histedit 6 --commands - << EOF |
|
201 | $ hg histedit 6 --commands - << EOF | |
202 | > pick b346ab9a313d 6 c |
|
202 | > pick b346ab9a313d 6 c | |
203 | > pick c13eb81022ca 8 f |
|
203 | > pick c13eb81022ca 8 f | |
204 | > EOF |
|
204 | > EOF | |
205 |
|
205 | |||
206 |
|
206 | |||
207 |
|
207 | |||
208 | Test that rewriting leaving instability behind is allowed |
|
208 | Test that rewriting leaving instability behind is allowed | |
209 | --------------------------------------------------------------------- |
|
209 | --------------------------------------------------------------------- | |
210 |
|
210 | |||
211 | $ hg up '.^' |
|
211 | $ hg up '.^' | |
212 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
212 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
213 | $ hg log -r 'children(.)' |
|
213 | $ hg log -r 'children(.)' | |
214 | 11:c13eb81022ca f (no-eol) |
|
214 | 11:c13eb81022ca f (no-eol) | |
215 | $ hg histedit -r '.' --commands - <<EOF |
|
215 | $ hg histedit -r '.' --commands - <<EOF | |
216 | > edit b346ab9a313d 6 c |
|
216 | > edit b346ab9a313d 6 c | |
217 | > EOF |
|
217 | > EOF | |
218 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
218 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
219 | adding c |
|
219 | adding c | |
220 | Editing (b346ab9a313d), you may commit or record as needed now. |
|
220 | Editing (b346ab9a313d), you may commit or record as needed now. | |
221 | (hg histedit --continue to resume) |
|
221 | (hg histedit --continue to resume) | |
222 | [1] |
|
222 | [1] | |
223 | $ echo c >> c |
|
223 | $ echo c >> c | |
224 | $ hg histedit --continue |
|
224 | $ hg histedit --continue | |
225 |
|
225 | |||
226 | $ hg log -r 'orphan()' |
|
226 | $ hg log -r 'orphan()' | |
227 | 11:c13eb81022ca f (no-eol) |
|
227 | 11:c13eb81022ca f (no-eol) | |
228 |
|
228 | |||
229 | stabilise |
|
229 | stabilise | |
230 |
|
230 | |||
231 | $ hg rebase -r 'orphan()' -d . |
|
231 | $ hg rebase -r 'orphan()' -d . | |
232 | rebasing 11:c13eb81022ca "f" |
|
232 | rebasing 11:c13eb81022ca "f" | |
233 | $ hg up tip -q |
|
233 | $ hg up tip -q | |
234 |
|
234 | |||
235 | Test dropping of changeset on the top of the stack |
|
235 | Test dropping of changeset on the top of the stack | |
236 | ------------------------------------------------------- |
|
236 | ------------------------------------------------------- | |
237 |
|
237 | |||
238 | Nothing is rewritten below, the working directory parent must be change for the |
|
238 | Nothing is rewritten below, the working directory parent must be change for the | |
239 | dropped changeset to be hidden. |
|
239 | dropped changeset to be hidden. | |
240 |
|
240 | |||
241 | $ cd .. |
|
241 | $ cd .. | |
242 | $ hg clone base droplast |
|
242 | $ hg clone base droplast | |
243 | updating to branch default |
|
243 | updating to branch default | |
244 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
244 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
245 | $ cd droplast |
|
245 | $ cd droplast | |
246 | $ hg histedit -r '40db8afa467b' --commands - << EOF |
|
246 | $ hg histedit -r '40db8afa467b' --commands - << EOF | |
247 | > pick 40db8afa467b 10 c |
|
247 | > pick 40db8afa467b 10 c | |
248 | > drop b449568bf7fc 11 f |
|
248 | > drop b449568bf7fc 11 f | |
249 | > EOF |
|
249 | > EOF | |
250 | $ hg log -G |
|
250 | $ hg log -G | |
251 | @ 12:40db8afa467b c |
|
251 | @ 12:40db8afa467b c | |
252 | | |
|
252 | | | |
253 | o 0:cb9a9f314b8b a |
|
253 | o 0:cb9a9f314b8b a | |
254 |
|
254 | |||
255 |
|
255 | |||
256 | With rewritten ancestors |
|
256 | With rewritten ancestors | |
257 |
|
257 | |||
258 | $ echo e > e |
|
258 | $ echo e > e | |
259 | $ hg add e |
|
259 | $ hg add e | |
260 | $ hg commit -m g |
|
260 | $ hg commit -m g | |
261 | $ echo f > f |
|
261 | $ echo f > f | |
262 | $ hg add f |
|
262 | $ hg add f | |
263 | $ hg commit -m h |
|
263 | $ hg commit -m h | |
264 | $ hg histedit -r '40db8afa467b' --commands - << EOF |
|
264 | $ hg histedit -r '40db8afa467b' --commands - << EOF | |
265 | > pick 47a8561c0449 12 g |
|
265 | > pick 47a8561c0449 12 g | |
266 | > pick 40db8afa467b 10 c |
|
266 | > pick 40db8afa467b 10 c | |
267 | > drop 1b3b05f35ff0 13 h |
|
267 | > drop 1b3b05f35ff0 13 h | |
268 | > EOF |
|
268 | > EOF | |
269 | $ hg log -G |
|
269 | $ hg log -G | |
270 | @ 17:ee6544123ab8 c |
|
270 | @ 17:ee6544123ab8 c | |
271 | | |
|
271 | | | |
272 | o 16:269e713e9eae g |
|
272 | o 16:269e713e9eae g | |
273 | | |
|
273 | | | |
274 | o 0:cb9a9f314b8b a |
|
274 | o 0:cb9a9f314b8b a | |
275 |
|
275 | |||
276 | $ cd ../base |
|
276 | $ cd ../base | |
277 |
|
277 | |||
278 |
|
278 | |||
279 |
|
279 | |||
280 | Test phases support |
|
280 | Test phases support | |
281 | =========================================== |
|
281 | =========================================== | |
282 |
|
282 | |||
283 | Check that histedit respect immutability |
|
283 | Check that histedit respect immutability | |
284 | ------------------------------------------- |
|
284 | ------------------------------------------- | |
285 |
|
285 | |||
286 | $ cat >> $HGRCPATH << EOF |
|
286 | $ cat >> $HGRCPATH << EOF | |
287 | > [ui] |
|
287 | > [ui] | |
288 | > logtemplate= {rev}:{node|short} ({phase}) {desc|firstline}\n |
|
288 | > logtemplate= {rev}:{node|short} ({phase}) {desc|firstline}\n | |
289 | > EOF |
|
289 | > EOF | |
290 |
|
290 | |||
291 | $ hg ph -pv '.^' |
|
291 | $ hg ph -pv '.^' | |
292 | phase changed for 2 changesets |
|
292 | phase changed for 2 changesets | |
293 | $ hg log -G |
|
293 | $ hg log -G | |
294 | @ 13:b449568bf7fc (draft) f |
|
294 | @ 13:b449568bf7fc (draft) f | |
295 | | |
|
295 | | | |
296 | o 12:40db8afa467b (public) c |
|
296 | o 12:40db8afa467b (public) c | |
297 | | |
|
297 | | | |
298 | o 0:cb9a9f314b8b (public) a |
|
298 | o 0:cb9a9f314b8b (public) a | |
299 |
|
299 | |||
300 | $ hg histedit -r '.~2' |
|
300 | $ hg histedit -r '.~2' | |
301 | abort: cannot edit public changeset: cb9a9f314b8b |
|
301 | abort: cannot edit public changeset: cb9a9f314b8b | |
302 | (see 'hg help phases' for details) |
|
302 | (see 'hg help phases' for details) | |
303 | [255] |
|
303 | [255] | |
304 |
|
304 | |||
305 |
|
305 | |||
306 | Prepare further testing |
|
306 | Prepare further testing | |
307 | ------------------------------------------- |
|
307 | ------------------------------------------- | |
308 |
|
308 | |||
309 | $ for x in g h i j k ; do |
|
309 | $ for x in g h i j k ; do | |
310 | > echo $x > $x |
|
310 | > echo $x > $x | |
311 | > hg add $x |
|
311 | > hg add $x | |
312 | > hg ci -m $x |
|
312 | > hg ci -m $x | |
313 | > done |
|
313 | > done | |
314 | $ hg phase --force --secret .~2 |
|
314 | $ hg phase --force --secret .~2 | |
315 | $ hg log -G |
|
315 | $ hg log -G | |
316 | @ 18:ee118ab9fa44 (secret) k |
|
316 | @ 18:ee118ab9fa44 (secret) k | |
317 | | |
|
317 | | | |
318 | o 17:3a6c53ee7f3d (secret) j |
|
318 | o 17:3a6c53ee7f3d (secret) j | |
319 | | |
|
319 | | | |
320 | o 16:b605fb7503f2 (secret) i |
|
320 | o 16:b605fb7503f2 (secret) i | |
321 | | |
|
321 | | | |
322 | o 15:7395e1ff83bd (draft) h |
|
322 | o 15:7395e1ff83bd (draft) h | |
323 | | |
|
323 | | | |
324 | o 14:6b70183d2492 (draft) g |
|
324 | o 14:6b70183d2492 (draft) g | |
325 | | |
|
325 | | | |
326 | o 13:b449568bf7fc (draft) f |
|
326 | o 13:b449568bf7fc (draft) f | |
327 | | |
|
327 | | | |
328 | o 12:40db8afa467b (public) c |
|
328 | o 12:40db8afa467b (public) c | |
329 | | |
|
329 | | | |
330 | o 0:cb9a9f314b8b (public) a |
|
330 | o 0:cb9a9f314b8b (public) a | |
331 |
|
331 | |||
332 | $ cd .. |
|
332 | $ cd .. | |
333 |
|
333 | |||
334 | simple phase conservation |
|
334 | simple phase conservation | |
335 | ------------------------------------------- |
|
335 | ------------------------------------------- | |
336 |
|
336 | |||
337 | Resulting changeset should conserve the phase of the original one whatever the |
|
337 | Resulting changeset should conserve the phase of the original one whatever the | |
338 | phases.new-commit option is. |
|
338 | phases.new-commit option is. | |
339 |
|
339 | |||
340 | New-commit as draft (default) |
|
340 | New-commit as draft (default) | |
341 |
|
341 | |||
342 | $ cp -R base simple-draft |
|
342 | $ cp -R base simple-draft | |
343 | $ cd simple-draft |
|
343 | $ cd simple-draft | |
344 | $ hg histedit -r 'b449568bf7fc' --commands - << EOF |
|
344 | $ hg histedit -r 'b449568bf7fc' --commands - << EOF | |
345 | > edit b449568bf7fc 11 f |
|
345 | > edit b449568bf7fc 11 f | |
346 | > pick 6b70183d2492 12 g |
|
346 | > pick 6b70183d2492 12 g | |
347 | > pick 7395e1ff83bd 13 h |
|
347 | > pick 7395e1ff83bd 13 h | |
348 | > pick b605fb7503f2 14 i |
|
348 | > pick b605fb7503f2 14 i | |
349 | > pick 3a6c53ee7f3d 15 j |
|
349 | > pick 3a6c53ee7f3d 15 j | |
350 | > pick ee118ab9fa44 16 k |
|
350 | > pick ee118ab9fa44 16 k | |
351 | > EOF |
|
351 | > EOF | |
352 | 0 files updated, 0 files merged, 6 files removed, 0 files unresolved |
|
352 | 0 files updated, 0 files merged, 6 files removed, 0 files unresolved | |
353 | adding f |
|
353 | adding f | |
354 | Editing (b449568bf7fc), you may commit or record as needed now. |
|
354 | Editing (b449568bf7fc), you may commit or record as needed now. | |
355 | (hg histedit --continue to resume) |
|
355 | (hg histedit --continue to resume) | |
356 | [1] |
|
356 | [1] | |
357 | $ echo f >> f |
|
357 | $ echo f >> f | |
358 | $ hg histedit --continue |
|
358 | $ hg histedit --continue | |
359 | $ hg log -G |
|
359 | $ hg log -G | |
360 | @ 24:12e89af74238 (secret) k |
|
360 | @ 24:12e89af74238 (secret) k | |
361 | | |
|
361 | | | |
362 | o 23:636a8687b22e (secret) j |
|
362 | o 23:636a8687b22e (secret) j | |
363 | | |
|
363 | | | |
364 | o 22:ccaf0a38653f (secret) i |
|
364 | o 22:ccaf0a38653f (secret) i | |
365 | | |
|
365 | | | |
366 | o 21:11a89d1c2613 (draft) h |
|
366 | o 21:11a89d1c2613 (draft) h | |
367 | | |
|
367 | | | |
368 | o 20:c1dec7ca82ea (draft) g |
|
368 | o 20:c1dec7ca82ea (draft) g | |
369 | | |
|
369 | | | |
370 | o 19:087281e68428 (draft) f |
|
370 | o 19:087281e68428 (draft) f | |
371 | | |
|
371 | | | |
372 | o 12:40db8afa467b (public) c |
|
372 | o 12:40db8afa467b (public) c | |
373 | | |
|
373 | | | |
374 | o 0:cb9a9f314b8b (public) a |
|
374 | o 0:cb9a9f314b8b (public) a | |
375 |
|
375 | |||
376 | $ cd .. |
|
376 | $ cd .. | |
377 |
|
377 | |||
378 |
|
378 | |||
379 | New-commit as secret (config) |
|
379 | New-commit as secret (config) | |
380 |
|
380 | |||
381 | $ cp -R base simple-secret |
|
381 | $ cp -R base simple-secret | |
382 | $ cd simple-secret |
|
382 | $ cd simple-secret | |
383 | $ cat >> .hg/hgrc << EOF |
|
383 | $ cat >> .hg/hgrc << EOF | |
384 | > [phases] |
|
384 | > [phases] | |
385 | > new-commit=secret |
|
385 | > new-commit=secret | |
386 | > EOF |
|
386 | > EOF | |
387 | $ hg histedit -r 'b449568bf7fc' --commands - << EOF |
|
387 | $ hg histedit -r 'b449568bf7fc' --commands - << EOF | |
388 | > edit b449568bf7fc 11 f |
|
388 | > edit b449568bf7fc 11 f | |
389 | > pick 6b70183d2492 12 g |
|
389 | > pick 6b70183d2492 12 g | |
390 | > pick 7395e1ff83bd 13 h |
|
390 | > pick 7395e1ff83bd 13 h | |
391 | > pick b605fb7503f2 14 i |
|
391 | > pick b605fb7503f2 14 i | |
392 | > pick 3a6c53ee7f3d 15 j |
|
392 | > pick 3a6c53ee7f3d 15 j | |
393 | > pick ee118ab9fa44 16 k |
|
393 | > pick ee118ab9fa44 16 k | |
394 | > EOF |
|
394 | > EOF | |
395 | 0 files updated, 0 files merged, 6 files removed, 0 files unresolved |
|
395 | 0 files updated, 0 files merged, 6 files removed, 0 files unresolved | |
396 | adding f |
|
396 | adding f | |
397 | Editing (b449568bf7fc), you may commit or record as needed now. |
|
397 | Editing (b449568bf7fc), you may commit or record as needed now. | |
398 | (hg histedit --continue to resume) |
|
398 | (hg histedit --continue to resume) | |
399 | [1] |
|
399 | [1] | |
400 | $ echo f >> f |
|
400 | $ echo f >> f | |
401 | $ hg histedit --continue |
|
401 | $ hg histedit --continue | |
402 | $ hg log -G |
|
402 | $ hg log -G | |
403 | @ 24:12e89af74238 (secret) k |
|
403 | @ 24:12e89af74238 (secret) k | |
404 | | |
|
404 | | | |
405 | o 23:636a8687b22e (secret) j |
|
405 | o 23:636a8687b22e (secret) j | |
406 | | |
|
406 | | | |
407 | o 22:ccaf0a38653f (secret) i |
|
407 | o 22:ccaf0a38653f (secret) i | |
408 | | |
|
408 | | | |
409 | o 21:11a89d1c2613 (draft) h |
|
409 | o 21:11a89d1c2613 (draft) h | |
410 | | |
|
410 | | | |
411 | o 20:c1dec7ca82ea (draft) g |
|
411 | o 20:c1dec7ca82ea (draft) g | |
412 | | |
|
412 | | | |
413 | o 19:087281e68428 (draft) f |
|
413 | o 19:087281e68428 (draft) f | |
414 | | |
|
414 | | | |
415 | o 12:40db8afa467b (public) c |
|
415 | o 12:40db8afa467b (public) c | |
416 | | |
|
416 | | | |
417 | o 0:cb9a9f314b8b (public) a |
|
417 | o 0:cb9a9f314b8b (public) a | |
418 |
|
418 | |||
419 | $ cd .. |
|
419 | $ cd .. | |
420 |
|
420 | |||
421 |
|
421 | |||
422 | Changeset reordering |
|
422 | Changeset reordering | |
423 | ------------------------------------------- |
|
423 | ------------------------------------------- | |
424 |
|
424 | |||
425 | If a secret changeset is put before a draft one, all descendant should be secret. |
|
425 | If a secret changeset is put before a draft one, all descendant should be secret. | |
426 | It seems more important to present the secret phase. |
|
426 | It seems more important to present the secret phase. | |
427 |
|
427 | |||
428 | $ cp -R base reorder |
|
428 | $ cp -R base reorder | |
429 | $ cd reorder |
|
429 | $ cd reorder | |
430 | $ hg histedit -r 'b449568bf7fc' --commands - << EOF |
|
430 | $ hg histedit -r 'b449568bf7fc' --commands - << EOF | |
431 | > pick b449568bf7fc 11 f |
|
431 | > pick b449568bf7fc 11 f | |
432 | > pick 3a6c53ee7f3d 15 j |
|
432 | > pick 3a6c53ee7f3d 15 j | |
433 | > pick 6b70183d2492 12 g |
|
433 | > pick 6b70183d2492 12 g | |
434 | > pick b605fb7503f2 14 i |
|
434 | > pick b605fb7503f2 14 i | |
435 | > pick 7395e1ff83bd 13 h |
|
435 | > pick 7395e1ff83bd 13 h | |
436 | > pick ee118ab9fa44 16 k |
|
436 | > pick ee118ab9fa44 16 k | |
437 | > EOF |
|
437 | > EOF | |
438 | $ hg log -G |
|
438 | $ hg log -G | |
439 | @ 23:558246857888 (secret) k |
|
439 | @ 23:558246857888 (secret) k | |
440 | | |
|
440 | | | |
441 | o 22:28bd44768535 (secret) h |
|
441 | o 22:28bd44768535 (secret) h | |
442 | | |
|
442 | | | |
443 | o 21:d5395202aeb9 (secret) i |
|
443 | o 21:d5395202aeb9 (secret) i | |
444 | | |
|
444 | | | |
445 | o 20:21edda8e341b (secret) g |
|
445 | o 20:21edda8e341b (secret) g | |
446 | | |
|
446 | | | |
447 | o 19:5ab64f3a4832 (secret) j |
|
447 | o 19:5ab64f3a4832 (secret) j | |
448 | | |
|
448 | | | |
449 | o 13:b449568bf7fc (draft) f |
|
449 | o 13:b449568bf7fc (draft) f | |
450 | | |
|
450 | | | |
451 | o 12:40db8afa467b (public) c |
|
451 | o 12:40db8afa467b (public) c | |
452 | | |
|
452 | | | |
453 | o 0:cb9a9f314b8b (public) a |
|
453 | o 0:cb9a9f314b8b (public) a | |
454 |
|
454 | |||
455 | $ cd .. |
|
455 | $ cd .. | |
456 |
|
456 | |||
457 | Changeset folding |
|
457 | Changeset folding | |
458 | ------------------------------------------- |
|
458 | ------------------------------------------- | |
459 |
|
459 | |||
460 | Folding a secret changeset with a draft one turn the result secret (again, |
|
460 | Folding a secret changeset with a draft one turn the result secret (again, | |
461 | better safe than sorry). Folding between same phase changeset still works |
|
461 | better safe than sorry). Folding between same phase changeset still works | |
462 |
|
462 | |||
463 | Note that there is a few reordering in this series for more extensive test |
|
463 | Note that there is a few reordering in this series for more extensive test | |
464 |
|
464 | |||
465 | $ cp -R base folding |
|
465 | $ cp -R base folding | |
466 | $ cd folding |
|
466 | $ cd folding | |
467 | $ cat >> .hg/hgrc << EOF |
|
467 | $ cat >> .hg/hgrc << EOF | |
468 | > [phases] |
|
468 | > [phases] | |
469 | > new-commit=secret |
|
469 | > new-commit=secret | |
470 | > EOF |
|
470 | > EOF | |
471 | $ hg histedit -r 'b449568bf7fc' --commands - << EOF |
|
471 | $ hg histedit -r 'b449568bf7fc' --commands - << EOF | |
472 | > pick 7395e1ff83bd 13 h |
|
472 | > pick 7395e1ff83bd 13 h | |
473 | > fold b449568bf7fc 11 f |
|
473 | > fold b449568bf7fc 11 f | |
474 | > pick 6b70183d2492 12 g |
|
474 | > pick 6b70183d2492 12 g | |
475 | > fold 3a6c53ee7f3d 15 j |
|
475 | > fold 3a6c53ee7f3d 15 j | |
476 | > pick b605fb7503f2 14 i |
|
476 | > pick b605fb7503f2 14 i | |
477 | > fold ee118ab9fa44 16 k |
|
477 | > fold ee118ab9fa44 16 k | |
478 | > EOF |
|
478 | > EOF | |
479 | $ hg log -G |
|
479 | $ hg log -G | |
480 | @ 27:f9daec13fb98 (secret) i |
|
480 | @ 27:f9daec13fb98 (secret) i | |
481 | | |
|
481 | | | |
482 | o 24:49807617f46a (secret) g |
|
482 | o 24:49807617f46a (secret) g | |
483 | | |
|
483 | | | |
484 | o 21:050280826e04 (draft) h |
|
484 | o 21:050280826e04 (draft) h | |
485 | | |
|
485 | | | |
486 | o 12:40db8afa467b (public) c |
|
486 | o 12:40db8afa467b (public) c | |
487 | | |
|
487 | | | |
488 | o 0:cb9a9f314b8b (public) a |
|
488 | o 0:cb9a9f314b8b (public) a | |
489 |
|
489 | |||
490 | $ hg co 49807617f46a |
|
490 | $ hg co 49807617f46a | |
491 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
491 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
492 | $ echo wat >> wat |
|
492 | $ echo wat >> wat | |
493 | $ hg add wat |
|
493 | $ hg add wat | |
494 | $ hg ci -m 'add wat' |
|
494 | $ hg ci -m 'add wat' | |
495 | created new head |
|
495 | created new head | |
496 | $ hg merge f9daec13fb98 |
|
496 | $ hg merge f9daec13fb98 | |
497 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
497 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
498 | (branch merge, don't forget to commit) |
|
498 | (branch merge, don't forget to commit) | |
499 | $ hg ci -m 'merge' |
|
499 | $ hg ci -m 'merge' | |
500 | $ echo not wat > wat |
|
500 | $ echo not wat > wat | |
501 | $ hg ci -m 'modify wat' |
|
501 | $ hg ci -m 'modify wat' | |
502 | $ hg histedit 050280826e04 |
|
502 | $ hg histedit 050280826e04 | |
503 | abort: cannot edit history that contains merges |
|
503 | abort: cannot edit history that contains merges | |
504 | [255] |
|
504 | [255] | |
505 | $ cd .. |
|
505 | $ cd .. | |
506 |
|
506 | |||
507 | Check abort behavior |
|
507 | Check abort behavior | |
508 | ------------------------------------------- |
|
508 | ------------------------------------------- | |
509 |
|
509 | |||
510 | We checks that abort properly clean the repository so the same histedit can be |
|
510 | We checks that abort properly clean the repository so the same histedit can be | |
511 | attempted later. |
|
511 | attempted later. | |
512 |
|
512 | |||
513 | $ cp -R base abort |
|
513 | $ cp -R base abort | |
514 | $ cd abort |
|
514 | $ cd abort | |
515 | $ hg histedit -r 'b449568bf7fc' --commands - << EOF |
|
515 | $ hg histedit -r 'b449568bf7fc' --commands - << EOF | |
516 | > pick b449568bf7fc 13 f |
|
516 | > pick b449568bf7fc 13 f | |
517 | > pick 7395e1ff83bd 15 h |
|
517 | > pick 7395e1ff83bd 15 h | |
518 | > pick 6b70183d2492 14 g |
|
518 | > pick 6b70183d2492 14 g | |
519 | > pick b605fb7503f2 16 i |
|
519 | > pick b605fb7503f2 16 i | |
520 | > roll 3a6c53ee7f3d 17 j |
|
520 | > roll 3a6c53ee7f3d 17 j | |
521 | > edit ee118ab9fa44 18 k |
|
521 | > edit ee118ab9fa44 18 k | |
522 | > EOF |
|
522 | > EOF | |
523 | Editing (ee118ab9fa44), you may commit or record as needed now. |
|
523 | Editing (ee118ab9fa44), you may commit or record as needed now. | |
524 | (hg histedit --continue to resume) |
|
524 | (hg histedit --continue to resume) | |
525 | [1] |
|
525 | [1] | |
526 |
|
526 | |||
527 | $ hg histedit --abort |
|
527 | $ hg histedit --abort | |
528 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
528 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
529 | saved backup bundle to $TESTTMP/abort/.hg/strip-backup/4dc06258baa6-dff4ef05-backup.hg (glob) |
|
529 | saved backup bundle to $TESTTMP/abort/.hg/strip-backup/4dc06258baa6-dff4ef05-backup.hg (glob) | |
530 |
|
530 | |||
531 | $ hg log -G |
|
531 | $ hg log -G | |
532 | @ 18:ee118ab9fa44 (secret) k |
|
532 | @ 18:ee118ab9fa44 (secret) k | |
533 | | |
|
533 | | | |
534 | o 17:3a6c53ee7f3d (secret) j |
|
534 | o 17:3a6c53ee7f3d (secret) j | |
535 | | |
|
535 | | | |
536 | o 16:b605fb7503f2 (secret) i |
|
536 | o 16:b605fb7503f2 (secret) i | |
537 | | |
|
537 | | | |
538 | o 15:7395e1ff83bd (draft) h |
|
538 | o 15:7395e1ff83bd (draft) h | |
539 | | |
|
539 | | | |
540 | o 14:6b70183d2492 (draft) g |
|
540 | o 14:6b70183d2492 (draft) g | |
541 | | |
|
541 | | | |
542 | o 13:b449568bf7fc (draft) f |
|
542 | o 13:b449568bf7fc (draft) f | |
543 | | |
|
543 | | | |
544 | o 12:40db8afa467b (public) c |
|
544 | o 12:40db8afa467b (public) c | |
545 | | |
|
545 | | | |
546 | o 0:cb9a9f314b8b (public) a |
|
546 | o 0:cb9a9f314b8b (public) a | |
547 |
|
547 | |||
548 | $ hg histedit -r 'b449568bf7fc' --commands - << EOF --config experimental.stabilization.track-operation=1 |
|
548 | $ hg histedit -r 'b449568bf7fc' --commands - << EOF --config experimental.stabilization.track-operation=1 | |
549 | > pick b449568bf7fc 13 f |
|
549 | > pick b449568bf7fc 13 f | |
550 | > pick 7395e1ff83bd 15 h |
|
550 | > pick 7395e1ff83bd 15 h | |
551 | > pick 6b70183d2492 14 g |
|
551 | > pick 6b70183d2492 14 g | |
552 | > pick b605fb7503f2 16 i |
|
552 | > pick b605fb7503f2 16 i | |
553 | > pick 3a6c53ee7f3d 17 j |
|
553 | > pick 3a6c53ee7f3d 17 j | |
554 | > edit ee118ab9fa44 18 k |
|
554 | > edit ee118ab9fa44 18 k | |
555 | > EOF |
|
555 | > EOF | |
556 | Editing (ee118ab9fa44), you may commit or record as needed now. |
|
556 | Editing (ee118ab9fa44), you may commit or record as needed now. | |
557 | (hg histedit --continue to resume) |
|
557 | (hg histedit --continue to resume) | |
558 | [1] |
|
558 | [1] | |
559 | $ hg histedit --continue --config experimental.stabilization.track-operation=1 |
|
559 | $ hg histedit --continue --config experimental.stabilization.track-operation=1 | |
560 | $ hg log -G |
|
560 | $ hg log -G | |
561 | @ 23:175d6b286a22 (secret) k |
|
561 | @ 23:175d6b286a22 (secret) k | |
562 | | |
|
562 | | | |
563 | o 22:44ca09d59ae4 (secret) j |
|
563 | o 22:44ca09d59ae4 (secret) j | |
564 | | |
|
564 | | | |
565 | o 21:31747692a644 (secret) i |
|
565 | o 21:31747692a644 (secret) i | |
566 | | |
|
566 | | | |
567 | o 20:9985cd4f21fa (draft) g |
|
567 | o 20:9985cd4f21fa (draft) g | |
568 | | |
|
568 | | | |
569 | o 19:4dc06258baa6 (draft) h |
|
569 | o 19:4dc06258baa6 (draft) h | |
570 | | |
|
570 | | | |
571 | o 13:b449568bf7fc (draft) f |
|
571 | o 13:b449568bf7fc (draft) f | |
572 | | |
|
572 | | | |
573 | o 12:40db8afa467b (public) c |
|
573 | o 12:40db8afa467b (public) c | |
574 | | |
|
574 | | | |
575 | o 0:cb9a9f314b8b (public) a |
|
575 | o 0:cb9a9f314b8b (public) a | |
576 |
|
576 | |||
577 | $ hg debugobsolete --rev . |
|
577 | $ hg debugobsolete --rev . | |
578 | ee118ab9fa44ebb86be85996548b5517a39e5093 175d6b286a224c23f192e79a581ce83131a53fa2 0 (*) {'operation': 'histedit', 'user': 'test'} (glob) |
|
578 | ee118ab9fa44ebb86be85996548b5517a39e5093 175d6b286a224c23f192e79a581ce83131a53fa2 0 (*) {'operation': 'histedit', 'user': 'test'} (glob) |
@@ -1,56 +1,56 b'' | |||||
1 | $ cat >> $HGRCPATH <<EOF |
|
1 | $ cat >> $HGRCPATH <<EOF | |
2 | > [extensions] |
|
2 | > [extensions] | |
3 | > drawdag=$TESTDIR/drawdag.py |
|
3 | > drawdag=$TESTDIR/drawdag.py | |
4 | > bruterebase=$TESTDIR/bruterebase.py |
|
4 | > bruterebase=$TESTDIR/bruterebase.py | |
5 | > [experimental] |
|
5 | > [experimental] | |
6 | > evolution=allowunstable |
|
|||
7 | > evolution.createmarkers=True |
|
6 | > evolution.createmarkers=True | |
|
7 | > evolution.allowunstable=True | |||
8 | > EOF |
|
8 | > EOF | |
9 | $ init() { |
|
9 | $ init() { | |
10 | > N=`expr ${N:-0} + 1` |
|
10 | > N=`expr ${N:-0} + 1` | |
11 | > cd $TESTTMP && hg init repo$N && cd repo$N |
|
11 | > cd $TESTTMP && hg init repo$N && cd repo$N | |
12 | > hg debugdrawdag |
|
12 | > hg debugdrawdag | |
13 | > } |
|
13 | > } | |
14 |
|
14 | |||
15 | Source looks like "N" |
|
15 | Source looks like "N" | |
16 |
|
16 | |||
17 | $ init <<'EOS' |
|
17 | $ init <<'EOS' | |
18 | > C D |
|
18 | > C D | |
19 | > |\| |
|
19 | > |\| | |
20 | > A B Z |
|
20 | > A B Z | |
21 | > EOS |
|
21 | > EOS | |
22 |
|
22 | |||
23 | $ hg debugbruterebase 'all()-Z' Z |
|
23 | $ hg debugbruterebase 'all()-Z' Z | |
24 | A: A':Z |
|
24 | A: A':Z | |
25 | B: B':Z |
|
25 | B: B':Z | |
26 | AB: A':Z B':Z |
|
26 | AB: A':Z B':Z | |
27 | C: ABORT: cannot rebase 3:a35c07e8a2a4 without moving at least one of its parents |
|
27 | C: ABORT: cannot rebase 3:a35c07e8a2a4 without moving at least one of its parents | |
28 | AC: A':Z C':A'B |
|
28 | AC: A':Z C':A'B | |
29 | BC: B':Z C':B'A |
|
29 | BC: B':Z C':B'A | |
30 | ABC: A':Z B':Z C':A'B' |
|
30 | ABC: A':Z B':Z C':A'B' | |
31 | D: D':Z |
|
31 | D: D':Z | |
32 | AD: A':Z D':Z |
|
32 | AD: A':Z D':Z | |
33 | BD: B':Z D':B' |
|
33 | BD: B':Z D':B' | |
34 | ABD: A':Z B':Z D':B' |
|
34 | ABD: A':Z B':Z D':B' | |
35 | CD: ABORT: cannot rebase 3:a35c07e8a2a4 without moving at least one of its parents |
|
35 | CD: ABORT: cannot rebase 3:a35c07e8a2a4 without moving at least one of its parents | |
36 | ACD: A':Z C':A'B D':Z |
|
36 | ACD: A':Z C':A'B D':Z | |
37 | BCD: B':Z C':B'A D':B' |
|
37 | BCD: B':Z C':B'A D':B' | |
38 | ABCD: A':Z B':Z C':A'B' D':B' |
|
38 | ABCD: A':Z B':Z C':A'B' D':B' | |
39 |
|
39 | |||
40 | Moving backwards |
|
40 | Moving backwards | |
41 |
|
41 | |||
42 | $ init <<'EOS' |
|
42 | $ init <<'EOS' | |
43 | > C |
|
43 | > C | |
44 | > |\ |
|
44 | > |\ | |
45 | > A B |
|
45 | > A B | |
46 | > | |
|
46 | > | | |
47 | > Z |
|
47 | > Z | |
48 | > EOS |
|
48 | > EOS | |
49 | $ hg debugbruterebase 'all()-Z' Z |
|
49 | $ hg debugbruterebase 'all()-Z' Z | |
50 | B: B':Z |
|
50 | B: B':Z | |
51 | A: |
|
51 | A: | |
52 | BA: B':Z |
|
52 | BA: B':Z | |
53 | C: ABORT: cannot rebase 3:b8d7149b562b without moving at least one of its parents |
|
53 | C: ABORT: cannot rebase 3:b8d7149b562b without moving at least one of its parents | |
54 | BC: B':Z C':B'A |
|
54 | BC: B':Z C':B'A | |
55 | AC: |
|
55 | AC: | |
56 | BAC: B':Z C':B'A |
|
56 | BAC: B':Z C':B'A |
@@ -1,1376 +1,1376 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 >> $HGRCPATH << EOF |
|
7 | $ cat >> $HGRCPATH << EOF | |
8 | > [ui] |
|
8 | > [ui] | |
9 | > logtemplate= {rev}:{node|short} {desc|firstline} |
|
9 | > logtemplate= {rev}:{node|short} {desc|firstline} | |
10 | > [experimental] |
|
10 | > [experimental] | |
11 | > evolution=allowunstable |
|
|||
12 | > evolution.createmarkers=True |
|
11 | > evolution.createmarkers=True | |
|
12 | > evolution.allowunstable=True | |||
13 | > [phases] |
|
13 | > [phases] | |
14 | > publish=False |
|
14 | > publish=False | |
15 | > [extensions] |
|
15 | > [extensions] | |
16 | > rebase= |
|
16 | > rebase= | |
17 | > drawdag=$TESTDIR/drawdag.py |
|
17 | > drawdag=$TESTDIR/drawdag.py | |
18 | > EOF |
|
18 | > EOF | |
19 |
|
19 | |||
20 | Setup rebase canonical repo |
|
20 | Setup rebase canonical repo | |
21 |
|
21 | |||
22 | $ hg init base |
|
22 | $ hg init base | |
23 | $ cd base |
|
23 | $ cd base | |
24 | $ hg unbundle "$TESTDIR/bundles/rebase.hg" |
|
24 | $ hg unbundle "$TESTDIR/bundles/rebase.hg" | |
25 | adding changesets |
|
25 | adding changesets | |
26 | adding manifests |
|
26 | adding manifests | |
27 | adding file changes |
|
27 | adding file changes | |
28 | added 8 changesets with 7 changes to 7 files (+2 heads) |
|
28 | added 8 changesets with 7 changes to 7 files (+2 heads) | |
29 | new changesets cd010b8cd998:02de42196ebe |
|
29 | new changesets cd010b8cd998:02de42196ebe | |
30 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
30 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
31 | $ hg up tip |
|
31 | $ hg up tip | |
32 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
32 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
33 | $ hg log -G |
|
33 | $ hg log -G | |
34 | @ 7:02de42196ebe H |
|
34 | @ 7:02de42196ebe H | |
35 | | |
|
35 | | | |
36 | | o 6:eea13746799a G |
|
36 | | o 6:eea13746799a G | |
37 | |/| |
|
37 | |/| | |
38 | o | 5:24b6387c8c8c F |
|
38 | o | 5:24b6387c8c8c F | |
39 | | | |
|
39 | | | | |
40 | | o 4:9520eea781bc E |
|
40 | | o 4:9520eea781bc E | |
41 | |/ |
|
41 | |/ | |
42 | | o 3:32af7686d403 D |
|
42 | | o 3:32af7686d403 D | |
43 | | | |
|
43 | | | | |
44 | | o 2:5fddd98957c8 C |
|
44 | | o 2:5fddd98957c8 C | |
45 | | | |
|
45 | | | | |
46 | | o 1:42ccdea3bb16 B |
|
46 | | o 1:42ccdea3bb16 B | |
47 | |/ |
|
47 | |/ | |
48 | o 0:cd010b8cd998 A |
|
48 | o 0:cd010b8cd998 A | |
49 |
|
49 | |||
50 | $ cd .. |
|
50 | $ cd .. | |
51 |
|
51 | |||
52 | simple rebase |
|
52 | simple rebase | |
53 | --------------------------------- |
|
53 | --------------------------------- | |
54 |
|
54 | |||
55 | $ hg clone base simple |
|
55 | $ hg clone base simple | |
56 | updating to branch default |
|
56 | updating to branch default | |
57 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
57 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
58 | $ cd simple |
|
58 | $ cd simple | |
59 | $ hg up 32af7686d403 |
|
59 | $ hg up 32af7686d403 | |
60 | 3 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
60 | 3 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
61 | $ hg rebase -d eea13746799a |
|
61 | $ hg rebase -d eea13746799a | |
62 | rebasing 1:42ccdea3bb16 "B" |
|
62 | rebasing 1:42ccdea3bb16 "B" | |
63 | rebasing 2:5fddd98957c8 "C" |
|
63 | rebasing 2:5fddd98957c8 "C" | |
64 | rebasing 3:32af7686d403 "D" |
|
64 | rebasing 3:32af7686d403 "D" | |
65 | $ hg log -G |
|
65 | $ hg log -G | |
66 | @ 10:8eeb3c33ad33 D |
|
66 | @ 10:8eeb3c33ad33 D | |
67 | | |
|
67 | | | |
68 | o 9:2327fea05063 C |
|
68 | o 9:2327fea05063 C | |
69 | | |
|
69 | | | |
70 | o 8:e4e5be0395b2 B |
|
70 | o 8:e4e5be0395b2 B | |
71 | | |
|
71 | | | |
72 | | o 7:02de42196ebe H |
|
72 | | o 7:02de42196ebe H | |
73 | | | |
|
73 | | | | |
74 | o | 6:eea13746799a G |
|
74 | o | 6:eea13746799a G | |
75 | |\| |
|
75 | |\| | |
76 | | o 5:24b6387c8c8c F |
|
76 | | o 5:24b6387c8c8c F | |
77 | | | |
|
77 | | | | |
78 | o | 4:9520eea781bc E |
|
78 | o | 4:9520eea781bc E | |
79 | |/ |
|
79 | |/ | |
80 | o 0:cd010b8cd998 A |
|
80 | o 0:cd010b8cd998 A | |
81 |
|
81 | |||
82 | $ hg log --hidden -G |
|
82 | $ hg log --hidden -G | |
83 | @ 10:8eeb3c33ad33 D |
|
83 | @ 10:8eeb3c33ad33 D | |
84 | | |
|
84 | | | |
85 | o 9:2327fea05063 C |
|
85 | o 9:2327fea05063 C | |
86 | | |
|
86 | | | |
87 | o 8:e4e5be0395b2 B |
|
87 | o 8:e4e5be0395b2 B | |
88 | | |
|
88 | | | |
89 | | o 7:02de42196ebe H |
|
89 | | o 7:02de42196ebe H | |
90 | | | |
|
90 | | | | |
91 | o | 6:eea13746799a G |
|
91 | o | 6:eea13746799a G | |
92 | |\| |
|
92 | |\| | |
93 | | o 5:24b6387c8c8c F |
|
93 | | o 5:24b6387c8c8c F | |
94 | | | |
|
94 | | | | |
95 | o | 4:9520eea781bc E |
|
95 | o | 4:9520eea781bc E | |
96 | |/ |
|
96 | |/ | |
97 | | x 3:32af7686d403 D |
|
97 | | x 3:32af7686d403 D | |
98 | | | |
|
98 | | | | |
99 | | x 2:5fddd98957c8 C |
|
99 | | x 2:5fddd98957c8 C | |
100 | | | |
|
100 | | | | |
101 | | x 1:42ccdea3bb16 B |
|
101 | | x 1:42ccdea3bb16 B | |
102 | |/ |
|
102 | |/ | |
103 | o 0:cd010b8cd998 A |
|
103 | o 0:cd010b8cd998 A | |
104 |
|
104 | |||
105 | $ hg debugobsolete |
|
105 | $ hg debugobsolete | |
106 | 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 e4e5be0395b2cbd471ed22a26b1b6a1a0658a794 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} |
|
106 | 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 e4e5be0395b2cbd471ed22a26b1b6a1a0658a794 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} | |
107 | 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 2327fea05063f39961b14cb69435a9898dc9a245 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} |
|
107 | 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 2327fea05063f39961b14cb69435a9898dc9a245 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} | |
108 | 32af7686d403cf45b5d95f2d70cebea587ac806a 8eeb3c33ad33d452c89e5dcf611c347f978fb42b 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} |
|
108 | 32af7686d403cf45b5d95f2d70cebea587ac806a 8eeb3c33ad33d452c89e5dcf611c347f978fb42b 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} | |
109 |
|
109 | |||
110 |
|
110 | |||
111 | $ cd .. |
|
111 | $ cd .. | |
112 |
|
112 | |||
113 | empty changeset |
|
113 | empty changeset | |
114 | --------------------------------- |
|
114 | --------------------------------- | |
115 |
|
115 | |||
116 | $ hg clone base empty |
|
116 | $ hg clone base empty | |
117 | updating to branch default |
|
117 | updating to branch default | |
118 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
118 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
119 | $ cd empty |
|
119 | $ cd empty | |
120 | $ hg up eea13746799a |
|
120 | $ hg up eea13746799a | |
121 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
121 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
122 |
|
122 | |||
123 | We make a copy of both the first changeset in the rebased and some other in the |
|
123 | We make a copy of both the first changeset in the rebased and some other in the | |
124 | set. |
|
124 | set. | |
125 |
|
125 | |||
126 | $ hg graft 42ccdea3bb16 32af7686d403 |
|
126 | $ hg graft 42ccdea3bb16 32af7686d403 | |
127 | grafting 1:42ccdea3bb16 "B" |
|
127 | grafting 1:42ccdea3bb16 "B" | |
128 | grafting 3:32af7686d403 "D" |
|
128 | grafting 3:32af7686d403 "D" | |
129 | $ hg rebase -s 42ccdea3bb16 -d . |
|
129 | $ hg rebase -s 42ccdea3bb16 -d . | |
130 | rebasing 1:42ccdea3bb16 "B" |
|
130 | rebasing 1:42ccdea3bb16 "B" | |
131 | note: rebase of 1:42ccdea3bb16 created no changes to commit |
|
131 | note: rebase of 1:42ccdea3bb16 created no changes to commit | |
132 | rebasing 2:5fddd98957c8 "C" |
|
132 | rebasing 2:5fddd98957c8 "C" | |
133 | rebasing 3:32af7686d403 "D" |
|
133 | rebasing 3:32af7686d403 "D" | |
134 | note: rebase of 3:32af7686d403 created no changes to commit |
|
134 | note: rebase of 3:32af7686d403 created no changes to commit | |
135 | $ hg log -G |
|
135 | $ hg log -G | |
136 | o 10:5ae4c968c6ac C |
|
136 | o 10:5ae4c968c6ac C | |
137 | | |
|
137 | | | |
138 | @ 9:08483444fef9 D |
|
138 | @ 9:08483444fef9 D | |
139 | | |
|
139 | | | |
140 | o 8:8877864f1edb B |
|
140 | o 8:8877864f1edb B | |
141 | | |
|
141 | | | |
142 | | o 7:02de42196ebe H |
|
142 | | o 7:02de42196ebe H | |
143 | | | |
|
143 | | | | |
144 | o | 6:eea13746799a G |
|
144 | o | 6:eea13746799a G | |
145 | |\| |
|
145 | |\| | |
146 | | o 5:24b6387c8c8c F |
|
146 | | o 5:24b6387c8c8c F | |
147 | | | |
|
147 | | | | |
148 | o | 4:9520eea781bc E |
|
148 | o | 4:9520eea781bc E | |
149 | |/ |
|
149 | |/ | |
150 | o 0:cd010b8cd998 A |
|
150 | o 0:cd010b8cd998 A | |
151 |
|
151 | |||
152 | $ hg log --hidden -G |
|
152 | $ hg log --hidden -G | |
153 | o 10:5ae4c968c6ac C |
|
153 | o 10:5ae4c968c6ac C | |
154 | | |
|
154 | | | |
155 | @ 9:08483444fef9 D |
|
155 | @ 9:08483444fef9 D | |
156 | | |
|
156 | | | |
157 | o 8:8877864f1edb B |
|
157 | o 8:8877864f1edb B | |
158 | | |
|
158 | | | |
159 | | o 7:02de42196ebe H |
|
159 | | o 7:02de42196ebe H | |
160 | | | |
|
160 | | | | |
161 | o | 6:eea13746799a G |
|
161 | o | 6:eea13746799a G | |
162 | |\| |
|
162 | |\| | |
163 | | o 5:24b6387c8c8c F |
|
163 | | o 5:24b6387c8c8c F | |
164 | | | |
|
164 | | | | |
165 | o | 4:9520eea781bc E |
|
165 | o | 4:9520eea781bc E | |
166 | |/ |
|
166 | |/ | |
167 | | x 3:32af7686d403 D |
|
167 | | x 3:32af7686d403 D | |
168 | | | |
|
168 | | | | |
169 | | x 2:5fddd98957c8 C |
|
169 | | x 2:5fddd98957c8 C | |
170 | | | |
|
170 | | | | |
171 | | x 1:42ccdea3bb16 B |
|
171 | | x 1:42ccdea3bb16 B | |
172 | |/ |
|
172 | |/ | |
173 | o 0:cd010b8cd998 A |
|
173 | o 0:cd010b8cd998 A | |
174 |
|
174 | |||
175 | $ hg debugobsolete |
|
175 | $ hg debugobsolete | |
176 | 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} |
|
176 | 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} | |
177 | 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} |
|
177 | 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} | |
178 | 32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} |
|
178 | 32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} | |
179 |
|
179 | |||
180 |
|
180 | |||
181 | More complex case where part of the rebase set were already rebased |
|
181 | More complex case where part of the rebase set were already rebased | |
182 |
|
182 | |||
183 | $ hg rebase --rev 'desc(D)' --dest 'desc(H)' |
|
183 | $ hg rebase --rev 'desc(D)' --dest 'desc(H)' | |
184 | rebasing 9:08483444fef9 "D" |
|
184 | rebasing 9:08483444fef9 "D" | |
185 | $ hg debugobsolete |
|
185 | $ hg debugobsolete | |
186 | 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} |
|
186 | 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} | |
187 | 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} |
|
187 | 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} | |
188 | 32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} |
|
188 | 32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} | |
189 | 08483444fef91d6224f6655ee586a65d263ad34c 4596109a6a4328c398bde3a4a3b6737cfade3003 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} |
|
189 | 08483444fef91d6224f6655ee586a65d263ad34c 4596109a6a4328c398bde3a4a3b6737cfade3003 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} | |
190 | $ hg log -G |
|
190 | $ hg log -G | |
191 | @ 11:4596109a6a43 D |
|
191 | @ 11:4596109a6a43 D | |
192 | | |
|
192 | | | |
193 | | o 10:5ae4c968c6ac C |
|
193 | | o 10:5ae4c968c6ac C | |
194 | | | |
|
194 | | | | |
195 | | x 9:08483444fef9 D |
|
195 | | x 9:08483444fef9 D | |
196 | | | |
|
196 | | | | |
197 | | o 8:8877864f1edb B |
|
197 | | o 8:8877864f1edb B | |
198 | | | |
|
198 | | | | |
199 | o | 7:02de42196ebe H |
|
199 | o | 7:02de42196ebe H | |
200 | | | |
|
200 | | | | |
201 | | o 6:eea13746799a G |
|
201 | | o 6:eea13746799a G | |
202 | |/| |
|
202 | |/| | |
203 | o | 5:24b6387c8c8c F |
|
203 | o | 5:24b6387c8c8c F | |
204 | | | |
|
204 | | | | |
205 | | o 4:9520eea781bc E |
|
205 | | o 4:9520eea781bc E | |
206 | |/ |
|
206 | |/ | |
207 | o 0:cd010b8cd998 A |
|
207 | o 0:cd010b8cd998 A | |
208 |
|
208 | |||
209 | $ hg rebase --source 'desc(B)' --dest 'tip' --config experimental.rebaseskipobsolete=True |
|
209 | $ hg rebase --source 'desc(B)' --dest 'tip' --config experimental.rebaseskipobsolete=True | |
210 | rebasing 8:8877864f1edb "B" |
|
210 | rebasing 8:8877864f1edb "B" | |
211 | note: not rebasing 9:08483444fef9 "D", already in destination as 11:4596109a6a43 "D" (tip) |
|
211 | note: not rebasing 9:08483444fef9 "D", already in destination as 11:4596109a6a43 "D" (tip) | |
212 | rebasing 10:5ae4c968c6ac "C" |
|
212 | rebasing 10:5ae4c968c6ac "C" | |
213 | $ hg debugobsolete |
|
213 | $ hg debugobsolete | |
214 | 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} |
|
214 | 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} | |
215 | 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} |
|
215 | 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} | |
216 | 32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} |
|
216 | 32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} | |
217 | 08483444fef91d6224f6655ee586a65d263ad34c 4596109a6a4328c398bde3a4a3b6737cfade3003 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} |
|
217 | 08483444fef91d6224f6655ee586a65d263ad34c 4596109a6a4328c398bde3a4a3b6737cfade3003 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} | |
218 | 8877864f1edb05d0e07dc4ba77b67a80a7b86672 462a34d07e599b87ea08676a449373fe4e2e1347 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} |
|
218 | 8877864f1edb05d0e07dc4ba77b67a80a7b86672 462a34d07e599b87ea08676a449373fe4e2e1347 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} | |
219 | 5ae4c968c6aca831df823664e706c9d4aa34473d 98f6af4ee9539e14da4465128f894c274900b6e5 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} |
|
219 | 5ae4c968c6aca831df823664e706c9d4aa34473d 98f6af4ee9539e14da4465128f894c274900b6e5 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} | |
220 | $ hg log --rev 'contentdivergent()' |
|
220 | $ hg log --rev 'contentdivergent()' | |
221 | $ hg log -G |
|
221 | $ hg log -G | |
222 | o 13:98f6af4ee953 C |
|
222 | o 13:98f6af4ee953 C | |
223 | | |
|
223 | | | |
224 | o 12:462a34d07e59 B |
|
224 | o 12:462a34d07e59 B | |
225 | | |
|
225 | | | |
226 | @ 11:4596109a6a43 D |
|
226 | @ 11:4596109a6a43 D | |
227 | | |
|
227 | | | |
228 | o 7:02de42196ebe H |
|
228 | o 7:02de42196ebe H | |
229 | | |
|
229 | | | |
230 | | o 6:eea13746799a G |
|
230 | | o 6:eea13746799a G | |
231 | |/| |
|
231 | |/| | |
232 | o | 5:24b6387c8c8c F |
|
232 | o | 5:24b6387c8c8c F | |
233 | | | |
|
233 | | | | |
234 | | o 4:9520eea781bc E |
|
234 | | o 4:9520eea781bc E | |
235 | |/ |
|
235 | |/ | |
236 | o 0:cd010b8cd998 A |
|
236 | o 0:cd010b8cd998 A | |
237 |
|
237 | |||
238 | $ hg log --style default --debug -r 4596109a6a4328c398bde3a4a3b6737cfade3003 |
|
238 | $ hg log --style default --debug -r 4596109a6a4328c398bde3a4a3b6737cfade3003 | |
239 | changeset: 11:4596109a6a4328c398bde3a4a3b6737cfade3003 |
|
239 | changeset: 11:4596109a6a4328c398bde3a4a3b6737cfade3003 | |
240 | phase: draft |
|
240 | phase: draft | |
241 | parent: 7:02de42196ebee42ef284b6780a87cdc96e8eaab6 |
|
241 | parent: 7:02de42196ebee42ef284b6780a87cdc96e8eaab6 | |
242 | parent: -1:0000000000000000000000000000000000000000 |
|
242 | parent: -1:0000000000000000000000000000000000000000 | |
243 | manifest: 11:a91006e3a02f1edf631f7018e6e5684cf27dd905 |
|
243 | manifest: 11:a91006e3a02f1edf631f7018e6e5684cf27dd905 | |
244 | user: Nicolas Dumazet <nicdumz.commits@gmail.com> |
|
244 | user: Nicolas Dumazet <nicdumz.commits@gmail.com> | |
245 | date: Sat Apr 30 15:24:48 2011 +0200 |
|
245 | date: Sat Apr 30 15:24:48 2011 +0200 | |
246 | files+: D |
|
246 | files+: D | |
247 | extra: branch=default |
|
247 | extra: branch=default | |
248 | extra: rebase_source=08483444fef91d6224f6655ee586a65d263ad34c |
|
248 | extra: rebase_source=08483444fef91d6224f6655ee586a65d263ad34c | |
249 | extra: source=32af7686d403cf45b5d95f2d70cebea587ac806a |
|
249 | extra: source=32af7686d403cf45b5d95f2d70cebea587ac806a | |
250 | description: |
|
250 | description: | |
251 | D |
|
251 | D | |
252 |
|
252 | |||
253 |
|
253 | |||
254 | $ hg up -qr 'desc(G)' |
|
254 | $ hg up -qr 'desc(G)' | |
255 | $ hg graft 4596109a6a4328c398bde3a4a3b6737cfade3003 |
|
255 | $ hg graft 4596109a6a4328c398bde3a4a3b6737cfade3003 | |
256 | grafting 11:4596109a6a43 "D" |
|
256 | grafting 11:4596109a6a43 "D" | |
257 | $ hg up -qr 'desc(E)' |
|
257 | $ hg up -qr 'desc(E)' | |
258 | $ hg rebase -s tip -d . |
|
258 | $ hg rebase -s tip -d . | |
259 | rebasing 14:9e36056a46e3 "D" (tip) |
|
259 | rebasing 14:9e36056a46e3 "D" (tip) | |
260 | $ hg log --style default --debug -r tip |
|
260 | $ hg log --style default --debug -r tip | |
261 | changeset: 15:627d4614809036ba22b9e7cb31638ddc06ab99ab |
|
261 | changeset: 15:627d4614809036ba22b9e7cb31638ddc06ab99ab | |
262 | tag: tip |
|
262 | tag: tip | |
263 | phase: draft |
|
263 | phase: draft | |
264 | parent: 4:9520eea781bcca16c1e15acc0ba14335a0e8e5ba |
|
264 | parent: 4:9520eea781bcca16c1e15acc0ba14335a0e8e5ba | |
265 | parent: -1:0000000000000000000000000000000000000000 |
|
265 | parent: -1:0000000000000000000000000000000000000000 | |
266 | manifest: 15:648e8ede73ae3e497d093d3a4c8fcc2daa864f42 |
|
266 | manifest: 15:648e8ede73ae3e497d093d3a4c8fcc2daa864f42 | |
267 | user: Nicolas Dumazet <nicdumz.commits@gmail.com> |
|
267 | user: Nicolas Dumazet <nicdumz.commits@gmail.com> | |
268 | date: Sat Apr 30 15:24:48 2011 +0200 |
|
268 | date: Sat Apr 30 15:24:48 2011 +0200 | |
269 | files+: D |
|
269 | files+: D | |
270 | extra: branch=default |
|
270 | extra: branch=default | |
271 | extra: intermediate-source=4596109a6a4328c398bde3a4a3b6737cfade3003 |
|
271 | extra: intermediate-source=4596109a6a4328c398bde3a4a3b6737cfade3003 | |
272 | extra: rebase_source=9e36056a46e37c9776168c7375734eebc70e294f |
|
272 | extra: rebase_source=9e36056a46e37c9776168c7375734eebc70e294f | |
273 | extra: source=32af7686d403cf45b5d95f2d70cebea587ac806a |
|
273 | extra: source=32af7686d403cf45b5d95f2d70cebea587ac806a | |
274 | description: |
|
274 | description: | |
275 | D |
|
275 | D | |
276 |
|
276 | |||
277 |
|
277 | |||
278 | Start rebase from a commit that is obsolete but not hidden only because it's |
|
278 | Start rebase from a commit that is obsolete but not hidden only because it's | |
279 | a working copy parent. We should be moved back to the starting commit as usual |
|
279 | a working copy parent. We should be moved back to the starting commit as usual | |
280 | even though it is hidden (until we're moved there). |
|
280 | even though it is hidden (until we're moved there). | |
281 |
|
281 | |||
282 | $ hg --hidden up -qr 'first(hidden())' |
|
282 | $ hg --hidden up -qr 'first(hidden())' | |
283 | $ hg rebase --rev 13 --dest 15 |
|
283 | $ hg rebase --rev 13 --dest 15 | |
284 | rebasing 13:98f6af4ee953 "C" |
|
284 | rebasing 13:98f6af4ee953 "C" | |
285 | $ hg log -G |
|
285 | $ hg log -G | |
286 | o 16:294a2b93eb4d C |
|
286 | o 16:294a2b93eb4d C | |
287 | | |
|
287 | | | |
288 | o 15:627d46148090 D |
|
288 | o 15:627d46148090 D | |
289 | | |
|
289 | | | |
290 | | o 12:462a34d07e59 B |
|
290 | | o 12:462a34d07e59 B | |
291 | | | |
|
291 | | | | |
292 | | o 11:4596109a6a43 D |
|
292 | | o 11:4596109a6a43 D | |
293 | | | |
|
293 | | | | |
294 | | o 7:02de42196ebe H |
|
294 | | o 7:02de42196ebe H | |
295 | | | |
|
295 | | | | |
296 | +---o 6:eea13746799a G |
|
296 | +---o 6:eea13746799a G | |
297 | | |/ |
|
297 | | |/ | |
298 | | o 5:24b6387c8c8c F |
|
298 | | o 5:24b6387c8c8c F | |
299 | | | |
|
299 | | | | |
300 | o | 4:9520eea781bc E |
|
300 | o | 4:9520eea781bc E | |
301 | |/ |
|
301 | |/ | |
302 | | @ 1:42ccdea3bb16 B |
|
302 | | @ 1:42ccdea3bb16 B | |
303 | |/ |
|
303 | |/ | |
304 | o 0:cd010b8cd998 A |
|
304 | o 0:cd010b8cd998 A | |
305 |
|
305 | |||
306 |
|
306 | |||
307 | $ cd .. |
|
307 | $ cd .. | |
308 |
|
308 | |||
309 | collapse rebase |
|
309 | collapse rebase | |
310 | --------------------------------- |
|
310 | --------------------------------- | |
311 |
|
311 | |||
312 | $ hg clone base collapse |
|
312 | $ hg clone base collapse | |
313 | updating to branch default |
|
313 | updating to branch default | |
314 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
314 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
315 | $ cd collapse |
|
315 | $ cd collapse | |
316 | $ hg rebase -s 42ccdea3bb16 -d eea13746799a --collapse |
|
316 | $ hg rebase -s 42ccdea3bb16 -d eea13746799a --collapse | |
317 | rebasing 1:42ccdea3bb16 "B" |
|
317 | rebasing 1:42ccdea3bb16 "B" | |
318 | rebasing 2:5fddd98957c8 "C" |
|
318 | rebasing 2:5fddd98957c8 "C" | |
319 | rebasing 3:32af7686d403 "D" |
|
319 | rebasing 3:32af7686d403 "D" | |
320 | $ hg log -G |
|
320 | $ hg log -G | |
321 | o 8:4dc2197e807b Collapsed revision |
|
321 | o 8:4dc2197e807b Collapsed revision | |
322 | | |
|
322 | | | |
323 | | @ 7:02de42196ebe H |
|
323 | | @ 7:02de42196ebe H | |
324 | | | |
|
324 | | | | |
325 | o | 6:eea13746799a G |
|
325 | o | 6:eea13746799a G | |
326 | |\| |
|
326 | |\| | |
327 | | o 5:24b6387c8c8c F |
|
327 | | o 5:24b6387c8c8c F | |
328 | | | |
|
328 | | | | |
329 | o | 4:9520eea781bc E |
|
329 | o | 4:9520eea781bc E | |
330 | |/ |
|
330 | |/ | |
331 | o 0:cd010b8cd998 A |
|
331 | o 0:cd010b8cd998 A | |
332 |
|
332 | |||
333 | $ hg log --hidden -G |
|
333 | $ hg log --hidden -G | |
334 | o 8:4dc2197e807b Collapsed revision |
|
334 | o 8:4dc2197e807b Collapsed revision | |
335 | | |
|
335 | | | |
336 | | @ 7:02de42196ebe H |
|
336 | | @ 7:02de42196ebe H | |
337 | | | |
|
337 | | | | |
338 | o | 6:eea13746799a G |
|
338 | o | 6:eea13746799a G | |
339 | |\| |
|
339 | |\| | |
340 | | o 5:24b6387c8c8c F |
|
340 | | o 5:24b6387c8c8c F | |
341 | | | |
|
341 | | | | |
342 | o | 4:9520eea781bc E |
|
342 | o | 4:9520eea781bc E | |
343 | |/ |
|
343 | |/ | |
344 | | x 3:32af7686d403 D |
|
344 | | x 3:32af7686d403 D | |
345 | | | |
|
345 | | | | |
346 | | x 2:5fddd98957c8 C |
|
346 | | x 2:5fddd98957c8 C | |
347 | | | |
|
347 | | | | |
348 | | x 1:42ccdea3bb16 B |
|
348 | | x 1:42ccdea3bb16 B | |
349 | |/ |
|
349 | |/ | |
350 | o 0:cd010b8cd998 A |
|
350 | o 0:cd010b8cd998 A | |
351 |
|
351 | |||
352 | $ hg id --debug -r tip |
|
352 | $ hg id --debug -r tip | |
353 | 4dc2197e807bae9817f09905b50ab288be2dbbcf tip |
|
353 | 4dc2197e807bae9817f09905b50ab288be2dbbcf tip | |
354 | $ hg debugobsolete |
|
354 | $ hg debugobsolete | |
355 | 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 4dc2197e807bae9817f09905b50ab288be2dbbcf 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} |
|
355 | 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 4dc2197e807bae9817f09905b50ab288be2dbbcf 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} | |
356 | 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 4dc2197e807bae9817f09905b50ab288be2dbbcf 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} |
|
356 | 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 4dc2197e807bae9817f09905b50ab288be2dbbcf 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} | |
357 | 32af7686d403cf45b5d95f2d70cebea587ac806a 4dc2197e807bae9817f09905b50ab288be2dbbcf 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} |
|
357 | 32af7686d403cf45b5d95f2d70cebea587ac806a 4dc2197e807bae9817f09905b50ab288be2dbbcf 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} | |
358 |
|
358 | |||
359 | $ cd .. |
|
359 | $ cd .. | |
360 |
|
360 | |||
361 | Rebase set has hidden descendants |
|
361 | Rebase set has hidden descendants | |
362 | --------------------------------- |
|
362 | --------------------------------- | |
363 |
|
363 | |||
364 | We rebase a changeset which has a hidden changeset. The hidden changeset must |
|
364 | We rebase a changeset which has a hidden changeset. The hidden changeset must | |
365 | not be rebased. |
|
365 | not be rebased. | |
366 |
|
366 | |||
367 | $ hg clone base hidden |
|
367 | $ hg clone base hidden | |
368 | updating to branch default |
|
368 | updating to branch default | |
369 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
369 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
370 | $ cd hidden |
|
370 | $ cd hidden | |
371 | $ hg rebase -s 5fddd98957c8 -d eea13746799a |
|
371 | $ hg rebase -s 5fddd98957c8 -d eea13746799a | |
372 | rebasing 2:5fddd98957c8 "C" |
|
372 | rebasing 2:5fddd98957c8 "C" | |
373 | rebasing 3:32af7686d403 "D" |
|
373 | rebasing 3:32af7686d403 "D" | |
374 | $ hg rebase -s 42ccdea3bb16 -d 02de42196ebe |
|
374 | $ hg rebase -s 42ccdea3bb16 -d 02de42196ebe | |
375 | rebasing 1:42ccdea3bb16 "B" |
|
375 | rebasing 1:42ccdea3bb16 "B" | |
376 | $ hg log -G |
|
376 | $ hg log -G | |
377 | o 10:7c6027df6a99 B |
|
377 | o 10:7c6027df6a99 B | |
378 | | |
|
378 | | | |
379 | | o 9:cf44d2f5a9f4 D |
|
379 | | o 9:cf44d2f5a9f4 D | |
380 | | | |
|
380 | | | | |
381 | | o 8:e273c5e7d2d2 C |
|
381 | | o 8:e273c5e7d2d2 C | |
382 | | | |
|
382 | | | | |
383 | @ | 7:02de42196ebe H |
|
383 | @ | 7:02de42196ebe H | |
384 | | | |
|
384 | | | | |
385 | | o 6:eea13746799a G |
|
385 | | o 6:eea13746799a G | |
386 | |/| |
|
386 | |/| | |
387 | o | 5:24b6387c8c8c F |
|
387 | o | 5:24b6387c8c8c F | |
388 | | | |
|
388 | | | | |
389 | | o 4:9520eea781bc E |
|
389 | | o 4:9520eea781bc E | |
390 | |/ |
|
390 | |/ | |
391 | o 0:cd010b8cd998 A |
|
391 | o 0:cd010b8cd998 A | |
392 |
|
392 | |||
393 | $ hg log --hidden -G |
|
393 | $ hg log --hidden -G | |
394 | o 10:7c6027df6a99 B |
|
394 | o 10:7c6027df6a99 B | |
395 | | |
|
395 | | | |
396 | | o 9:cf44d2f5a9f4 D |
|
396 | | o 9:cf44d2f5a9f4 D | |
397 | | | |
|
397 | | | | |
398 | | o 8:e273c5e7d2d2 C |
|
398 | | o 8:e273c5e7d2d2 C | |
399 | | | |
|
399 | | | | |
400 | @ | 7:02de42196ebe H |
|
400 | @ | 7:02de42196ebe H | |
401 | | | |
|
401 | | | | |
402 | | o 6:eea13746799a G |
|
402 | | o 6:eea13746799a G | |
403 | |/| |
|
403 | |/| | |
404 | o | 5:24b6387c8c8c F |
|
404 | o | 5:24b6387c8c8c F | |
405 | | | |
|
405 | | | | |
406 | | o 4:9520eea781bc E |
|
406 | | o 4:9520eea781bc E | |
407 | |/ |
|
407 | |/ | |
408 | | x 3:32af7686d403 D |
|
408 | | x 3:32af7686d403 D | |
409 | | | |
|
409 | | | | |
410 | | x 2:5fddd98957c8 C |
|
410 | | x 2:5fddd98957c8 C | |
411 | | | |
|
411 | | | | |
412 | | x 1:42ccdea3bb16 B |
|
412 | | x 1:42ccdea3bb16 B | |
413 | |/ |
|
413 | |/ | |
414 | o 0:cd010b8cd998 A |
|
414 | o 0:cd010b8cd998 A | |
415 |
|
415 | |||
416 | $ hg debugobsolete |
|
416 | $ hg debugobsolete | |
417 | 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b e273c5e7d2d29df783dce9f9eaa3ac4adc69c15d 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} |
|
417 | 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b e273c5e7d2d29df783dce9f9eaa3ac4adc69c15d 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} | |
418 | 32af7686d403cf45b5d95f2d70cebea587ac806a cf44d2f5a9f4297a62be94cbdd3dff7c7dc54258 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} |
|
418 | 32af7686d403cf45b5d95f2d70cebea587ac806a cf44d2f5a9f4297a62be94cbdd3dff7c7dc54258 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} | |
419 | 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 7c6027df6a99d93f461868e5433f63bde20b6dfb 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} |
|
419 | 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 7c6027df6a99d93f461868e5433f63bde20b6dfb 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} | |
420 |
|
420 | |||
421 | Test that rewriting leaving instability behind is allowed |
|
421 | Test that rewriting leaving instability behind is allowed | |
422 | --------------------------------------------------------------------- |
|
422 | --------------------------------------------------------------------- | |
423 |
|
423 | |||
424 | $ hg log -r 'children(8)' |
|
424 | $ hg log -r 'children(8)' | |
425 | 9:cf44d2f5a9f4 D (no-eol) |
|
425 | 9:cf44d2f5a9f4 D (no-eol) | |
426 | $ hg rebase -r 8 |
|
426 | $ hg rebase -r 8 | |
427 | rebasing 8:e273c5e7d2d2 "C" |
|
427 | rebasing 8:e273c5e7d2d2 "C" | |
428 | $ hg log -G |
|
428 | $ hg log -G | |
429 | o 11:0d8f238b634c C |
|
429 | o 11:0d8f238b634c C | |
430 | | |
|
430 | | | |
431 | o 10:7c6027df6a99 B |
|
431 | o 10:7c6027df6a99 B | |
432 | | |
|
432 | | | |
433 | | o 9:cf44d2f5a9f4 D |
|
433 | | o 9:cf44d2f5a9f4 D | |
434 | | | |
|
434 | | | | |
435 | | x 8:e273c5e7d2d2 C |
|
435 | | x 8:e273c5e7d2d2 C | |
436 | | | |
|
436 | | | | |
437 | @ | 7:02de42196ebe H |
|
437 | @ | 7:02de42196ebe H | |
438 | | | |
|
438 | | | | |
439 | | o 6:eea13746799a G |
|
439 | | o 6:eea13746799a G | |
440 | |/| |
|
440 | |/| | |
441 | o | 5:24b6387c8c8c F |
|
441 | o | 5:24b6387c8c8c F | |
442 | | | |
|
442 | | | | |
443 | | o 4:9520eea781bc E |
|
443 | | o 4:9520eea781bc E | |
444 | |/ |
|
444 | |/ | |
445 | o 0:cd010b8cd998 A |
|
445 | o 0:cd010b8cd998 A | |
446 |
|
446 | |||
447 |
|
447 | |||
448 |
|
448 | |||
449 | Test multiple root handling |
|
449 | Test multiple root handling | |
450 | ------------------------------------ |
|
450 | ------------------------------------ | |
451 |
|
451 | |||
452 | $ hg rebase --dest 4 --rev '7+11+9' |
|
452 | $ hg rebase --dest 4 --rev '7+11+9' | |
453 | rebasing 9:cf44d2f5a9f4 "D" |
|
453 | rebasing 9:cf44d2f5a9f4 "D" | |
454 | rebasing 7:02de42196ebe "H" |
|
454 | rebasing 7:02de42196ebe "H" | |
455 | rebasing 11:0d8f238b634c "C" (tip) |
|
455 | rebasing 11:0d8f238b634c "C" (tip) | |
456 | $ hg log -G |
|
456 | $ hg log -G | |
457 | o 14:1e8370e38cca C |
|
457 | o 14:1e8370e38cca C | |
458 | | |
|
458 | | | |
459 | @ 13:bfe264faf697 H |
|
459 | @ 13:bfe264faf697 H | |
460 | | |
|
460 | | | |
461 | | o 12:102b4c1d889b D |
|
461 | | o 12:102b4c1d889b D | |
462 | |/ |
|
462 | |/ | |
463 | | o 10:7c6027df6a99 B |
|
463 | | o 10:7c6027df6a99 B | |
464 | | | |
|
464 | | | | |
465 | | x 7:02de42196ebe H |
|
465 | | x 7:02de42196ebe H | |
466 | | | |
|
466 | | | | |
467 | +---o 6:eea13746799a G |
|
467 | +---o 6:eea13746799a G | |
468 | | |/ |
|
468 | | |/ | |
469 | | o 5:24b6387c8c8c F |
|
469 | | o 5:24b6387c8c8c F | |
470 | | | |
|
470 | | | | |
471 | o | 4:9520eea781bc E |
|
471 | o | 4:9520eea781bc E | |
472 | |/ |
|
472 | |/ | |
473 | o 0:cd010b8cd998 A |
|
473 | o 0:cd010b8cd998 A | |
474 |
|
474 | |||
475 | $ cd .. |
|
475 | $ cd .. | |
476 |
|
476 | |||
477 | Detach both parents |
|
477 | Detach both parents | |
478 |
|
478 | |||
479 | $ hg init double-detach |
|
479 | $ hg init double-detach | |
480 | $ cd double-detach |
|
480 | $ cd double-detach | |
481 |
|
481 | |||
482 | $ hg debugdrawdag <<EOF |
|
482 | $ hg debugdrawdag <<EOF | |
483 | > F |
|
483 | > F | |
484 | > /| |
|
484 | > /| | |
485 | > C E |
|
485 | > C E | |
486 | > | | |
|
486 | > | | | |
487 | > B D G |
|
487 | > B D G | |
488 | > \|/ |
|
488 | > \|/ | |
489 | > A |
|
489 | > A | |
490 | > EOF |
|
490 | > EOF | |
491 |
|
491 | |||
492 | $ hg rebase -d G -r 'B + D + F' |
|
492 | $ hg rebase -d G -r 'B + D + F' | |
493 | rebasing 1:112478962961 "B" (B) |
|
493 | rebasing 1:112478962961 "B" (B) | |
494 | rebasing 2:b18e25de2cf5 "D" (D) |
|
494 | rebasing 2:b18e25de2cf5 "D" (D) | |
495 | rebasing 6:f15c3adaf214 "F" (F tip) |
|
495 | rebasing 6:f15c3adaf214 "F" (F tip) | |
496 | abort: cannot rebase 6:f15c3adaf214 without moving at least one of its parents |
|
496 | abort: cannot rebase 6:f15c3adaf214 without moving at least one of its parents | |
497 | [255] |
|
497 | [255] | |
498 |
|
498 | |||
499 | $ cd .. |
|
499 | $ cd .. | |
500 |
|
500 | |||
501 | test on rebase dropping a merge |
|
501 | test on rebase dropping a merge | |
502 |
|
502 | |||
503 | (setup) |
|
503 | (setup) | |
504 |
|
504 | |||
505 | $ hg init dropmerge |
|
505 | $ hg init dropmerge | |
506 | $ cd dropmerge |
|
506 | $ cd dropmerge | |
507 | $ hg unbundle "$TESTDIR/bundles/rebase.hg" |
|
507 | $ hg unbundle "$TESTDIR/bundles/rebase.hg" | |
508 | adding changesets |
|
508 | adding changesets | |
509 | adding manifests |
|
509 | adding manifests | |
510 | adding file changes |
|
510 | adding file changes | |
511 | added 8 changesets with 7 changes to 7 files (+2 heads) |
|
511 | added 8 changesets with 7 changes to 7 files (+2 heads) | |
512 | new changesets cd010b8cd998:02de42196ebe |
|
512 | new changesets cd010b8cd998:02de42196ebe | |
513 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
513 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
514 | $ hg up 3 |
|
514 | $ hg up 3 | |
515 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
515 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
516 | $ hg merge 7 |
|
516 | $ hg merge 7 | |
517 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
517 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
518 | (branch merge, don't forget to commit) |
|
518 | (branch merge, don't forget to commit) | |
519 | $ hg ci -m 'M' |
|
519 | $ hg ci -m 'M' | |
520 | $ echo I > I |
|
520 | $ echo I > I | |
521 | $ hg add I |
|
521 | $ hg add I | |
522 | $ hg ci -m I |
|
522 | $ hg ci -m I | |
523 | $ hg log -G |
|
523 | $ hg log -G | |
524 | @ 9:4bde274eefcf I |
|
524 | @ 9:4bde274eefcf I | |
525 | | |
|
525 | | | |
526 | o 8:53a6a128b2b7 M |
|
526 | o 8:53a6a128b2b7 M | |
527 | |\ |
|
527 | |\ | |
528 | | o 7:02de42196ebe H |
|
528 | | o 7:02de42196ebe H | |
529 | | | |
|
529 | | | | |
530 | | | o 6:eea13746799a G |
|
530 | | | o 6:eea13746799a G | |
531 | | |/| |
|
531 | | |/| | |
532 | | o | 5:24b6387c8c8c F |
|
532 | | o | 5:24b6387c8c8c F | |
533 | | | | |
|
533 | | | | | |
534 | | | o 4:9520eea781bc E |
|
534 | | | o 4:9520eea781bc E | |
535 | | |/ |
|
535 | | |/ | |
536 | o | 3:32af7686d403 D |
|
536 | o | 3:32af7686d403 D | |
537 | | | |
|
537 | | | | |
538 | o | 2:5fddd98957c8 C |
|
538 | o | 2:5fddd98957c8 C | |
539 | | | |
|
539 | | | | |
540 | o | 1:42ccdea3bb16 B |
|
540 | o | 1:42ccdea3bb16 B | |
541 | |/ |
|
541 | |/ | |
542 | o 0:cd010b8cd998 A |
|
542 | o 0:cd010b8cd998 A | |
543 |
|
543 | |||
544 | (actual test) |
|
544 | (actual test) | |
545 |
|
545 | |||
546 | $ hg rebase --dest 6 --rev '((desc(H) + desc(D))::) - desc(M)' |
|
546 | $ hg rebase --dest 6 --rev '((desc(H) + desc(D))::) - desc(M)' | |
547 | rebasing 3:32af7686d403 "D" |
|
547 | rebasing 3:32af7686d403 "D" | |
548 | rebasing 7:02de42196ebe "H" |
|
548 | rebasing 7:02de42196ebe "H" | |
549 | rebasing 9:4bde274eefcf "I" (tip) |
|
549 | rebasing 9:4bde274eefcf "I" (tip) | |
550 | $ hg log -G |
|
550 | $ hg log -G | |
551 | @ 12:acd174b7ab39 I |
|
551 | @ 12:acd174b7ab39 I | |
552 | | |
|
552 | | | |
553 | o 11:6c11a6218c97 H |
|
553 | o 11:6c11a6218c97 H | |
554 | | |
|
554 | | | |
555 | | o 10:b5313c85b22e D |
|
555 | | o 10:b5313c85b22e D | |
556 | |/ |
|
556 | |/ | |
557 | | o 8:53a6a128b2b7 M |
|
557 | | o 8:53a6a128b2b7 M | |
558 | | |\ |
|
558 | | |\ | |
559 | | | x 7:02de42196ebe H |
|
559 | | | x 7:02de42196ebe H | |
560 | | | | |
|
560 | | | | | |
561 | o---+ 6:eea13746799a G |
|
561 | o---+ 6:eea13746799a G | |
562 | | | | |
|
562 | | | | | |
563 | | | o 5:24b6387c8c8c F |
|
563 | | | o 5:24b6387c8c8c F | |
564 | | | | |
|
564 | | | | | |
565 | o---+ 4:9520eea781bc E |
|
565 | o---+ 4:9520eea781bc E | |
566 | / / |
|
566 | / / | |
567 | x | 3:32af7686d403 D |
|
567 | x | 3:32af7686d403 D | |
568 | | | |
|
568 | | | | |
569 | o | 2:5fddd98957c8 C |
|
569 | o | 2:5fddd98957c8 C | |
570 | | | |
|
570 | | | | |
571 | o | 1:42ccdea3bb16 B |
|
571 | o | 1:42ccdea3bb16 B | |
572 | |/ |
|
572 | |/ | |
573 | o 0:cd010b8cd998 A |
|
573 | o 0:cd010b8cd998 A | |
574 |
|
574 | |||
575 |
|
575 | |||
576 | Test hidden changesets in the rebase set (issue4504) |
|
576 | Test hidden changesets in the rebase set (issue4504) | |
577 |
|
577 | |||
578 | $ hg up --hidden 9 |
|
578 | $ hg up --hidden 9 | |
579 | 3 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
579 | 3 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
580 | $ echo J > J |
|
580 | $ echo J > J | |
581 | $ hg add J |
|
581 | $ hg add J | |
582 | $ hg commit -m J |
|
582 | $ hg commit -m J | |
583 | $ hg debugobsolete `hg log --rev . -T '{node}'` |
|
583 | $ hg debugobsolete `hg log --rev . -T '{node}'` | |
584 | obsoleted 1 changesets |
|
584 | obsoleted 1 changesets | |
585 |
|
585 | |||
586 | $ hg rebase --rev .~1::. --dest 'max(desc(D))' --traceback --config experimental.rebaseskipobsolete=off |
|
586 | $ hg rebase --rev .~1::. --dest 'max(desc(D))' --traceback --config experimental.rebaseskipobsolete=off | |
587 | rebasing 9:4bde274eefcf "I" |
|
587 | rebasing 9:4bde274eefcf "I" | |
588 | rebasing 13:06edfc82198f "J" (tip) |
|
588 | rebasing 13:06edfc82198f "J" (tip) | |
589 | $ hg log -G |
|
589 | $ hg log -G | |
590 | @ 15:5ae8a643467b J |
|
590 | @ 15:5ae8a643467b J | |
591 | | |
|
591 | | | |
592 | o 14:9ad579b4a5de I |
|
592 | o 14:9ad579b4a5de I | |
593 | | |
|
593 | | | |
594 | | o 12:acd174b7ab39 I |
|
594 | | o 12:acd174b7ab39 I | |
595 | | | |
|
595 | | | | |
596 | | o 11:6c11a6218c97 H |
|
596 | | o 11:6c11a6218c97 H | |
597 | | | |
|
597 | | | | |
598 | o | 10:b5313c85b22e D |
|
598 | o | 10:b5313c85b22e D | |
599 | |/ |
|
599 | |/ | |
600 | | o 8:53a6a128b2b7 M |
|
600 | | o 8:53a6a128b2b7 M | |
601 | | |\ |
|
601 | | |\ | |
602 | | | x 7:02de42196ebe H |
|
602 | | | x 7:02de42196ebe H | |
603 | | | | |
|
603 | | | | | |
604 | o---+ 6:eea13746799a G |
|
604 | o---+ 6:eea13746799a G | |
605 | | | | |
|
605 | | | | | |
606 | | | o 5:24b6387c8c8c F |
|
606 | | | o 5:24b6387c8c8c F | |
607 | | | | |
|
607 | | | | | |
608 | o---+ 4:9520eea781bc E |
|
608 | o---+ 4:9520eea781bc E | |
609 | / / |
|
609 | / / | |
610 | x | 3:32af7686d403 D |
|
610 | x | 3:32af7686d403 D | |
611 | | | |
|
611 | | | | |
612 | o | 2:5fddd98957c8 C |
|
612 | o | 2:5fddd98957c8 C | |
613 | | | |
|
613 | | | | |
614 | o | 1:42ccdea3bb16 B |
|
614 | o | 1:42ccdea3bb16 B | |
615 | |/ |
|
615 | |/ | |
616 | o 0:cd010b8cd998 A |
|
616 | o 0:cd010b8cd998 A | |
617 |
|
617 | |||
618 | $ hg up 14 -C |
|
618 | $ hg up 14 -C | |
619 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
619 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
620 | $ echo "K" > K |
|
620 | $ echo "K" > K | |
621 | $ hg add K |
|
621 | $ hg add K | |
622 | $ hg commit --amend -m "K" |
|
622 | $ hg commit --amend -m "K" | |
623 | $ echo "L" > L |
|
623 | $ echo "L" > L | |
624 | $ hg add L |
|
624 | $ hg add L | |
625 | $ hg commit -m "L" |
|
625 | $ hg commit -m "L" | |
626 | $ hg up '.^' |
|
626 | $ hg up '.^' | |
627 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
627 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
628 | $ echo "M" > M |
|
628 | $ echo "M" > M | |
629 | $ hg add M |
|
629 | $ hg add M | |
630 | $ hg commit --amend -m "M" |
|
630 | $ hg commit --amend -m "M" | |
631 | $ hg log -G |
|
631 | $ hg log -G | |
632 | @ 18:bfaedf8eb73b M |
|
632 | @ 18:bfaedf8eb73b M | |
633 | | |
|
633 | | | |
634 | | o 17:97219452e4bd L |
|
634 | | o 17:97219452e4bd L | |
635 | | | |
|
635 | | | | |
636 | | x 16:fc37a630c901 K |
|
636 | | x 16:fc37a630c901 K | |
637 | |/ |
|
637 | |/ | |
638 | | o 15:5ae8a643467b J |
|
638 | | o 15:5ae8a643467b J | |
639 | | | |
|
639 | | | | |
640 | | x 14:9ad579b4a5de I |
|
640 | | x 14:9ad579b4a5de I | |
641 | |/ |
|
641 | |/ | |
642 | | o 12:acd174b7ab39 I |
|
642 | | o 12:acd174b7ab39 I | |
643 | | | |
|
643 | | | | |
644 | | o 11:6c11a6218c97 H |
|
644 | | o 11:6c11a6218c97 H | |
645 | | | |
|
645 | | | | |
646 | o | 10:b5313c85b22e D |
|
646 | o | 10:b5313c85b22e D | |
647 | |/ |
|
647 | |/ | |
648 | | o 8:53a6a128b2b7 M |
|
648 | | o 8:53a6a128b2b7 M | |
649 | | |\ |
|
649 | | |\ | |
650 | | | x 7:02de42196ebe H |
|
650 | | | x 7:02de42196ebe H | |
651 | | | | |
|
651 | | | | | |
652 | o---+ 6:eea13746799a G |
|
652 | o---+ 6:eea13746799a G | |
653 | | | | |
|
653 | | | | | |
654 | | | o 5:24b6387c8c8c F |
|
654 | | | o 5:24b6387c8c8c F | |
655 | | | | |
|
655 | | | | | |
656 | o---+ 4:9520eea781bc E |
|
656 | o---+ 4:9520eea781bc E | |
657 | / / |
|
657 | / / | |
658 | x | 3:32af7686d403 D |
|
658 | x | 3:32af7686d403 D | |
659 | | | |
|
659 | | | | |
660 | o | 2:5fddd98957c8 C |
|
660 | o | 2:5fddd98957c8 C | |
661 | | | |
|
661 | | | | |
662 | o | 1:42ccdea3bb16 B |
|
662 | o | 1:42ccdea3bb16 B | |
663 | |/ |
|
663 | |/ | |
664 | o 0:cd010b8cd998 A |
|
664 | o 0:cd010b8cd998 A | |
665 |
|
665 | |||
666 | $ hg rebase -s 14 -d 17 --config experimental.rebaseskipobsolete=True |
|
666 | $ hg rebase -s 14 -d 17 --config experimental.rebaseskipobsolete=True | |
667 | note: not rebasing 14:9ad579b4a5de "I", already in destination as 16:fc37a630c901 "K" |
|
667 | note: not rebasing 14:9ad579b4a5de "I", already in destination as 16:fc37a630c901 "K" | |
668 | rebasing 15:5ae8a643467b "J" |
|
668 | rebasing 15:5ae8a643467b "J" | |
669 |
|
669 | |||
670 | $ cd .. |
|
670 | $ cd .. | |
671 |
|
671 | |||
672 | Skip obsolete changeset even with multiple hops |
|
672 | Skip obsolete changeset even with multiple hops | |
673 | ----------------------------------------------- |
|
673 | ----------------------------------------------- | |
674 |
|
674 | |||
675 | setup |
|
675 | setup | |
676 |
|
676 | |||
677 | $ hg init obsskip |
|
677 | $ hg init obsskip | |
678 | $ cd obsskip |
|
678 | $ cd obsskip | |
679 | $ cat << EOF >> .hg/hgrc |
|
679 | $ cat << EOF >> .hg/hgrc | |
680 | > [experimental] |
|
680 | > [experimental] | |
681 | > rebaseskipobsolete = True |
|
681 | > rebaseskipobsolete = True | |
682 | > [extensions] |
|
682 | > [extensions] | |
683 | > strip = |
|
683 | > strip = | |
684 | > EOF |
|
684 | > EOF | |
685 | $ echo A > A |
|
685 | $ echo A > A | |
686 | $ hg add A |
|
686 | $ hg add A | |
687 | $ hg commit -m A |
|
687 | $ hg commit -m A | |
688 | $ echo B > B |
|
688 | $ echo B > B | |
689 | $ hg add B |
|
689 | $ hg add B | |
690 | $ hg commit -m B0 |
|
690 | $ hg commit -m B0 | |
691 | $ hg commit --amend -m B1 |
|
691 | $ hg commit --amend -m B1 | |
692 | $ hg commit --amend -m B2 |
|
692 | $ hg commit --amend -m B2 | |
693 | $ hg up --hidden 'desc(B0)' |
|
693 | $ hg up --hidden 'desc(B0)' | |
694 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
694 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
695 | $ echo C > C |
|
695 | $ echo C > C | |
696 | $ hg add C |
|
696 | $ hg add C | |
697 | $ hg commit -m C |
|
697 | $ hg commit -m C | |
698 |
|
698 | |||
699 | Rebase finds its way in a chain of marker |
|
699 | Rebase finds its way in a chain of marker | |
700 |
|
700 | |||
701 | $ hg rebase -d 'desc(B2)' |
|
701 | $ hg rebase -d 'desc(B2)' | |
702 | note: not rebasing 1:a8b11f55fb19 "B0", already in destination as 3:261e70097290 "B2" |
|
702 | note: not rebasing 1:a8b11f55fb19 "B0", already in destination as 3:261e70097290 "B2" | |
703 | rebasing 4:212cb178bcbb "C" (tip) |
|
703 | rebasing 4:212cb178bcbb "C" (tip) | |
704 |
|
704 | |||
705 | Even when the chain include missing node |
|
705 | Even when the chain include missing node | |
706 |
|
706 | |||
707 | $ hg up --hidden 'desc(B0)' |
|
707 | $ hg up --hidden 'desc(B0)' | |
708 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
708 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
709 | $ echo D > D |
|
709 | $ echo D > D | |
710 | $ hg add D |
|
710 | $ hg add D | |
711 | $ hg commit -m D |
|
711 | $ hg commit -m D | |
712 | $ hg --hidden strip -r 'desc(B1)' |
|
712 | $ hg --hidden strip -r 'desc(B1)' | |
713 | saved backup bundle to $TESTTMP/obsskip/.hg/strip-backup/86f6414ccda7-b1c452ee-backup.hg (glob) |
|
713 | saved backup bundle to $TESTTMP/obsskip/.hg/strip-backup/86f6414ccda7-b1c452ee-backup.hg (glob) | |
714 |
|
714 | |||
715 | $ hg rebase -d 'desc(B2)' |
|
715 | $ hg rebase -d 'desc(B2)' | |
716 | note: not rebasing 1:a8b11f55fb19 "B0", already in destination as 2:261e70097290 "B2" |
|
716 | note: not rebasing 1:a8b11f55fb19 "B0", already in destination as 2:261e70097290 "B2" | |
717 | rebasing 5:1a79b7535141 "D" (tip) |
|
717 | rebasing 5:1a79b7535141 "D" (tip) | |
718 | $ hg up 4 |
|
718 | $ hg up 4 | |
719 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
719 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
720 | $ echo "O" > O |
|
720 | $ echo "O" > O | |
721 | $ hg add O |
|
721 | $ hg add O | |
722 | $ hg commit -m O |
|
722 | $ hg commit -m O | |
723 | $ echo "P" > P |
|
723 | $ echo "P" > P | |
724 | $ hg add P |
|
724 | $ hg add P | |
725 | $ hg commit -m P |
|
725 | $ hg commit -m P | |
726 | $ hg log -G |
|
726 | $ hg log -G | |
727 | @ 8:8d47583e023f P |
|
727 | @ 8:8d47583e023f P | |
728 | | |
|
728 | | | |
729 | o 7:360bbaa7d3ce O |
|
729 | o 7:360bbaa7d3ce O | |
730 | | |
|
730 | | | |
731 | | o 6:9c48361117de D |
|
731 | | o 6:9c48361117de D | |
732 | | | |
|
732 | | | | |
733 | o | 4:ff2c4d47b71d C |
|
733 | o | 4:ff2c4d47b71d C | |
734 | |/ |
|
734 | |/ | |
735 | o 2:261e70097290 B2 |
|
735 | o 2:261e70097290 B2 | |
736 | | |
|
736 | | | |
737 | o 0:4a2df7238c3b A |
|
737 | o 0:4a2df7238c3b A | |
738 |
|
738 | |||
739 | $ hg debugobsolete `hg log -r 7 -T '{node}\n'` --config experimental.evolution=true |
|
739 | $ hg debugobsolete `hg log -r 7 -T '{node}\n'` --config experimental.evolution=true | |
740 | obsoleted 1 changesets |
|
740 | obsoleted 1 changesets | |
741 | $ hg rebase -d 6 -r "4::" |
|
741 | $ hg rebase -d 6 -r "4::" | |
742 | rebasing 4:ff2c4d47b71d "C" |
|
742 | rebasing 4:ff2c4d47b71d "C" | |
743 | note: not rebasing 7:360bbaa7d3ce "O", it has no successor |
|
743 | note: not rebasing 7:360bbaa7d3ce "O", it has no successor | |
744 | rebasing 8:8d47583e023f "P" (tip) |
|
744 | rebasing 8:8d47583e023f "P" (tip) | |
745 |
|
745 | |||
746 | If all the changeset to be rebased are obsolete and present in the destination, we |
|
746 | If all the changeset to be rebased are obsolete and present in the destination, we | |
747 | should display a friendly error message |
|
747 | should display a friendly error message | |
748 |
|
748 | |||
749 | $ hg log -G |
|
749 | $ hg log -G | |
750 | @ 10:121d9e3bc4c6 P |
|
750 | @ 10:121d9e3bc4c6 P | |
751 | | |
|
751 | | | |
752 | o 9:4be60e099a77 C |
|
752 | o 9:4be60e099a77 C | |
753 | | |
|
753 | | | |
754 | o 6:9c48361117de D |
|
754 | o 6:9c48361117de D | |
755 | | |
|
755 | | | |
756 | o 2:261e70097290 B2 |
|
756 | o 2:261e70097290 B2 | |
757 | | |
|
757 | | | |
758 | o 0:4a2df7238c3b A |
|
758 | o 0:4a2df7238c3b A | |
759 |
|
759 | |||
760 |
|
760 | |||
761 | $ hg up 9 |
|
761 | $ hg up 9 | |
762 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
762 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
763 | $ echo "non-relevant change" > nonrelevant |
|
763 | $ echo "non-relevant change" > nonrelevant | |
764 | $ hg add nonrelevant |
|
764 | $ hg add nonrelevant | |
765 | $ hg commit -m nonrelevant |
|
765 | $ hg commit -m nonrelevant | |
766 | created new head |
|
766 | created new head | |
767 | $ hg debugobsolete `hg log -r 11 -T '{node}\n'` --config experimental.evolution=true |
|
767 | $ hg debugobsolete `hg log -r 11 -T '{node}\n'` --config experimental.evolution=true | |
768 | obsoleted 1 changesets |
|
768 | obsoleted 1 changesets | |
769 | $ hg rebase -r . -d 10 |
|
769 | $ hg rebase -r . -d 10 | |
770 | note: not rebasing 11:f44da1f4954c "nonrelevant" (tip), it has no successor |
|
770 | note: not rebasing 11:f44da1f4954c "nonrelevant" (tip), it has no successor | |
771 |
|
771 | |||
772 | If a rebase is going to create divergence, it should abort |
|
772 | If a rebase is going to create divergence, it should abort | |
773 |
|
773 | |||
774 | $ hg log -G |
|
774 | $ hg log -G | |
775 | @ 10:121d9e3bc4c6 P |
|
775 | @ 10:121d9e3bc4c6 P | |
776 | | |
|
776 | | | |
777 | o 9:4be60e099a77 C |
|
777 | o 9:4be60e099a77 C | |
778 | | |
|
778 | | | |
779 | o 6:9c48361117de D |
|
779 | o 6:9c48361117de D | |
780 | | |
|
780 | | | |
781 | o 2:261e70097290 B2 |
|
781 | o 2:261e70097290 B2 | |
782 | | |
|
782 | | | |
783 | o 0:4a2df7238c3b A |
|
783 | o 0:4a2df7238c3b A | |
784 |
|
784 | |||
785 |
|
785 | |||
786 | $ hg up 9 |
|
786 | $ hg up 9 | |
787 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
787 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
788 | $ echo "john" > doe |
|
788 | $ echo "john" > doe | |
789 | $ hg add doe |
|
789 | $ hg add doe | |
790 | $ hg commit -m "john doe" |
|
790 | $ hg commit -m "john doe" | |
791 | created new head |
|
791 | created new head | |
792 | $ hg up 10 |
|
792 | $ hg up 10 | |
793 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
793 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
794 | $ echo "foo" > bar |
|
794 | $ echo "foo" > bar | |
795 | $ hg add bar |
|
795 | $ hg add bar | |
796 | $ hg commit --amend -m "10'" |
|
796 | $ hg commit --amend -m "10'" | |
797 | $ hg up 10 --hidden |
|
797 | $ hg up 10 --hidden | |
798 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
798 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
799 | $ echo "bar" > foo |
|
799 | $ echo "bar" > foo | |
800 | $ hg add foo |
|
800 | $ hg add foo | |
801 | $ hg commit -m "bar foo" |
|
801 | $ hg commit -m "bar foo" | |
802 | $ hg log -G |
|
802 | $ hg log -G | |
803 | @ 14:73568ab6879d bar foo |
|
803 | @ 14:73568ab6879d bar foo | |
804 | | |
|
804 | | | |
805 | | o 13:77d874d096a2 10' |
|
805 | | o 13:77d874d096a2 10' | |
806 | | | |
|
806 | | | | |
807 | | | o 12:3eb461388009 john doe |
|
807 | | | o 12:3eb461388009 john doe | |
808 | | |/ |
|
808 | | |/ | |
809 | x | 10:121d9e3bc4c6 P |
|
809 | x | 10:121d9e3bc4c6 P | |
810 | |/ |
|
810 | |/ | |
811 | o 9:4be60e099a77 C |
|
811 | o 9:4be60e099a77 C | |
812 | | |
|
812 | | | |
813 | o 6:9c48361117de D |
|
813 | o 6:9c48361117de D | |
814 | | |
|
814 | | | |
815 | o 2:261e70097290 B2 |
|
815 | o 2:261e70097290 B2 | |
816 | | |
|
816 | | | |
817 | o 0:4a2df7238c3b A |
|
817 | o 0:4a2df7238c3b A | |
818 |
|
818 | |||
819 | $ hg summary |
|
819 | $ hg summary | |
820 | parent: 14:73568ab6879d tip (orphan) |
|
820 | parent: 14:73568ab6879d tip (orphan) | |
821 | bar foo |
|
821 | bar foo | |
822 | branch: default |
|
822 | branch: default | |
823 | commit: (clean) |
|
823 | commit: (clean) | |
824 | update: 2 new changesets, 3 branch heads (merge) |
|
824 | update: 2 new changesets, 3 branch heads (merge) | |
825 | phases: 8 draft |
|
825 | phases: 8 draft | |
826 | orphan: 1 changesets |
|
826 | orphan: 1 changesets | |
827 | $ hg rebase -s 10 -d 12 |
|
827 | $ hg rebase -s 10 -d 12 | |
828 | abort: this rebase will cause divergences from: 121d9e3bc4c6 |
|
828 | abort: this rebase will cause divergences from: 121d9e3bc4c6 | |
829 | (to force the rebase please set experimental.allowdivergence=True) |
|
829 | (to force the rebase please set experimental.allowdivergence=True) | |
830 | [255] |
|
830 | [255] | |
831 | $ hg log -G |
|
831 | $ hg log -G | |
832 | @ 14:73568ab6879d bar foo |
|
832 | @ 14:73568ab6879d bar foo | |
833 | | |
|
833 | | | |
834 | | o 13:77d874d096a2 10' |
|
834 | | o 13:77d874d096a2 10' | |
835 | | | |
|
835 | | | | |
836 | | | o 12:3eb461388009 john doe |
|
836 | | | o 12:3eb461388009 john doe | |
837 | | |/ |
|
837 | | |/ | |
838 | x | 10:121d9e3bc4c6 P |
|
838 | x | 10:121d9e3bc4c6 P | |
839 | |/ |
|
839 | |/ | |
840 | o 9:4be60e099a77 C |
|
840 | o 9:4be60e099a77 C | |
841 | | |
|
841 | | | |
842 | o 6:9c48361117de D |
|
842 | o 6:9c48361117de D | |
843 | | |
|
843 | | | |
844 | o 2:261e70097290 B2 |
|
844 | o 2:261e70097290 B2 | |
845 | | |
|
845 | | | |
846 | o 0:4a2df7238c3b A |
|
846 | o 0:4a2df7238c3b A | |
847 |
|
847 | |||
848 | With experimental.allowdivergence=True, rebase can create divergence |
|
848 | With experimental.allowdivergence=True, rebase can create divergence | |
849 |
|
849 | |||
850 | $ hg rebase -s 10 -d 12 --config experimental.allowdivergence=True |
|
850 | $ hg rebase -s 10 -d 12 --config experimental.allowdivergence=True | |
851 | rebasing 10:121d9e3bc4c6 "P" |
|
851 | rebasing 10:121d9e3bc4c6 "P" | |
852 | rebasing 14:73568ab6879d "bar foo" (tip) |
|
852 | rebasing 14:73568ab6879d "bar foo" (tip) | |
853 | $ hg summary |
|
853 | $ hg summary | |
854 | parent: 16:61bd55f69bc4 tip |
|
854 | parent: 16:61bd55f69bc4 tip | |
855 | bar foo |
|
855 | bar foo | |
856 | branch: default |
|
856 | branch: default | |
857 | commit: (clean) |
|
857 | commit: (clean) | |
858 | update: 1 new changesets, 2 branch heads (merge) |
|
858 | update: 1 new changesets, 2 branch heads (merge) | |
859 | phases: 8 draft |
|
859 | phases: 8 draft | |
860 | content-divergent: 2 changesets |
|
860 | content-divergent: 2 changesets | |
861 |
|
861 | |||
862 | rebase --continue + skipped rev because their successors are in destination |
|
862 | rebase --continue + skipped rev because their successors are in destination | |
863 | we make a change in trunk and work on conflicting changes to make rebase abort. |
|
863 | we make a change in trunk and work on conflicting changes to make rebase abort. | |
864 |
|
864 | |||
865 | $ hg log -G -r 16:: |
|
865 | $ hg log -G -r 16:: | |
866 | @ 16:61bd55f69bc4 bar foo |
|
866 | @ 16:61bd55f69bc4 bar foo | |
867 | | |
|
867 | | | |
868 | ~ |
|
868 | ~ | |
869 |
|
869 | |||
870 | Create the two changes in trunk |
|
870 | Create the two changes in trunk | |
871 | $ printf "a" > willconflict |
|
871 | $ printf "a" > willconflict | |
872 | $ hg add willconflict |
|
872 | $ hg add willconflict | |
873 | $ hg commit -m "willconflict first version" |
|
873 | $ hg commit -m "willconflict first version" | |
874 |
|
874 | |||
875 | $ printf "dummy" > C |
|
875 | $ printf "dummy" > C | |
876 | $ hg commit -m "dummy change successor" |
|
876 | $ hg commit -m "dummy change successor" | |
877 |
|
877 | |||
878 | Create the changes that we will rebase |
|
878 | Create the changes that we will rebase | |
879 | $ hg update -C 16 -q |
|
879 | $ hg update -C 16 -q | |
880 | $ printf "b" > willconflict |
|
880 | $ printf "b" > willconflict | |
881 | $ hg add willconflict |
|
881 | $ hg add willconflict | |
882 | $ hg commit -m "willconflict second version" |
|
882 | $ hg commit -m "willconflict second version" | |
883 | created new head |
|
883 | created new head | |
884 | $ printf "dummy" > K |
|
884 | $ printf "dummy" > K | |
885 | $ hg add K |
|
885 | $ hg add K | |
886 | $ hg commit -m "dummy change" |
|
886 | $ hg commit -m "dummy change" | |
887 | $ printf "dummy" > L |
|
887 | $ printf "dummy" > L | |
888 | $ hg add L |
|
888 | $ hg add L | |
889 | $ hg commit -m "dummy change" |
|
889 | $ hg commit -m "dummy change" | |
890 | $ hg debugobsolete `hg log -r ".^" -T '{node}'` `hg log -r 18 -T '{node}'` --config experimental.evolution=true |
|
890 | $ hg debugobsolete `hg log -r ".^" -T '{node}'` `hg log -r 18 -T '{node}'` --config experimental.evolution=true | |
891 | obsoleted 1 changesets |
|
891 | obsoleted 1 changesets | |
892 |
|
892 | |||
893 | $ hg log -G -r 16:: |
|
893 | $ hg log -G -r 16:: | |
894 | @ 21:7bdc8a87673d dummy change |
|
894 | @ 21:7bdc8a87673d dummy change | |
895 | | |
|
895 | | | |
896 | x 20:8b31da3c4919 dummy change |
|
896 | x 20:8b31da3c4919 dummy change | |
897 | | |
|
897 | | | |
898 | o 19:b82fb57ea638 willconflict second version |
|
898 | o 19:b82fb57ea638 willconflict second version | |
899 | | |
|
899 | | | |
900 | | o 18:601db7a18f51 dummy change successor |
|
900 | | o 18:601db7a18f51 dummy change successor | |
901 | | | |
|
901 | | | | |
902 | | o 17:357ddf1602d5 willconflict first version |
|
902 | | o 17:357ddf1602d5 willconflict first version | |
903 | |/ |
|
903 | |/ | |
904 | o 16:61bd55f69bc4 bar foo |
|
904 | o 16:61bd55f69bc4 bar foo | |
905 | | |
|
905 | | | |
906 | ~ |
|
906 | ~ | |
907 | $ hg rebase -r ".^^ + .^ + ." -d 18 |
|
907 | $ hg rebase -r ".^^ + .^ + ." -d 18 | |
908 | rebasing 19:b82fb57ea638 "willconflict second version" |
|
908 | rebasing 19:b82fb57ea638 "willconflict second version" | |
909 | merging willconflict |
|
909 | merging willconflict | |
910 | warning: conflicts while merging willconflict! (edit, then use 'hg resolve --mark') |
|
910 | warning: conflicts while merging willconflict! (edit, then use 'hg resolve --mark') | |
911 | unresolved conflicts (see hg resolve, then hg rebase --continue) |
|
911 | unresolved conflicts (see hg resolve, then hg rebase --continue) | |
912 | [1] |
|
912 | [1] | |
913 |
|
913 | |||
914 | $ hg resolve --mark willconflict |
|
914 | $ hg resolve --mark willconflict | |
915 | (no more unresolved files) |
|
915 | (no more unresolved files) | |
916 | continue: hg rebase --continue |
|
916 | continue: hg rebase --continue | |
917 | $ hg rebase --continue |
|
917 | $ hg rebase --continue | |
918 | rebasing 19:b82fb57ea638 "willconflict second version" |
|
918 | rebasing 19:b82fb57ea638 "willconflict second version" | |
919 | note: not rebasing 20:8b31da3c4919 "dummy change", already in destination as 18:601db7a18f51 "dummy change successor" |
|
919 | note: not rebasing 20:8b31da3c4919 "dummy change", already in destination as 18:601db7a18f51 "dummy change successor" | |
920 | rebasing 21:7bdc8a87673d "dummy change" (tip) |
|
920 | rebasing 21:7bdc8a87673d "dummy change" (tip) | |
921 | $ cd .. |
|
921 | $ cd .. | |
922 |
|
922 | |||
923 | Rebase merge where successor of one parent is equal to destination (issue5198) |
|
923 | Rebase merge where successor of one parent is equal to destination (issue5198) | |
924 |
|
924 | |||
925 | $ hg init p1-succ-is-dest |
|
925 | $ hg init p1-succ-is-dest | |
926 | $ cd p1-succ-is-dest |
|
926 | $ cd p1-succ-is-dest | |
927 |
|
927 | |||
928 | $ hg debugdrawdag <<EOF |
|
928 | $ hg debugdrawdag <<EOF | |
929 | > F |
|
929 | > F | |
930 | > /| |
|
930 | > /| | |
931 | > E D B # replace: D -> B |
|
931 | > E D B # replace: D -> B | |
932 | > \|/ |
|
932 | > \|/ | |
933 | > A |
|
933 | > A | |
934 | > EOF |
|
934 | > EOF | |
935 |
|
935 | |||
936 | $ hg rebase -d B -s D |
|
936 | $ hg rebase -d B -s D | |
937 | note: not rebasing 2:b18e25de2cf5 "D" (D), already in destination as 1:112478962961 "B" (B) |
|
937 | note: not rebasing 2:b18e25de2cf5 "D" (D), already in destination as 1:112478962961 "B" (B) | |
938 | rebasing 4:66f1a38021c9 "F" (F tip) |
|
938 | rebasing 4:66f1a38021c9 "F" (F tip) | |
939 | $ hg log -G |
|
939 | $ hg log -G | |
940 | o 5:50e9d60b99c6 F |
|
940 | o 5:50e9d60b99c6 F | |
941 | |\ |
|
941 | |\ | |
942 | | | x 4:66f1a38021c9 F |
|
942 | | | x 4:66f1a38021c9 F | |
943 | | |/| |
|
943 | | |/| | |
944 | | o | 3:7fb047a69f22 E |
|
944 | | o | 3:7fb047a69f22 E | |
945 | | | | |
|
945 | | | | | |
946 | | | x 2:b18e25de2cf5 D |
|
946 | | | x 2:b18e25de2cf5 D | |
947 | | |/ |
|
947 | | |/ | |
948 | o | 1:112478962961 B |
|
948 | o | 1:112478962961 B | |
949 | |/ |
|
949 | |/ | |
950 | o 0:426bada5c675 A |
|
950 | o 0:426bada5c675 A | |
951 |
|
951 | |||
952 | $ cd .. |
|
952 | $ cd .. | |
953 |
|
953 | |||
954 | Rebase merge where successor of other parent is equal to destination |
|
954 | Rebase merge where successor of other parent is equal to destination | |
955 |
|
955 | |||
956 | $ hg init p2-succ-is-dest |
|
956 | $ hg init p2-succ-is-dest | |
957 | $ cd p2-succ-is-dest |
|
957 | $ cd p2-succ-is-dest | |
958 |
|
958 | |||
959 | $ hg debugdrawdag <<EOF |
|
959 | $ hg debugdrawdag <<EOF | |
960 | > F |
|
960 | > F | |
961 | > /| |
|
961 | > /| | |
962 | > E D B # replace: E -> B |
|
962 | > E D B # replace: E -> B | |
963 | > \|/ |
|
963 | > \|/ | |
964 | > A |
|
964 | > A | |
965 | > EOF |
|
965 | > EOF | |
966 |
|
966 | |||
967 | $ hg rebase -d B -s E |
|
967 | $ hg rebase -d B -s E | |
968 | note: not rebasing 3:7fb047a69f22 "E" (E), already in destination as 1:112478962961 "B" (B) |
|
968 | note: not rebasing 3:7fb047a69f22 "E" (E), already in destination as 1:112478962961 "B" (B) | |
969 | rebasing 4:66f1a38021c9 "F" (F tip) |
|
969 | rebasing 4:66f1a38021c9 "F" (F tip) | |
970 | $ hg log -G |
|
970 | $ hg log -G | |
971 | o 5:aae1787dacee F |
|
971 | o 5:aae1787dacee F | |
972 | |\ |
|
972 | |\ | |
973 | | | x 4:66f1a38021c9 F |
|
973 | | | x 4:66f1a38021c9 F | |
974 | | |/| |
|
974 | | |/| | |
975 | | | x 3:7fb047a69f22 E |
|
975 | | | x 3:7fb047a69f22 E | |
976 | | | | |
|
976 | | | | | |
977 | | o | 2:b18e25de2cf5 D |
|
977 | | o | 2:b18e25de2cf5 D | |
978 | | |/ |
|
978 | | |/ | |
979 | o / 1:112478962961 B |
|
979 | o / 1:112478962961 B | |
980 | |/ |
|
980 | |/ | |
981 | o 0:426bada5c675 A |
|
981 | o 0:426bada5c675 A | |
982 |
|
982 | |||
983 | $ cd .. |
|
983 | $ cd .. | |
984 |
|
984 | |||
985 | Rebase merge where successor of one parent is ancestor of destination |
|
985 | Rebase merge where successor of one parent is ancestor of destination | |
986 |
|
986 | |||
987 | $ hg init p1-succ-in-dest |
|
987 | $ hg init p1-succ-in-dest | |
988 | $ cd p1-succ-in-dest |
|
988 | $ cd p1-succ-in-dest | |
989 |
|
989 | |||
990 | $ hg debugdrawdag <<EOF |
|
990 | $ hg debugdrawdag <<EOF | |
991 | > F C |
|
991 | > F C | |
992 | > /| | |
|
992 | > /| | | |
993 | > E D B # replace: D -> B |
|
993 | > E D B # replace: D -> B | |
994 | > \|/ |
|
994 | > \|/ | |
995 | > A |
|
995 | > A | |
996 | > EOF |
|
996 | > EOF | |
997 |
|
997 | |||
998 | $ hg rebase -d C -s D |
|
998 | $ hg rebase -d C -s D | |
999 | note: not rebasing 2:b18e25de2cf5 "D" (D), already in destination as 1:112478962961 "B" (B) |
|
999 | note: not rebasing 2:b18e25de2cf5 "D" (D), already in destination as 1:112478962961 "B" (B) | |
1000 | rebasing 5:66f1a38021c9 "F" (F tip) |
|
1000 | rebasing 5:66f1a38021c9 "F" (F tip) | |
1001 |
|
1001 | |||
1002 | $ hg log -G |
|
1002 | $ hg log -G | |
1003 | o 6:0913febf6439 F |
|
1003 | o 6:0913febf6439 F | |
1004 | |\ |
|
1004 | |\ | |
1005 | +---x 5:66f1a38021c9 F |
|
1005 | +---x 5:66f1a38021c9 F | |
1006 | | | | |
|
1006 | | | | | |
1007 | | o | 4:26805aba1e60 C |
|
1007 | | o | 4:26805aba1e60 C | |
1008 | | | | |
|
1008 | | | | | |
1009 | o | | 3:7fb047a69f22 E |
|
1009 | o | | 3:7fb047a69f22 E | |
1010 | | | | |
|
1010 | | | | | |
1011 | +---x 2:b18e25de2cf5 D |
|
1011 | +---x 2:b18e25de2cf5 D | |
1012 | | | |
|
1012 | | | | |
1013 | | o 1:112478962961 B |
|
1013 | | o 1:112478962961 B | |
1014 | |/ |
|
1014 | |/ | |
1015 | o 0:426bada5c675 A |
|
1015 | o 0:426bada5c675 A | |
1016 |
|
1016 | |||
1017 | $ cd .. |
|
1017 | $ cd .. | |
1018 |
|
1018 | |||
1019 | Rebase merge where successor of other parent is ancestor of destination |
|
1019 | Rebase merge where successor of other parent is ancestor of destination | |
1020 |
|
1020 | |||
1021 | $ hg init p2-succ-in-dest |
|
1021 | $ hg init p2-succ-in-dest | |
1022 | $ cd p2-succ-in-dest |
|
1022 | $ cd p2-succ-in-dest | |
1023 |
|
1023 | |||
1024 | $ hg debugdrawdag <<EOF |
|
1024 | $ hg debugdrawdag <<EOF | |
1025 | > F C |
|
1025 | > F C | |
1026 | > /| | |
|
1026 | > /| | | |
1027 | > E D B # replace: E -> B |
|
1027 | > E D B # replace: E -> B | |
1028 | > \|/ |
|
1028 | > \|/ | |
1029 | > A |
|
1029 | > A | |
1030 | > EOF |
|
1030 | > EOF | |
1031 |
|
1031 | |||
1032 | $ hg rebase -d C -s E |
|
1032 | $ hg rebase -d C -s E | |
1033 | note: not rebasing 3:7fb047a69f22 "E" (E), already in destination as 1:112478962961 "B" (B) |
|
1033 | note: not rebasing 3:7fb047a69f22 "E" (E), already in destination as 1:112478962961 "B" (B) | |
1034 | rebasing 5:66f1a38021c9 "F" (F tip) |
|
1034 | rebasing 5:66f1a38021c9 "F" (F tip) | |
1035 | $ hg log -G |
|
1035 | $ hg log -G | |
1036 | o 6:c6ab0cc6d220 F |
|
1036 | o 6:c6ab0cc6d220 F | |
1037 | |\ |
|
1037 | |\ | |
1038 | +---x 5:66f1a38021c9 F |
|
1038 | +---x 5:66f1a38021c9 F | |
1039 | | | | |
|
1039 | | | | | |
1040 | | o | 4:26805aba1e60 C |
|
1040 | | o | 4:26805aba1e60 C | |
1041 | | | | |
|
1041 | | | | | |
1042 | | | x 3:7fb047a69f22 E |
|
1042 | | | x 3:7fb047a69f22 E | |
1043 | | | | |
|
1043 | | | | | |
1044 | o---+ 2:b18e25de2cf5 D |
|
1044 | o---+ 2:b18e25de2cf5 D | |
1045 | / / |
|
1045 | / / | |
1046 | o / 1:112478962961 B |
|
1046 | o / 1:112478962961 B | |
1047 | |/ |
|
1047 | |/ | |
1048 | o 0:426bada5c675 A |
|
1048 | o 0:426bada5c675 A | |
1049 |
|
1049 | |||
1050 | $ cd .. |
|
1050 | $ cd .. | |
1051 |
|
1051 | |||
1052 | Rebase merge where successor of one parent is ancestor of destination |
|
1052 | Rebase merge where successor of one parent is ancestor of destination | |
1053 |
|
1053 | |||
1054 | $ hg init p1-succ-in-dest-b |
|
1054 | $ hg init p1-succ-in-dest-b | |
1055 | $ cd p1-succ-in-dest-b |
|
1055 | $ cd p1-succ-in-dest-b | |
1056 |
|
1056 | |||
1057 | $ hg debugdrawdag <<EOF |
|
1057 | $ hg debugdrawdag <<EOF | |
1058 | > F C |
|
1058 | > F C | |
1059 | > /| | |
|
1059 | > /| | | |
1060 | > E D B # replace: E -> B |
|
1060 | > E D B # replace: E -> B | |
1061 | > \|/ |
|
1061 | > \|/ | |
1062 | > A |
|
1062 | > A | |
1063 | > EOF |
|
1063 | > EOF | |
1064 |
|
1064 | |||
1065 | $ hg rebase -d C -b F |
|
1065 | $ hg rebase -d C -b F | |
1066 | rebasing 2:b18e25de2cf5 "D" (D) |
|
1066 | rebasing 2:b18e25de2cf5 "D" (D) | |
1067 | note: not rebasing 3:7fb047a69f22 "E" (E), already in destination as 1:112478962961 "B" (B) |
|
1067 | note: not rebasing 3:7fb047a69f22 "E" (E), already in destination as 1:112478962961 "B" (B) | |
1068 | rebasing 5:66f1a38021c9 "F" (F tip) |
|
1068 | rebasing 5:66f1a38021c9 "F" (F tip) | |
1069 | note: rebase of 5:66f1a38021c9 created no changes to commit |
|
1069 | note: rebase of 5:66f1a38021c9 created no changes to commit | |
1070 | $ hg log -G |
|
1070 | $ hg log -G | |
1071 | o 6:8f47515dda15 D |
|
1071 | o 6:8f47515dda15 D | |
1072 | | |
|
1072 | | | |
1073 | | x 5:66f1a38021c9 F |
|
1073 | | x 5:66f1a38021c9 F | |
1074 | | |\ |
|
1074 | | |\ | |
1075 | o | | 4:26805aba1e60 C |
|
1075 | o | | 4:26805aba1e60 C | |
1076 | | | | |
|
1076 | | | | | |
1077 | | | x 3:7fb047a69f22 E |
|
1077 | | | x 3:7fb047a69f22 E | |
1078 | | | | |
|
1078 | | | | | |
1079 | | x | 2:b18e25de2cf5 D |
|
1079 | | x | 2:b18e25de2cf5 D | |
1080 | | |/ |
|
1080 | | |/ | |
1081 | o / 1:112478962961 B |
|
1081 | o / 1:112478962961 B | |
1082 | |/ |
|
1082 | |/ | |
1083 | o 0:426bada5c675 A |
|
1083 | o 0:426bada5c675 A | |
1084 |
|
1084 | |||
1085 | $ cd .. |
|
1085 | $ cd .. | |
1086 |
|
1086 | |||
1087 | Rebase merge where successor of other parent is ancestor of destination |
|
1087 | Rebase merge where successor of other parent is ancestor of destination | |
1088 |
|
1088 | |||
1089 | $ hg init p2-succ-in-dest-b |
|
1089 | $ hg init p2-succ-in-dest-b | |
1090 | $ cd p2-succ-in-dest-b |
|
1090 | $ cd p2-succ-in-dest-b | |
1091 |
|
1091 | |||
1092 | $ hg debugdrawdag <<EOF |
|
1092 | $ hg debugdrawdag <<EOF | |
1093 | > F C |
|
1093 | > F C | |
1094 | > /| | |
|
1094 | > /| | | |
1095 | > E D B # replace: D -> B |
|
1095 | > E D B # replace: D -> B | |
1096 | > \|/ |
|
1096 | > \|/ | |
1097 | > A |
|
1097 | > A | |
1098 | > EOF |
|
1098 | > EOF | |
1099 |
|
1099 | |||
1100 | $ hg rebase -d C -b F |
|
1100 | $ hg rebase -d C -b F | |
1101 | note: not rebasing 2:b18e25de2cf5 "D" (D), already in destination as 1:112478962961 "B" (B) |
|
1101 | note: not rebasing 2:b18e25de2cf5 "D" (D), already in destination as 1:112478962961 "B" (B) | |
1102 | rebasing 3:7fb047a69f22 "E" (E) |
|
1102 | rebasing 3:7fb047a69f22 "E" (E) | |
1103 | rebasing 5:66f1a38021c9 "F" (F tip) |
|
1103 | rebasing 5:66f1a38021c9 "F" (F tip) | |
1104 | note: rebase of 5:66f1a38021c9 created no changes to commit |
|
1104 | note: rebase of 5:66f1a38021c9 created no changes to commit | |
1105 |
|
1105 | |||
1106 | $ hg log -G |
|
1106 | $ hg log -G | |
1107 | o 6:533690786a86 E |
|
1107 | o 6:533690786a86 E | |
1108 | | |
|
1108 | | | |
1109 | | x 5:66f1a38021c9 F |
|
1109 | | x 5:66f1a38021c9 F | |
1110 | | |\ |
|
1110 | | |\ | |
1111 | o | | 4:26805aba1e60 C |
|
1111 | o | | 4:26805aba1e60 C | |
1112 | | | | |
|
1112 | | | | | |
1113 | | | x 3:7fb047a69f22 E |
|
1113 | | | x 3:7fb047a69f22 E | |
1114 | | | | |
|
1114 | | | | | |
1115 | | x | 2:b18e25de2cf5 D |
|
1115 | | x | 2:b18e25de2cf5 D | |
1116 | | |/ |
|
1116 | | |/ | |
1117 | o / 1:112478962961 B |
|
1117 | o / 1:112478962961 B | |
1118 | |/ |
|
1118 | |/ | |
1119 | o 0:426bada5c675 A |
|
1119 | o 0:426bada5c675 A | |
1120 |
|
1120 | |||
1121 | $ cd .. |
|
1121 | $ cd .. | |
1122 |
|
1122 | |||
1123 | Rebase merge where both parents have successors in destination |
|
1123 | Rebase merge where both parents have successors in destination | |
1124 |
|
1124 | |||
1125 | $ hg init p12-succ-in-dest |
|
1125 | $ hg init p12-succ-in-dest | |
1126 | $ cd p12-succ-in-dest |
|
1126 | $ cd p12-succ-in-dest | |
1127 | $ hg debugdrawdag <<'EOS' |
|
1127 | $ hg debugdrawdag <<'EOS' | |
1128 | > E F |
|
1128 | > E F | |
1129 | > /| /| # replace: A -> C |
|
1129 | > /| /| # replace: A -> C | |
1130 | > A B C D # replace: B -> D |
|
1130 | > A B C D # replace: B -> D | |
1131 | > | | |
|
1131 | > | | | |
1132 | > X Y |
|
1132 | > X Y | |
1133 | > EOS |
|
1133 | > EOS | |
1134 | $ hg rebase -r A+B+E -d F |
|
1134 | $ hg rebase -r A+B+E -d F | |
1135 | note: not rebasing 4:a3d17304151f "A" (A), already in destination as 0:96cc3511f894 "C" (C) |
|
1135 | note: not rebasing 4:a3d17304151f "A" (A), already in destination as 0:96cc3511f894 "C" (C) | |
1136 | note: not rebasing 5:b23a2cc00842 "B" (B), already in destination as 1:058c1e1fb10a "D" (D) |
|
1136 | note: not rebasing 5:b23a2cc00842 "B" (B), already in destination as 1:058c1e1fb10a "D" (D) | |
1137 | rebasing 7:dac5d11c5a7d "E" (E tip) |
|
1137 | rebasing 7:dac5d11c5a7d "E" (E tip) | |
1138 | abort: rebasing 7:dac5d11c5a7d will include unwanted changes from 3:59c792af609c, 5:b23a2cc00842 or 2:ba2b7fa7166d, 4:a3d17304151f |
|
1138 | abort: rebasing 7:dac5d11c5a7d will include unwanted changes from 3:59c792af609c, 5:b23a2cc00842 or 2:ba2b7fa7166d, 4:a3d17304151f | |
1139 | [255] |
|
1139 | [255] | |
1140 | $ cd .. |
|
1140 | $ cd .. | |
1141 |
|
1141 | |||
1142 | Rebase a non-clean merge. One parent has successor in destination, the other |
|
1142 | Rebase a non-clean merge. One parent has successor in destination, the other | |
1143 | parent moves as requested. |
|
1143 | parent moves as requested. | |
1144 |
|
1144 | |||
1145 | $ hg init p1-succ-p2-move |
|
1145 | $ hg init p1-succ-p2-move | |
1146 | $ cd p1-succ-p2-move |
|
1146 | $ cd p1-succ-p2-move | |
1147 | $ hg debugdrawdag <<'EOS' |
|
1147 | $ hg debugdrawdag <<'EOS' | |
1148 | > D Z |
|
1148 | > D Z | |
1149 | > /| | # replace: A -> C |
|
1149 | > /| | # replace: A -> C | |
1150 | > A B C # D/D = D |
|
1150 | > A B C # D/D = D | |
1151 | > EOS |
|
1151 | > EOS | |
1152 | $ hg rebase -r A+B+D -d Z |
|
1152 | $ hg rebase -r A+B+D -d Z | |
1153 | note: not rebasing 0:426bada5c675 "A" (A), already in destination as 2:96cc3511f894 "C" (C) |
|
1153 | note: not rebasing 0:426bada5c675 "A" (A), already in destination as 2:96cc3511f894 "C" (C) | |
1154 | rebasing 1:fc2b737bb2e5 "B" (B) |
|
1154 | rebasing 1:fc2b737bb2e5 "B" (B) | |
1155 | rebasing 3:b8ed089c80ad "D" (D) |
|
1155 | rebasing 3:b8ed089c80ad "D" (D) | |
1156 |
|
1156 | |||
1157 | $ rm .hg/localtags |
|
1157 | $ rm .hg/localtags | |
1158 | $ hg log -G |
|
1158 | $ hg log -G | |
1159 | o 6:e4f78693cc88 D |
|
1159 | o 6:e4f78693cc88 D | |
1160 | | |
|
1160 | | | |
1161 | o 5:76840d832e98 B |
|
1161 | o 5:76840d832e98 B | |
1162 | | |
|
1162 | | | |
1163 | o 4:50e41c1f3950 Z |
|
1163 | o 4:50e41c1f3950 Z | |
1164 | | |
|
1164 | | | |
1165 | o 2:96cc3511f894 C |
|
1165 | o 2:96cc3511f894 C | |
1166 |
|
1166 | |||
1167 | $ hg files -r tip |
|
1167 | $ hg files -r tip | |
1168 | B |
|
1168 | B | |
1169 | C |
|
1169 | C | |
1170 | D |
|
1170 | D | |
1171 | Z |
|
1171 | Z | |
1172 |
|
1172 | |||
1173 | $ cd .. |
|
1173 | $ cd .. | |
1174 |
|
1174 | |||
1175 | $ hg init p1-move-p2-succ |
|
1175 | $ hg init p1-move-p2-succ | |
1176 | $ cd p1-move-p2-succ |
|
1176 | $ cd p1-move-p2-succ | |
1177 | $ hg debugdrawdag <<'EOS' |
|
1177 | $ hg debugdrawdag <<'EOS' | |
1178 | > D Z |
|
1178 | > D Z | |
1179 | > /| | # replace: B -> C |
|
1179 | > /| | # replace: B -> C | |
1180 | > A B C # D/D = D |
|
1180 | > A B C # D/D = D | |
1181 | > EOS |
|
1181 | > EOS | |
1182 | $ hg rebase -r B+A+D -d Z |
|
1182 | $ hg rebase -r B+A+D -d Z | |
1183 | rebasing 0:426bada5c675 "A" (A) |
|
1183 | rebasing 0:426bada5c675 "A" (A) | |
1184 | note: not rebasing 1:fc2b737bb2e5 "B" (B), already in destination as 2:96cc3511f894 "C" (C) |
|
1184 | note: not rebasing 1:fc2b737bb2e5 "B" (B), already in destination as 2:96cc3511f894 "C" (C) | |
1185 | rebasing 3:b8ed089c80ad "D" (D) |
|
1185 | rebasing 3:b8ed089c80ad "D" (D) | |
1186 |
|
1186 | |||
1187 | $ rm .hg/localtags |
|
1187 | $ rm .hg/localtags | |
1188 | $ hg log -G |
|
1188 | $ hg log -G | |
1189 | o 6:1b355ed94d82 D |
|
1189 | o 6:1b355ed94d82 D | |
1190 | | |
|
1190 | | | |
1191 | o 5:a81a74d764a6 A |
|
1191 | o 5:a81a74d764a6 A | |
1192 | | |
|
1192 | | | |
1193 | o 4:50e41c1f3950 Z |
|
1193 | o 4:50e41c1f3950 Z | |
1194 | | |
|
1194 | | | |
1195 | o 2:96cc3511f894 C |
|
1195 | o 2:96cc3511f894 C | |
1196 |
|
1196 | |||
1197 | $ hg files -r tip |
|
1197 | $ hg files -r tip | |
1198 | A |
|
1198 | A | |
1199 | C |
|
1199 | C | |
1200 | D |
|
1200 | D | |
1201 | Z |
|
1201 | Z | |
1202 |
|
1202 | |||
1203 | $ cd .. |
|
1203 | $ cd .. | |
1204 |
|
1204 | |||
1205 | Test that bookmark is moved and working dir is updated when all changesets have |
|
1205 | Test that bookmark is moved and working dir is updated when all changesets have | |
1206 | equivalents in destination |
|
1206 | equivalents in destination | |
1207 | $ hg init rbsrepo && cd rbsrepo |
|
1207 | $ hg init rbsrepo && cd rbsrepo | |
1208 | $ echo "[experimental]" > .hg/hgrc |
|
1208 | $ echo "[experimental]" > .hg/hgrc | |
1209 | $ echo "evolution=true" >> .hg/hgrc |
|
1209 | $ echo "evolution=true" >> .hg/hgrc | |
1210 | $ echo "rebaseskipobsolete=on" >> .hg/hgrc |
|
1210 | $ echo "rebaseskipobsolete=on" >> .hg/hgrc | |
1211 | $ echo root > root && hg ci -Am root |
|
1211 | $ echo root > root && hg ci -Am root | |
1212 | adding root |
|
1212 | adding root | |
1213 | $ echo a > a && hg ci -Am a |
|
1213 | $ echo a > a && hg ci -Am a | |
1214 | adding a |
|
1214 | adding a | |
1215 | $ hg up 0 |
|
1215 | $ hg up 0 | |
1216 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
1216 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
1217 | $ echo b > b && hg ci -Am b |
|
1217 | $ echo b > b && hg ci -Am b | |
1218 | adding b |
|
1218 | adding b | |
1219 | created new head |
|
1219 | created new head | |
1220 | $ hg rebase -r 2 -d 1 |
|
1220 | $ hg rebase -r 2 -d 1 | |
1221 | rebasing 2:1e9a3c00cbe9 "b" (tip) |
|
1221 | rebasing 2:1e9a3c00cbe9 "b" (tip) | |
1222 | $ hg log -r . # working dir is at rev 3 (successor of 2) |
|
1222 | $ hg log -r . # working dir is at rev 3 (successor of 2) | |
1223 | 3:be1832deae9a b (no-eol) |
|
1223 | 3:be1832deae9a b (no-eol) | |
1224 | $ hg book -r 2 mybook --hidden # rev 2 has a bookmark on it now |
|
1224 | $ hg book -r 2 mybook --hidden # rev 2 has a bookmark on it now | |
1225 | $ hg up 2 && hg log -r . # working dir is at rev 2 again |
|
1225 | $ hg up 2 && hg log -r . # working dir is at rev 2 again | |
1226 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
1226 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
1227 | 2:1e9a3c00cbe9 b (no-eol) |
|
1227 | 2:1e9a3c00cbe9 b (no-eol) | |
1228 | $ hg rebase -r 2 -d 3 --config experimental.stabilization.track-operation=1 |
|
1228 | $ hg rebase -r 2 -d 3 --config experimental.stabilization.track-operation=1 | |
1229 | note: not rebasing 2:1e9a3c00cbe9 "b" (mybook), already in destination as 3:be1832deae9a "b" (tip) |
|
1229 | note: not rebasing 2:1e9a3c00cbe9 "b" (mybook), already in destination as 3:be1832deae9a "b" (tip) | |
1230 | Check that working directory and bookmark was updated to rev 3 although rev 2 |
|
1230 | Check that working directory and bookmark was updated to rev 3 although rev 2 | |
1231 | was skipped |
|
1231 | was skipped | |
1232 | $ hg log -r . |
|
1232 | $ hg log -r . | |
1233 | 3:be1832deae9a b (no-eol) |
|
1233 | 3:be1832deae9a b (no-eol) | |
1234 | $ hg bookmarks |
|
1234 | $ hg bookmarks | |
1235 | mybook 3:be1832deae9a |
|
1235 | mybook 3:be1832deae9a | |
1236 | $ hg debugobsolete --rev tip |
|
1236 | $ hg debugobsolete --rev tip | |
1237 | 1e9a3c00cbe90d236ac05ef61efcc5e40b7412bc be1832deae9ac531caa7438b8dcf6055a122cd8e 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} |
|
1237 | 1e9a3c00cbe90d236ac05ef61efcc5e40b7412bc be1832deae9ac531caa7438b8dcf6055a122cd8e 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'rebase', 'user': 'test'} | |
1238 |
|
1238 | |||
1239 | Obsoleted working parent and bookmark could be moved if an ancestor of working |
|
1239 | Obsoleted working parent and bookmark could be moved if an ancestor of working | |
1240 | parent gets moved: |
|
1240 | parent gets moved: | |
1241 |
|
1241 | |||
1242 | $ hg init $TESTTMP/ancestor-wd-move |
|
1242 | $ hg init $TESTTMP/ancestor-wd-move | |
1243 | $ cd $TESTTMP/ancestor-wd-move |
|
1243 | $ cd $TESTTMP/ancestor-wd-move | |
1244 | $ hg debugdrawdag <<'EOS' |
|
1244 | $ hg debugdrawdag <<'EOS' | |
1245 | > E D1 # rebase: D1 -> D2 |
|
1245 | > E D1 # rebase: D1 -> D2 | |
1246 | > | | |
|
1246 | > | | | |
1247 | > | C |
|
1247 | > | C | |
1248 | > D2 | |
|
1248 | > D2 | | |
1249 | > | B |
|
1249 | > | B | |
1250 | > |/ |
|
1250 | > |/ | |
1251 | > A |
|
1251 | > A | |
1252 | > EOS |
|
1252 | > EOS | |
1253 | $ hg update D1 -q |
|
1253 | $ hg update D1 -q | |
1254 | $ hg bookmark book -i |
|
1254 | $ hg bookmark book -i | |
1255 | $ hg rebase -r B+D1 -d E |
|
1255 | $ hg rebase -r B+D1 -d E | |
1256 | rebasing 1:112478962961 "B" (B) |
|
1256 | rebasing 1:112478962961 "B" (B) | |
1257 | note: not rebasing 5:15ecf15e0114 "D1" (book D1 tip), already in destination as 2:0807738e0be9 "D2" (D2) |
|
1257 | note: not rebasing 5:15ecf15e0114 "D1" (book D1 tip), already in destination as 2:0807738e0be9 "D2" (D2) | |
1258 | $ hg log -G -T '{desc} {bookmarks}' |
|
1258 | $ hg log -G -T '{desc} {bookmarks}' | |
1259 | @ B book |
|
1259 | @ B book | |
1260 | | |
|
1260 | | | |
1261 | | x D1 |
|
1261 | | x D1 | |
1262 | | | |
|
1262 | | | | |
1263 | o | E |
|
1263 | o | E | |
1264 | | | |
|
1264 | | | | |
1265 | | o C |
|
1265 | | o C | |
1266 | | | |
|
1266 | | | | |
1267 | o | D2 |
|
1267 | o | D2 | |
1268 | | | |
|
1268 | | | | |
1269 | | x B |
|
1269 | | x B | |
1270 | |/ |
|
1270 | |/ | |
1271 | o A |
|
1271 | o A | |
1272 |
|
1272 | |||
1273 | Rebasing a merge with one of its parent having a hidden successor |
|
1273 | Rebasing a merge with one of its parent having a hidden successor | |
1274 |
|
1274 | |||
1275 | $ hg init $TESTTMP/merge-p1-hidden-successor |
|
1275 | $ hg init $TESTTMP/merge-p1-hidden-successor | |
1276 | $ cd $TESTTMP/merge-p1-hidden-successor |
|
1276 | $ cd $TESTTMP/merge-p1-hidden-successor | |
1277 |
|
1277 | |||
1278 | $ hg debugdrawdag <<'EOS' |
|
1278 | $ hg debugdrawdag <<'EOS' | |
1279 | > E |
|
1279 | > E | |
1280 | > | |
|
1280 | > | | |
1281 | > B3 B2 # amend: B1 -> B2 -> B3 |
|
1281 | > B3 B2 # amend: B1 -> B2 -> B3 | |
1282 | > |/ # B2 is hidden |
|
1282 | > |/ # B2 is hidden | |
1283 | > | D |
|
1283 | > | D | |
1284 | > | |\ |
|
1284 | > | |\ | |
1285 | > | B1 C |
|
1285 | > | B1 C | |
1286 | > |/ |
|
1286 | > |/ | |
1287 | > A |
|
1287 | > A | |
1288 | > EOS |
|
1288 | > EOS | |
1289 |
|
1289 | |||
1290 | $ eval `hg tags -T '{tag}={node}\n'` |
|
1290 | $ eval `hg tags -T '{tag}={node}\n'` | |
1291 | $ rm .hg/localtags |
|
1291 | $ rm .hg/localtags | |
1292 |
|
1292 | |||
1293 | $ hg rebase -r $D -d $E |
|
1293 | $ hg rebase -r $D -d $E | |
1294 | rebasing 5:9e62094e4d94 "D" |
|
1294 | rebasing 5:9e62094e4d94 "D" | |
1295 |
|
1295 | |||
1296 | $ hg log -G |
|
1296 | $ hg log -G | |
1297 | o 7:a699d059adcf D |
|
1297 | o 7:a699d059adcf D | |
1298 | |\ |
|
1298 | |\ | |
1299 | | o 6:ecc93090a95c E |
|
1299 | | o 6:ecc93090a95c E | |
1300 | | | |
|
1300 | | | | |
1301 | | o 4:0dc878468a23 B3 |
|
1301 | | o 4:0dc878468a23 B3 | |
1302 | | | |
|
1302 | | | | |
1303 | o | 1:96cc3511f894 C |
|
1303 | o | 1:96cc3511f894 C | |
1304 | / |
|
1304 | / | |
1305 | o 0:426bada5c675 A |
|
1305 | o 0:426bada5c675 A | |
1306 |
|
1306 | |||
1307 | For some reasons (--hidden, rebaseskipobsolete=0, directaccess, etc.), |
|
1307 | For some reasons (--hidden, rebaseskipobsolete=0, directaccess, etc.), | |
1308 | rebasestate may contain hidden hashes. "rebase --abort" should work regardless. |
|
1308 | rebasestate may contain hidden hashes. "rebase --abort" should work regardless. | |
1309 |
|
1309 | |||
1310 | $ hg init $TESTTMP/hidden-state1 |
|
1310 | $ hg init $TESTTMP/hidden-state1 | |
1311 | $ cd $TESTTMP/hidden-state1 |
|
1311 | $ cd $TESTTMP/hidden-state1 | |
1312 | $ cat >> .hg/hgrc <<EOF |
|
1312 | $ cat >> .hg/hgrc <<EOF | |
1313 | > [experimental] |
|
1313 | > [experimental] | |
1314 | > rebaseskipobsolete=0 |
|
1314 | > rebaseskipobsolete=0 | |
1315 | > EOF |
|
1315 | > EOF | |
1316 |
|
1316 | |||
1317 | $ hg debugdrawdag <<'EOS' |
|
1317 | $ hg debugdrawdag <<'EOS' | |
1318 | > C |
|
1318 | > C | |
1319 | > | |
|
1319 | > | | |
1320 | > D B # prune: B, C |
|
1320 | > D B # prune: B, C | |
1321 | > |/ # B/D=B |
|
1321 | > |/ # B/D=B | |
1322 | > A |
|
1322 | > A | |
1323 | > EOS |
|
1323 | > EOS | |
1324 |
|
1324 | |||
1325 | $ eval `hg tags -T '{tag}={node}\n'` |
|
1325 | $ eval `hg tags -T '{tag}={node}\n'` | |
1326 | $ rm .hg/localtags |
|
1326 | $ rm .hg/localtags | |
1327 |
|
1327 | |||
1328 | $ hg update -q $C --hidden |
|
1328 | $ hg update -q $C --hidden | |
1329 | $ hg rebase -s $B -d $D |
|
1329 | $ hg rebase -s $B -d $D | |
1330 | rebasing 1:2ec65233581b "B" |
|
1330 | rebasing 1:2ec65233581b "B" | |
1331 | merging D |
|
1331 | merging D | |
1332 | warning: conflicts while merging D! (edit, then use 'hg resolve --mark') |
|
1332 | warning: conflicts while merging D! (edit, then use 'hg resolve --mark') | |
1333 | unresolved conflicts (see hg resolve, then hg rebase --continue) |
|
1333 | unresolved conflicts (see hg resolve, then hg rebase --continue) | |
1334 | [1] |
|
1334 | [1] | |
1335 |
|
1335 | |||
1336 | $ cp -R . $TESTTMP/hidden-state2 |
|
1336 | $ cp -R . $TESTTMP/hidden-state2 | |
1337 |
|
1337 | |||
1338 | $ hg log -G |
|
1338 | $ hg log -G | |
1339 | @ 2:b18e25de2cf5 D |
|
1339 | @ 2:b18e25de2cf5 D | |
1340 | | |
|
1340 | | | |
1341 | | @ 1:2ec65233581b B |
|
1341 | | @ 1:2ec65233581b B | |
1342 | |/ |
|
1342 | |/ | |
1343 | o 0:426bada5c675 A |
|
1343 | o 0:426bada5c675 A | |
1344 |
|
1344 | |||
1345 | $ hg summary |
|
1345 | $ hg summary | |
1346 | parent: 2:b18e25de2cf5 tip |
|
1346 | parent: 2:b18e25de2cf5 tip | |
1347 | D |
|
1347 | D | |
1348 | parent: 1:2ec65233581b (obsolete) |
|
1348 | parent: 1:2ec65233581b (obsolete) | |
1349 | B |
|
1349 | B | |
1350 | branch: default |
|
1350 | branch: default | |
1351 | commit: 2 modified, 1 unknown, 1 unresolved (merge) |
|
1351 | commit: 2 modified, 1 unknown, 1 unresolved (merge) | |
1352 | update: (current) |
|
1352 | update: (current) | |
1353 | phases: 3 draft |
|
1353 | phases: 3 draft | |
1354 | rebase: 0 rebased, 2 remaining (rebase --continue) |
|
1354 | rebase: 0 rebased, 2 remaining (rebase --continue) | |
1355 |
|
1355 | |||
1356 | $ hg rebase --abort |
|
1356 | $ hg rebase --abort | |
1357 | rebase aborted |
|
1357 | rebase aborted | |
1358 |
|
1358 | |||
1359 | Also test --continue for the above case |
|
1359 | Also test --continue for the above case | |
1360 |
|
1360 | |||
1361 | $ cd $TESTTMP/hidden-state2 |
|
1361 | $ cd $TESTTMP/hidden-state2 | |
1362 | $ hg resolve -m |
|
1362 | $ hg resolve -m | |
1363 | (no more unresolved files) |
|
1363 | (no more unresolved files) | |
1364 | continue: hg rebase --continue |
|
1364 | continue: hg rebase --continue | |
1365 | $ hg rebase --continue |
|
1365 | $ hg rebase --continue | |
1366 | rebasing 1:2ec65233581b "B" |
|
1366 | rebasing 1:2ec65233581b "B" | |
1367 | rebasing 3:7829726be4dc "C" (tip) |
|
1367 | rebasing 3:7829726be4dc "C" (tip) | |
1368 | $ hg log -G |
|
1368 | $ hg log -G | |
1369 | @ 5:1964d5d5b547 C |
|
1369 | @ 5:1964d5d5b547 C | |
1370 | | |
|
1370 | | | |
1371 | o 4:68deb90c12a2 B |
|
1371 | o 4:68deb90c12a2 B | |
1372 | | |
|
1372 | | | |
1373 | o 2:b18e25de2cf5 D |
|
1373 | o 2:b18e25de2cf5 D | |
1374 | | |
|
1374 | | | |
1375 | o 0:426bada5c675 A |
|
1375 | o 0:426bada5c675 A | |
1376 |
|
1376 |
@@ -1,95 +1,95 b'' | |||||
1 | Tests rebasing with part of the rebase set already in the |
|
1 | Tests rebasing with part of the rebase set already in the | |
2 | destination (issue5422) |
|
2 | destination (issue5422) | |
3 |
|
3 | |||
4 | $ cat >> $HGRCPATH <<EOF |
|
4 | $ cat >> $HGRCPATH <<EOF | |
5 | > [extensions] |
|
5 | > [extensions] | |
6 | > rebase= |
|
6 | > rebase= | |
7 | > drawdag=$TESTDIR/drawdag.py |
|
7 | > drawdag=$TESTDIR/drawdag.py | |
8 | > |
|
8 | > | |
9 | > [experimental] |
|
9 | > [experimental] | |
10 | > evolution=allowunstable |
|
|||
11 | > evolution.createmarkers=True |
|
10 | > evolution.createmarkers=True | |
|
11 | > evolution.allowunstable=True | |||
12 | > |
|
12 | > | |
13 | > [alias] |
|
13 | > [alias] | |
14 | > tglog = log -G --template "{rev}: {desc}" |
|
14 | > tglog = log -G --template "{rev}: {desc}" | |
15 | > EOF |
|
15 | > EOF | |
16 |
|
16 | |||
17 | $ rebasewithdag() { |
|
17 | $ rebasewithdag() { | |
18 | > N=`$PYTHON -c "print($N+1)"` |
|
18 | > N=`$PYTHON -c "print($N+1)"` | |
19 | > hg init repo$N && cd repo$N |
|
19 | > hg init repo$N && cd repo$N | |
20 | > hg debugdrawdag |
|
20 | > hg debugdrawdag | |
21 | > hg rebase "$@" > _rebasetmp |
|
21 | > hg rebase "$@" > _rebasetmp | |
22 | > r=$? |
|
22 | > r=$? | |
23 | > grep -v 'saved backup bundle' _rebasetmp |
|
23 | > grep -v 'saved backup bundle' _rebasetmp | |
24 | > [ $r -eq 0 ] && hg tglog |
|
24 | > [ $r -eq 0 ] && hg tglog | |
25 | > cd .. |
|
25 | > cd .. | |
26 | > return $r |
|
26 | > return $r | |
27 | > } |
|
27 | > } | |
28 |
|
28 | |||
29 | Rebase two commits, of which one is already in the right place |
|
29 | Rebase two commits, of which one is already in the right place | |
30 |
|
30 | |||
31 | $ rebasewithdag -r C+D -d B <<EOF |
|
31 | $ rebasewithdag -r C+D -d B <<EOF | |
32 | > C |
|
32 | > C | |
33 | > | |
|
33 | > | | |
34 | > B D |
|
34 | > B D | |
35 | > |/ |
|
35 | > |/ | |
36 | > A |
|
36 | > A | |
37 | > EOF |
|
37 | > EOF | |
38 | rebasing 2:b18e25de2cf5 "D" (D) |
|
38 | rebasing 2:b18e25de2cf5 "D" (D) | |
39 | already rebased 3:26805aba1e60 "C" (C tip) |
|
39 | already rebased 3:26805aba1e60 "C" (C tip) | |
40 | o 4: D |
|
40 | o 4: D | |
41 | | |
|
41 | | | |
42 | | o 3: C |
|
42 | | o 3: C | |
43 | |/ |
|
43 | |/ | |
44 | | x 2: D |
|
44 | | x 2: D | |
45 | | | |
|
45 | | | | |
46 | o | 1: B |
|
46 | o | 1: B | |
47 | |/ |
|
47 | |/ | |
48 | o 0: A |
|
48 | o 0: A | |
49 |
|
49 | |||
50 | Can collapse commits even if one is already in the right place |
|
50 | Can collapse commits even if one is already in the right place | |
51 |
|
51 | |||
52 | $ rebasewithdag --collapse -r C+D -d B <<EOF |
|
52 | $ rebasewithdag --collapse -r C+D -d B <<EOF | |
53 | > C |
|
53 | > C | |
54 | > | |
|
54 | > | | |
55 | > B D |
|
55 | > B D | |
56 | > |/ |
|
56 | > |/ | |
57 | > A |
|
57 | > A | |
58 | > EOF |
|
58 | > EOF | |
59 | rebasing 2:b18e25de2cf5 "D" (D) |
|
59 | rebasing 2:b18e25de2cf5 "D" (D) | |
60 | rebasing 3:26805aba1e60 "C" (C tip) |
|
60 | rebasing 3:26805aba1e60 "C" (C tip) | |
61 | o 4: Collapsed revision |
|
61 | o 4: Collapsed revision | |
62 | | * D |
|
62 | | * D | |
63 | | * C |
|
63 | | * C | |
64 | | x 3: C |
|
64 | | x 3: C | |
65 | |/ |
|
65 | |/ | |
66 | | x 2: D |
|
66 | | x 2: D | |
67 | | | |
|
67 | | | | |
68 | o | 1: B |
|
68 | o | 1: B | |
69 | |/ |
|
69 | |/ | |
70 | o 0: A |
|
70 | o 0: A | |
71 |
|
71 | |||
72 | Rebase with "holes". The commits after the hole should end up on the parent of |
|
72 | Rebase with "holes". The commits after the hole should end up on the parent of | |
73 | the hole (B below), not on top of the destination (A). |
|
73 | the hole (B below), not on top of the destination (A). | |
74 |
|
74 | |||
75 | $ rebasewithdag -r B+D -d A <<EOF |
|
75 | $ rebasewithdag -r B+D -d A <<EOF | |
76 | > D |
|
76 | > D | |
77 | > | |
|
77 | > | | |
78 | > C |
|
78 | > C | |
79 | > | |
|
79 | > | | |
80 | > B |
|
80 | > B | |
81 | > | |
|
81 | > | | |
82 | > A |
|
82 | > A | |
83 | > EOF |
|
83 | > EOF | |
84 | already rebased 1:112478962961 "B" (B) |
|
84 | already rebased 1:112478962961 "B" (B) | |
85 | rebasing 3:f585351a92f8 "D" (D tip) |
|
85 | rebasing 3:f585351a92f8 "D" (D tip) | |
86 | o 4: D |
|
86 | o 4: D | |
87 | | |
|
87 | | | |
88 | | x 3: D |
|
88 | | x 3: D | |
89 | | | |
|
89 | | | | |
90 | | o 2: C |
|
90 | | o 2: C | |
91 | |/ |
|
91 | |/ | |
92 | o 1: B |
|
92 | o 1: B | |
93 | | |
|
93 | | | |
94 | o 0: A |
|
94 | o 0: A | |
95 |
|
95 |
@@ -1,385 +1,385 b'' | |||||
1 | Test uncommit - set up the config |
|
1 | Test uncommit - set up the config | |
2 |
|
2 | |||
3 | $ cat >> $HGRCPATH <<EOF |
|
3 | $ cat >> $HGRCPATH <<EOF | |
4 | > [experimental] |
|
4 | > [experimental] | |
5 | > evolution=allowunstable |
|
|||
6 | > evolution.createmarkers=True |
|
5 | > evolution.createmarkers=True | |
|
6 | > evolution.allowunstable=True | |||
7 | > [extensions] |
|
7 | > [extensions] | |
8 | > uncommit = |
|
8 | > uncommit = | |
9 | > drawdag=$TESTDIR/drawdag.py |
|
9 | > drawdag=$TESTDIR/drawdag.py | |
10 | > EOF |
|
10 | > EOF | |
11 |
|
11 | |||
12 | Build up a repo |
|
12 | Build up a repo | |
13 |
|
13 | |||
14 | $ hg init repo |
|
14 | $ hg init repo | |
15 | $ cd repo |
|
15 | $ cd repo | |
16 | $ hg bookmark foo |
|
16 | $ hg bookmark foo | |
17 |
|
17 | |||
18 | Help for uncommit |
|
18 | Help for uncommit | |
19 |
|
19 | |||
20 | $ hg help uncommit |
|
20 | $ hg help uncommit | |
21 | hg uncommit [OPTION]... [FILE]... |
|
21 | hg uncommit [OPTION]... [FILE]... | |
22 |
|
22 | |||
23 | uncommit part or all of a local changeset |
|
23 | uncommit part or all of a local changeset | |
24 |
|
24 | |||
25 | This command undoes the effect of a local commit, returning the affected |
|
25 | This command undoes the effect of a local commit, returning the affected | |
26 | files to their uncommitted state. This means that files modified or |
|
26 | files to their uncommitted state. This means that files modified or | |
27 | deleted in the changeset will be left unchanged, and so will remain |
|
27 | deleted in the changeset will be left unchanged, and so will remain | |
28 | modified in the working directory. |
|
28 | modified in the working directory. | |
29 |
|
29 | |||
30 | (use 'hg help -e uncommit' to show help for the uncommit extension) |
|
30 | (use 'hg help -e uncommit' to show help for the uncommit extension) | |
31 |
|
31 | |||
32 | options ([+] can be repeated): |
|
32 | options ([+] can be repeated): | |
33 |
|
33 | |||
34 | --keep allow an empty commit after uncommiting |
|
34 | --keep allow an empty commit after uncommiting | |
35 | -I --include PATTERN [+] include names matching the given patterns |
|
35 | -I --include PATTERN [+] include names matching the given patterns | |
36 | -X --exclude PATTERN [+] exclude names matching the given patterns |
|
36 | -X --exclude PATTERN [+] exclude names matching the given patterns | |
37 |
|
37 | |||
38 | (some details hidden, use --verbose to show complete help) |
|
38 | (some details hidden, use --verbose to show complete help) | |
39 |
|
39 | |||
40 | Uncommit with no commits should fail |
|
40 | Uncommit with no commits should fail | |
41 |
|
41 | |||
42 | $ hg uncommit |
|
42 | $ hg uncommit | |
43 | abort: cannot uncommit null changeset |
|
43 | abort: cannot uncommit null changeset | |
44 | [255] |
|
44 | [255] | |
45 |
|
45 | |||
46 | Create some commits |
|
46 | Create some commits | |
47 |
|
47 | |||
48 | $ touch files |
|
48 | $ touch files | |
49 | $ hg add files |
|
49 | $ hg add files | |
50 | $ for i in a ab abc abcd abcde; do echo $i > files; echo $i > file-$i; hg add file-$i; hg commit -m "added file-$i"; done |
|
50 | $ for i in a ab abc abcd abcde; do echo $i > files; echo $i > file-$i; hg add file-$i; hg commit -m "added file-$i"; done | |
51 | $ ls |
|
51 | $ ls | |
52 | file-a |
|
52 | file-a | |
53 | file-ab |
|
53 | file-ab | |
54 | file-abc |
|
54 | file-abc | |
55 | file-abcd |
|
55 | file-abcd | |
56 | file-abcde |
|
56 | file-abcde | |
57 | files |
|
57 | files | |
58 |
|
58 | |||
59 | $ hg log -G -T '{rev}:{node} {desc}' --hidden |
|
59 | $ hg log -G -T '{rev}:{node} {desc}' --hidden | |
60 | @ 4:6c4fd43ed714e7fcd8adbaa7b16c953c2e985b60 added file-abcde |
|
60 | @ 4:6c4fd43ed714e7fcd8adbaa7b16c953c2e985b60 added file-abcde | |
61 | | |
|
61 | | | |
62 | o 3:6db330d65db434145c0b59d291853e9a84719b24 added file-abcd |
|
62 | o 3:6db330d65db434145c0b59d291853e9a84719b24 added file-abcd | |
63 | | |
|
63 | | | |
64 | o 2:abf2df566fc193b3ac34d946e63c1583e4d4732b added file-abc |
|
64 | o 2:abf2df566fc193b3ac34d946e63c1583e4d4732b added file-abc | |
65 | | |
|
65 | | | |
66 | o 1:69a232e754b08d568c4899475faf2eb44b857802 added file-ab |
|
66 | o 1:69a232e754b08d568c4899475faf2eb44b857802 added file-ab | |
67 | | |
|
67 | | | |
68 | o 0:3004d2d9b50883c1538fc754a3aeb55f1b4084f6 added file-a |
|
68 | o 0:3004d2d9b50883c1538fc754a3aeb55f1b4084f6 added file-a | |
69 |
|
69 | |||
70 | Simple uncommit off the top, also moves bookmark |
|
70 | Simple uncommit off the top, also moves bookmark | |
71 |
|
71 | |||
72 | $ hg bookmark |
|
72 | $ hg bookmark | |
73 | * foo 4:6c4fd43ed714 |
|
73 | * foo 4:6c4fd43ed714 | |
74 | $ hg uncommit |
|
74 | $ hg uncommit | |
75 | $ hg status |
|
75 | $ hg status | |
76 | M files |
|
76 | M files | |
77 | A file-abcde |
|
77 | A file-abcde | |
78 | $ hg bookmark |
|
78 | $ hg bookmark | |
79 | * foo 3:6db330d65db4 |
|
79 | * foo 3:6db330d65db4 | |
80 |
|
80 | |||
81 | $ hg log -G -T '{rev}:{node} {desc}' --hidden |
|
81 | $ hg log -G -T '{rev}:{node} {desc}' --hidden | |
82 | x 4:6c4fd43ed714e7fcd8adbaa7b16c953c2e985b60 added file-abcde |
|
82 | x 4:6c4fd43ed714e7fcd8adbaa7b16c953c2e985b60 added file-abcde | |
83 | | |
|
83 | | | |
84 | @ 3:6db330d65db434145c0b59d291853e9a84719b24 added file-abcd |
|
84 | @ 3:6db330d65db434145c0b59d291853e9a84719b24 added file-abcd | |
85 | | |
|
85 | | | |
86 | o 2:abf2df566fc193b3ac34d946e63c1583e4d4732b added file-abc |
|
86 | o 2:abf2df566fc193b3ac34d946e63c1583e4d4732b added file-abc | |
87 | | |
|
87 | | | |
88 | o 1:69a232e754b08d568c4899475faf2eb44b857802 added file-ab |
|
88 | o 1:69a232e754b08d568c4899475faf2eb44b857802 added file-ab | |
89 | | |
|
89 | | | |
90 | o 0:3004d2d9b50883c1538fc754a3aeb55f1b4084f6 added file-a |
|
90 | o 0:3004d2d9b50883c1538fc754a3aeb55f1b4084f6 added file-a | |
91 |
|
91 | |||
92 |
|
92 | |||
93 | Recommit |
|
93 | Recommit | |
94 |
|
94 | |||
95 | $ hg commit -m 'new change abcde' |
|
95 | $ hg commit -m 'new change abcde' | |
96 | $ hg status |
|
96 | $ hg status | |
97 | $ hg heads -T '{rev}:{node} {desc}' |
|
97 | $ hg heads -T '{rev}:{node} {desc}' | |
98 | 5:0c07a3ccda771b25f1cb1edbd02e683723344ef1 new change abcde (no-eol) |
|
98 | 5:0c07a3ccda771b25f1cb1edbd02e683723344ef1 new change abcde (no-eol) | |
99 |
|
99 | |||
100 | Uncommit of non-existent and unchanged files has no effect |
|
100 | Uncommit of non-existent and unchanged files has no effect | |
101 | $ hg uncommit nothinghere |
|
101 | $ hg uncommit nothinghere | |
102 | nothing to uncommit |
|
102 | nothing to uncommit | |
103 | [1] |
|
103 | [1] | |
104 | $ hg status |
|
104 | $ hg status | |
105 | $ hg uncommit file-abc |
|
105 | $ hg uncommit file-abc | |
106 | nothing to uncommit |
|
106 | nothing to uncommit | |
107 | [1] |
|
107 | [1] | |
108 | $ hg status |
|
108 | $ hg status | |
109 |
|
109 | |||
110 | Try partial uncommit, also moves bookmark |
|
110 | Try partial uncommit, also moves bookmark | |
111 |
|
111 | |||
112 | $ hg bookmark |
|
112 | $ hg bookmark | |
113 | * foo 5:0c07a3ccda77 |
|
113 | * foo 5:0c07a3ccda77 | |
114 | $ hg uncommit files |
|
114 | $ hg uncommit files | |
115 | $ hg status |
|
115 | $ hg status | |
116 | M files |
|
116 | M files | |
117 | $ hg bookmark |
|
117 | $ hg bookmark | |
118 | * foo 6:3727deee06f7 |
|
118 | * foo 6:3727deee06f7 | |
119 | $ hg heads -T '{rev}:{node} {desc}' |
|
119 | $ hg heads -T '{rev}:{node} {desc}' | |
120 | 6:3727deee06f72f5ffa8db792ee299cf39e3e190b new change abcde (no-eol) |
|
120 | 6:3727deee06f72f5ffa8db792ee299cf39e3e190b new change abcde (no-eol) | |
121 | $ hg log -r . -p -T '{rev}:{node} {desc}' |
|
121 | $ hg log -r . -p -T '{rev}:{node} {desc}' | |
122 | 6:3727deee06f72f5ffa8db792ee299cf39e3e190b new change abcdediff -r 6db330d65db4 -r 3727deee06f7 file-abcde |
|
122 | 6:3727deee06f72f5ffa8db792ee299cf39e3e190b new change abcdediff -r 6db330d65db4 -r 3727deee06f7 file-abcde | |
123 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
123 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
124 | +++ b/file-abcde Thu Jan 01 00:00:00 1970 +0000 |
|
124 | +++ b/file-abcde Thu Jan 01 00:00:00 1970 +0000 | |
125 | @@ -0,0 +1,1 @@ |
|
125 | @@ -0,0 +1,1 @@ | |
126 | +abcde |
|
126 | +abcde | |
127 |
|
127 | |||
128 | $ hg log -G -T '{rev}:{node} {desc}' --hidden |
|
128 | $ hg log -G -T '{rev}:{node} {desc}' --hidden | |
129 | @ 6:3727deee06f72f5ffa8db792ee299cf39e3e190b new change abcde |
|
129 | @ 6:3727deee06f72f5ffa8db792ee299cf39e3e190b new change abcde | |
130 | | |
|
130 | | | |
131 | | x 5:0c07a3ccda771b25f1cb1edbd02e683723344ef1 new change abcde |
|
131 | | x 5:0c07a3ccda771b25f1cb1edbd02e683723344ef1 new change abcde | |
132 | |/ |
|
132 | |/ | |
133 | | x 4:6c4fd43ed714e7fcd8adbaa7b16c953c2e985b60 added file-abcde |
|
133 | | x 4:6c4fd43ed714e7fcd8adbaa7b16c953c2e985b60 added file-abcde | |
134 | |/ |
|
134 | |/ | |
135 | o 3:6db330d65db434145c0b59d291853e9a84719b24 added file-abcd |
|
135 | o 3:6db330d65db434145c0b59d291853e9a84719b24 added file-abcd | |
136 | | |
|
136 | | | |
137 | o 2:abf2df566fc193b3ac34d946e63c1583e4d4732b added file-abc |
|
137 | o 2:abf2df566fc193b3ac34d946e63c1583e4d4732b added file-abc | |
138 | | |
|
138 | | | |
139 | o 1:69a232e754b08d568c4899475faf2eb44b857802 added file-ab |
|
139 | o 1:69a232e754b08d568c4899475faf2eb44b857802 added file-ab | |
140 | | |
|
140 | | | |
141 | o 0:3004d2d9b50883c1538fc754a3aeb55f1b4084f6 added file-a |
|
141 | o 0:3004d2d9b50883c1538fc754a3aeb55f1b4084f6 added file-a | |
142 |
|
142 | |||
143 | $ hg commit -m 'update files for abcde' |
|
143 | $ hg commit -m 'update files for abcde' | |
144 |
|
144 | |||
145 | Uncommit with dirty state |
|
145 | Uncommit with dirty state | |
146 |
|
146 | |||
147 | $ echo "foo" >> files |
|
147 | $ echo "foo" >> files | |
148 | $ cat files |
|
148 | $ cat files | |
149 | abcde |
|
149 | abcde | |
150 | foo |
|
150 | foo | |
151 | $ hg status |
|
151 | $ hg status | |
152 | M files |
|
152 | M files | |
153 | $ hg uncommit |
|
153 | $ hg uncommit | |
154 | abort: uncommitted changes |
|
154 | abort: uncommitted changes | |
155 | [255] |
|
155 | [255] | |
156 | $ hg uncommit files |
|
156 | $ hg uncommit files | |
157 | $ cat files |
|
157 | $ cat files | |
158 | abcde |
|
158 | abcde | |
159 | foo |
|
159 | foo | |
160 | $ hg commit -m "files abcde + foo" |
|
160 | $ hg commit -m "files abcde + foo" | |
161 |
|
161 | |||
162 | Testing the 'experimental.uncommitondirtywdir' config |
|
162 | Testing the 'experimental.uncommitondirtywdir' config | |
163 |
|
163 | |||
164 | $ echo "bar" >> files |
|
164 | $ echo "bar" >> files | |
165 | $ hg uncommit |
|
165 | $ hg uncommit | |
166 | abort: uncommitted changes |
|
166 | abort: uncommitted changes | |
167 | [255] |
|
167 | [255] | |
168 | $ hg uncommit --config experimental.uncommitondirtywdir=True |
|
168 | $ hg uncommit --config experimental.uncommitondirtywdir=True | |
169 | $ hg commit -m "files abcde + foo" |
|
169 | $ hg commit -m "files abcde + foo" | |
170 |
|
170 | |||
171 | Uncommit in the middle of a stack, does not move bookmark |
|
171 | Uncommit in the middle of a stack, does not move bookmark | |
172 |
|
172 | |||
173 | $ hg checkout '.^^^' |
|
173 | $ hg checkout '.^^^' | |
174 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
174 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
175 | (leaving bookmark foo) |
|
175 | (leaving bookmark foo) | |
176 | $ hg log -r . -p -T '{rev}:{node} {desc}' |
|
176 | $ hg log -r . -p -T '{rev}:{node} {desc}' | |
177 | 2:abf2df566fc193b3ac34d946e63c1583e4d4732b added file-abcdiff -r 69a232e754b0 -r abf2df566fc1 file-abc |
|
177 | 2:abf2df566fc193b3ac34d946e63c1583e4d4732b added file-abcdiff -r 69a232e754b0 -r abf2df566fc1 file-abc | |
178 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
178 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
179 | +++ b/file-abc Thu Jan 01 00:00:00 1970 +0000 |
|
179 | +++ b/file-abc Thu Jan 01 00:00:00 1970 +0000 | |
180 | @@ -0,0 +1,1 @@ |
|
180 | @@ -0,0 +1,1 @@ | |
181 | +abc |
|
181 | +abc | |
182 | diff -r 69a232e754b0 -r abf2df566fc1 files |
|
182 | diff -r 69a232e754b0 -r abf2df566fc1 files | |
183 | --- a/files Thu Jan 01 00:00:00 1970 +0000 |
|
183 | --- a/files Thu Jan 01 00:00:00 1970 +0000 | |
184 | +++ b/files Thu Jan 01 00:00:00 1970 +0000 |
|
184 | +++ b/files Thu Jan 01 00:00:00 1970 +0000 | |
185 | @@ -1,1 +1,1 @@ |
|
185 | @@ -1,1 +1,1 @@ | |
186 | -ab |
|
186 | -ab | |
187 | +abc |
|
187 | +abc | |
188 |
|
188 | |||
189 | $ hg bookmark |
|
189 | $ hg bookmark | |
190 | foo 9:48e5bd7cd583 |
|
190 | foo 9:48e5bd7cd583 | |
191 | $ hg uncommit |
|
191 | $ hg uncommit | |
192 | $ hg status |
|
192 | $ hg status | |
193 | M files |
|
193 | M files | |
194 | A file-abc |
|
194 | A file-abc | |
195 | $ hg heads -T '{rev}:{node} {desc}' |
|
195 | $ hg heads -T '{rev}:{node} {desc}' | |
196 | 9:48e5bd7cd583eb24164ef8b89185819c84c96ed7 files abcde + foo (no-eol) |
|
196 | 9:48e5bd7cd583eb24164ef8b89185819c84c96ed7 files abcde + foo (no-eol) | |
197 | $ hg bookmark |
|
197 | $ hg bookmark | |
198 | foo 9:48e5bd7cd583 |
|
198 | foo 9:48e5bd7cd583 | |
199 | $ hg commit -m 'new abc' |
|
199 | $ hg commit -m 'new abc' | |
200 | created new head |
|
200 | created new head | |
201 |
|
201 | |||
202 | Partial uncommit in the middle, does not move bookmark |
|
202 | Partial uncommit in the middle, does not move bookmark | |
203 |
|
203 | |||
204 | $ hg checkout '.^' |
|
204 | $ hg checkout '.^' | |
205 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
205 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
206 | $ hg log -r . -p -T '{rev}:{node} {desc}' |
|
206 | $ hg log -r . -p -T '{rev}:{node} {desc}' | |
207 | 1:69a232e754b08d568c4899475faf2eb44b857802 added file-abdiff -r 3004d2d9b508 -r 69a232e754b0 file-ab |
|
207 | 1:69a232e754b08d568c4899475faf2eb44b857802 added file-abdiff -r 3004d2d9b508 -r 69a232e754b0 file-ab | |
208 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
208 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
209 | +++ b/file-ab Thu Jan 01 00:00:00 1970 +0000 |
|
209 | +++ b/file-ab Thu Jan 01 00:00:00 1970 +0000 | |
210 | @@ -0,0 +1,1 @@ |
|
210 | @@ -0,0 +1,1 @@ | |
211 | +ab |
|
211 | +ab | |
212 | diff -r 3004d2d9b508 -r 69a232e754b0 files |
|
212 | diff -r 3004d2d9b508 -r 69a232e754b0 files | |
213 | --- a/files Thu Jan 01 00:00:00 1970 +0000 |
|
213 | --- a/files Thu Jan 01 00:00:00 1970 +0000 | |
214 | +++ b/files Thu Jan 01 00:00:00 1970 +0000 |
|
214 | +++ b/files Thu Jan 01 00:00:00 1970 +0000 | |
215 | @@ -1,1 +1,1 @@ |
|
215 | @@ -1,1 +1,1 @@ | |
216 | -a |
|
216 | -a | |
217 | +ab |
|
217 | +ab | |
218 |
|
218 | |||
219 | $ hg bookmark |
|
219 | $ hg bookmark | |
220 | foo 9:48e5bd7cd583 |
|
220 | foo 9:48e5bd7cd583 | |
221 | $ hg uncommit file-ab |
|
221 | $ hg uncommit file-ab | |
222 | $ hg status |
|
222 | $ hg status | |
223 | A file-ab |
|
223 | A file-ab | |
224 |
|
224 | |||
225 | $ hg heads -T '{rev}:{node} {desc}\n' |
|
225 | $ hg heads -T '{rev}:{node} {desc}\n' | |
226 | 11:8eb87968f2edb7f27f27fe676316e179de65fff6 added file-ab |
|
226 | 11:8eb87968f2edb7f27f27fe676316e179de65fff6 added file-ab | |
227 | 10:5dc89ca4486f8a88716c5797fa9f498d13d7c2e1 new abc |
|
227 | 10:5dc89ca4486f8a88716c5797fa9f498d13d7c2e1 new abc | |
228 | 9:48e5bd7cd583eb24164ef8b89185819c84c96ed7 files abcde + foo |
|
228 | 9:48e5bd7cd583eb24164ef8b89185819c84c96ed7 files abcde + foo | |
229 |
|
229 | |||
230 | $ hg bookmark |
|
230 | $ hg bookmark | |
231 | foo 9:48e5bd7cd583 |
|
231 | foo 9:48e5bd7cd583 | |
232 | $ hg commit -m 'update ab' |
|
232 | $ hg commit -m 'update ab' | |
233 | $ hg status |
|
233 | $ hg status | |
234 | $ hg heads -T '{rev}:{node} {desc}\n' |
|
234 | $ hg heads -T '{rev}:{node} {desc}\n' | |
235 | 12:f21039c59242b085491bb58f591afc4ed1c04c09 update ab |
|
235 | 12:f21039c59242b085491bb58f591afc4ed1c04c09 update ab | |
236 | 10:5dc89ca4486f8a88716c5797fa9f498d13d7c2e1 new abc |
|
236 | 10:5dc89ca4486f8a88716c5797fa9f498d13d7c2e1 new abc | |
237 | 9:48e5bd7cd583eb24164ef8b89185819c84c96ed7 files abcde + foo |
|
237 | 9:48e5bd7cd583eb24164ef8b89185819c84c96ed7 files abcde + foo | |
238 |
|
238 | |||
239 | $ hg log -G -T '{rev}:{node} {desc}' --hidden |
|
239 | $ hg log -G -T '{rev}:{node} {desc}' --hidden | |
240 | @ 12:f21039c59242b085491bb58f591afc4ed1c04c09 update ab |
|
240 | @ 12:f21039c59242b085491bb58f591afc4ed1c04c09 update ab | |
241 | | |
|
241 | | | |
242 | o 11:8eb87968f2edb7f27f27fe676316e179de65fff6 added file-ab |
|
242 | o 11:8eb87968f2edb7f27f27fe676316e179de65fff6 added file-ab | |
243 | | |
|
243 | | | |
244 | | o 10:5dc89ca4486f8a88716c5797fa9f498d13d7c2e1 new abc |
|
244 | | o 10:5dc89ca4486f8a88716c5797fa9f498d13d7c2e1 new abc | |
245 | | | |
|
245 | | | | |
246 | | | o 9:48e5bd7cd583eb24164ef8b89185819c84c96ed7 files abcde + foo |
|
246 | | | o 9:48e5bd7cd583eb24164ef8b89185819c84c96ed7 files abcde + foo | |
247 | | | | |
|
247 | | | | | |
248 | | | | x 8:83815831694b1271e9f207cb1b79b2b19275edcb files abcde + foo |
|
248 | | | | x 8:83815831694b1271e9f207cb1b79b2b19275edcb files abcde + foo | |
249 | | | |/ |
|
249 | | | |/ | |
250 | | | | x 7:0977fa602c2fd7d8427ed4e7ee15ea13b84c9173 update files for abcde |
|
250 | | | | x 7:0977fa602c2fd7d8427ed4e7ee15ea13b84c9173 update files for abcde | |
251 | | | |/ |
|
251 | | | |/ | |
252 | | | o 6:3727deee06f72f5ffa8db792ee299cf39e3e190b new change abcde |
|
252 | | | o 6:3727deee06f72f5ffa8db792ee299cf39e3e190b new change abcde | |
253 | | | | |
|
253 | | | | | |
254 | | | | x 5:0c07a3ccda771b25f1cb1edbd02e683723344ef1 new change abcde |
|
254 | | | | x 5:0c07a3ccda771b25f1cb1edbd02e683723344ef1 new change abcde | |
255 | | | |/ |
|
255 | | | |/ | |
256 | | | | x 4:6c4fd43ed714e7fcd8adbaa7b16c953c2e985b60 added file-abcde |
|
256 | | | | x 4:6c4fd43ed714e7fcd8adbaa7b16c953c2e985b60 added file-abcde | |
257 | | | |/ |
|
257 | | | |/ | |
258 | | | o 3:6db330d65db434145c0b59d291853e9a84719b24 added file-abcd |
|
258 | | | o 3:6db330d65db434145c0b59d291853e9a84719b24 added file-abcd | |
259 | | | | |
|
259 | | | | | |
260 | | | x 2:abf2df566fc193b3ac34d946e63c1583e4d4732b added file-abc |
|
260 | | | x 2:abf2df566fc193b3ac34d946e63c1583e4d4732b added file-abc | |
261 | | |/ |
|
261 | | |/ | |
262 | | x 1:69a232e754b08d568c4899475faf2eb44b857802 added file-ab |
|
262 | | x 1:69a232e754b08d568c4899475faf2eb44b857802 added file-ab | |
263 | |/ |
|
263 | |/ | |
264 | o 0:3004d2d9b50883c1538fc754a3aeb55f1b4084f6 added file-a |
|
264 | o 0:3004d2d9b50883c1538fc754a3aeb55f1b4084f6 added file-a | |
265 |
|
265 | |||
266 | Uncommit with draft parent |
|
266 | Uncommit with draft parent | |
267 |
|
267 | |||
268 | $ hg uncommit |
|
268 | $ hg uncommit | |
269 | $ hg phase -r . |
|
269 | $ hg phase -r . | |
270 | 11: draft |
|
270 | 11: draft | |
271 | $ hg commit -m 'update ab again' |
|
271 | $ hg commit -m 'update ab again' | |
272 |
|
272 | |||
273 | Uncommit with public parent |
|
273 | Uncommit with public parent | |
274 |
|
274 | |||
275 | $ hg phase -p "::.^" |
|
275 | $ hg phase -p "::.^" | |
276 | $ hg uncommit |
|
276 | $ hg uncommit | |
277 | $ hg phase -r . |
|
277 | $ hg phase -r . | |
278 | 11: public |
|
278 | 11: public | |
279 |
|
279 | |||
280 | Partial uncommit with public parent |
|
280 | Partial uncommit with public parent | |
281 |
|
281 | |||
282 | $ echo xyz > xyz |
|
282 | $ echo xyz > xyz | |
283 | $ hg add xyz |
|
283 | $ hg add xyz | |
284 | $ hg commit -m "update ab and add xyz" |
|
284 | $ hg commit -m "update ab and add xyz" | |
285 | $ hg uncommit xyz |
|
285 | $ hg uncommit xyz | |
286 | $ hg status |
|
286 | $ hg status | |
287 | A xyz |
|
287 | A xyz | |
288 | $ hg phase -r . |
|
288 | $ hg phase -r . | |
289 | 15: draft |
|
289 | 15: draft | |
290 | $ hg phase -r ".^" |
|
290 | $ hg phase -r ".^" | |
291 | 11: public |
|
291 | 11: public | |
292 |
|
292 | |||
293 | Uncommit leaving an empty changeset |
|
293 | Uncommit leaving an empty changeset | |
294 |
|
294 | |||
295 | $ cd $TESTTMP |
|
295 | $ cd $TESTTMP | |
296 | $ hg init repo1 |
|
296 | $ hg init repo1 | |
297 | $ cd repo1 |
|
297 | $ cd repo1 | |
298 | $ hg debugdrawdag <<'EOS' |
|
298 | $ hg debugdrawdag <<'EOS' | |
299 | > Q |
|
299 | > Q | |
300 | > | |
|
300 | > | | |
301 | > P |
|
301 | > P | |
302 | > EOS |
|
302 | > EOS | |
303 | $ hg up Q -q |
|
303 | $ hg up Q -q | |
304 | $ hg uncommit --keep |
|
304 | $ hg uncommit --keep | |
305 | $ hg log -G -T '{desc} FILES: {files}' |
|
305 | $ hg log -G -T '{desc} FILES: {files}' | |
306 | @ Q FILES: |
|
306 | @ Q FILES: | |
307 | | |
|
307 | | | |
308 | | x Q FILES: Q |
|
308 | | x Q FILES: Q | |
309 | |/ |
|
309 | |/ | |
310 | o P FILES: P |
|
310 | o P FILES: P | |
311 |
|
311 | |||
312 | $ hg status |
|
312 | $ hg status | |
313 | A Q |
|
313 | A Q | |
314 |
|
314 | |||
315 | $ cd .. |
|
315 | $ cd .. | |
316 | $ rm -rf repo1 |
|
316 | $ rm -rf repo1 | |
317 |
|
317 | |||
318 | Testing uncommit while merge |
|
318 | Testing uncommit while merge | |
319 |
|
319 | |||
320 | $ hg init repo2 |
|
320 | $ hg init repo2 | |
321 | $ cd repo2 |
|
321 | $ cd repo2 | |
322 |
|
322 | |||
323 | Create some history |
|
323 | Create some history | |
324 |
|
324 | |||
325 | $ touch a |
|
325 | $ touch a | |
326 | $ hg add a |
|
326 | $ hg add a | |
327 | $ for i in 1 2 3; do echo $i > a; hg commit -m "a $i"; done |
|
327 | $ for i in 1 2 3; do echo $i > a; hg commit -m "a $i"; done | |
328 | $ hg checkout 0 |
|
328 | $ hg checkout 0 | |
329 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
329 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
330 | $ touch b |
|
330 | $ touch b | |
331 | $ hg add b |
|
331 | $ hg add b | |
332 | $ for i in 1 2 3; do echo $i > b; hg commit -m "b $i"; done |
|
332 | $ for i in 1 2 3; do echo $i > b; hg commit -m "b $i"; done | |
333 | created new head |
|
333 | created new head | |
334 | $ hg log -G -T '{rev}:{node} {desc}' --hidden |
|
334 | $ hg log -G -T '{rev}:{node} {desc}' --hidden | |
335 | @ 5:2cd56cdde163ded2fbb16ba2f918c96046ab0bf2 b 3 |
|
335 | @ 5:2cd56cdde163ded2fbb16ba2f918c96046ab0bf2 b 3 | |
336 | | |
|
336 | | | |
337 | o 4:c3a0d5bb3b15834ffd2ef9ef603e93ec65cf2037 b 2 |
|
337 | o 4:c3a0d5bb3b15834ffd2ef9ef603e93ec65cf2037 b 2 | |
338 | | |
|
338 | | | |
339 | o 3:49bb009ca26078726b8870f1edb29fae8f7618f5 b 1 |
|
339 | o 3:49bb009ca26078726b8870f1edb29fae8f7618f5 b 1 | |
340 | | |
|
340 | | | |
341 | | o 2:990982b7384266e691f1bc08ca36177adcd1c8a9 a 3 |
|
341 | | o 2:990982b7384266e691f1bc08ca36177adcd1c8a9 a 3 | |
342 | | | |
|
342 | | | | |
343 | | o 1:24d38e3cf160c7b6f5ffe82179332229886a6d34 a 2 |
|
343 | | o 1:24d38e3cf160c7b6f5ffe82179332229886a6d34 a 2 | |
344 | |/ |
|
344 | |/ | |
345 | o 0:ea4e33293d4d274a2ba73150733c2612231f398c a 1 |
|
345 | o 0:ea4e33293d4d274a2ba73150733c2612231f398c a 1 | |
346 |
|
346 | |||
347 |
|
347 | |||
348 | Add and expect uncommit to fail on both merge working dir and merge changeset |
|
348 | Add and expect uncommit to fail on both merge working dir and merge changeset | |
349 |
|
349 | |||
350 | $ hg merge 2 |
|
350 | $ hg merge 2 | |
351 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
351 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
352 | (branch merge, don't forget to commit) |
|
352 | (branch merge, don't forget to commit) | |
353 |
|
353 | |||
354 | $ hg uncommit |
|
354 | $ hg uncommit | |
355 | abort: outstanding uncommitted merge |
|
355 | abort: outstanding uncommitted merge | |
356 | [255] |
|
356 | [255] | |
357 |
|
357 | |||
358 | $ hg uncommit --config experimental.uncommitondirtywdir=True |
|
358 | $ hg uncommit --config experimental.uncommitondirtywdir=True | |
359 | abort: cannot uncommit while merging |
|
359 | abort: cannot uncommit while merging | |
360 | [255] |
|
360 | [255] | |
361 |
|
361 | |||
362 | $ hg status |
|
362 | $ hg status | |
363 | M a |
|
363 | M a | |
364 | $ hg commit -m 'merge a and b' |
|
364 | $ hg commit -m 'merge a and b' | |
365 |
|
365 | |||
366 | $ hg uncommit |
|
366 | $ hg uncommit | |
367 | abort: cannot uncommit merge changeset |
|
367 | abort: cannot uncommit merge changeset | |
368 | [255] |
|
368 | [255] | |
369 |
|
369 | |||
370 | $ hg status |
|
370 | $ hg status | |
371 | $ hg log -G -T '{rev}:{node} {desc}' --hidden |
|
371 | $ hg log -G -T '{rev}:{node} {desc}' --hidden | |
372 | @ 6:c03b9c37bc67bf504d4912061cfb527b47a63c6e merge a and b |
|
372 | @ 6:c03b9c37bc67bf504d4912061cfb527b47a63c6e merge a and b | |
373 | |\ |
|
373 | |\ | |
374 | | o 5:2cd56cdde163ded2fbb16ba2f918c96046ab0bf2 b 3 |
|
374 | | o 5:2cd56cdde163ded2fbb16ba2f918c96046ab0bf2 b 3 | |
375 | | | |
|
375 | | | | |
376 | | o 4:c3a0d5bb3b15834ffd2ef9ef603e93ec65cf2037 b 2 |
|
376 | | o 4:c3a0d5bb3b15834ffd2ef9ef603e93ec65cf2037 b 2 | |
377 | | | |
|
377 | | | | |
378 | | o 3:49bb009ca26078726b8870f1edb29fae8f7618f5 b 1 |
|
378 | | o 3:49bb009ca26078726b8870f1edb29fae8f7618f5 b 1 | |
379 | | | |
|
379 | | | | |
380 | o | 2:990982b7384266e691f1bc08ca36177adcd1c8a9 a 3 |
|
380 | o | 2:990982b7384266e691f1bc08ca36177adcd1c8a9 a 3 | |
381 | | | |
|
381 | | | | |
382 | o | 1:24d38e3cf160c7b6f5ffe82179332229886a6d34 a 2 |
|
382 | o | 1:24d38e3cf160c7b6f5ffe82179332229886a6d34 a 2 | |
383 | |/ |
|
383 | |/ | |
384 | o 0:ea4e33293d4d274a2ba73150733c2612231f398c a 1 |
|
384 | o 0:ea4e33293d4d274a2ba73150733c2612231f398c a 1 | |
385 |
|
385 |
General Comments 0
You need to be logged in to leave comments.
Login now