##// END OF EJS Templates
merge with nicdumz
Matt Mackall -
r14127:f45c8db2 merge default
parent child Browse files
Show More
1 NO CONTENT: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
@@ -0,0 +1,44 b''
1 #!/bin/bash
2 hg init rebase
3 cd rebase
4
5 # @ 7: 'H'
6 # |
7 # | o 6: 'G'
8 # |/|
9 # o | 5: 'F'
10 # | |
11 # | o 4: 'E'
12 # |/
13 # | o 3: 'D'
14 # | |
15 # | o 2: 'C'
16 # | |
17 # | o 1: 'B'
18 # |/
19 # o 0: 'A'
20
21 echo A > A
22 hg ci -Am A
23 echo B > B
24 hg ci -Am B
25 echo C > C
26 hg ci -Am C
27 echo D > D
28 hg ci -Am D
29 hg up -q -C 0
30 echo E > E
31 hg ci -Am E
32 hg up -q -C 0
33 echo F > F
34 hg ci -Am F
35 hg merge -r 4
36 hg ci -m G
37 hg up -q -C 5
38 echo H > H
39 hg ci -Am H
40
41 hg bundle -a ../rebase.hg
42
43 cd ..
44 rm -Rf rebase
1 NO CONTENT: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
@@ -0,0 +1,32 b''
1 #!/bin/bash
2 hg init remote
3 cd remote
4
5 echo "0" >> afile
6 hg add afile
7 hg commit -m "0.0"
8 echo "1" >> afile
9 hg commit -m "0.1"
10 echo "2" >> afile
11 hg commit -m "0.2"
12 echo "3" >> afile
13 hg commit -m "0.3"
14 hg update -C 0
15 echo "1" >> afile
16 hg commit -m "1.1"
17 echo "2" >> afile
18 hg commit -m "1.2"
19 echo "a line" > fred
20 echo "3" >> afile
21 hg add fred
22 hg commit -m "1.3"
23 hg mv afile adifferentfile
24 hg commit -m "1.3m"
25 hg update -C 3
26 hg mv afile anotherfile
27 hg commit -m "0.3m"
28
29 hg bundle -a ../remote.hg
30
31 cd ..
32 rm -Rf remote
1 NO CONTENT: file renamed from tests/darcs1.hg to tests/bundles/darcs1.hg
NO CONTENT: file renamed from tests/darcs1.hg to tests/bundles/darcs1.hg
1 NO CONTENT: file renamed from tests/legacy-encoding.hg to tests/bundles/legacy-encoding.hg
NO CONTENT: file renamed from tests/legacy-encoding.hg to tests/bundles/legacy-encoding.hg
1 NO CONTENT: file renamed from tests/tampered.hg to tests/bundles/tampered.hg
NO CONTENT: file renamed from tests/tampered.hg to tests/bundles/tampered.hg
1 NO CONTENT: file renamed from tests/test-keyword.hg to tests/bundles/test-keyword.hg
NO CONTENT: file renamed from tests/test-keyword.hg to tests/bundles/test-keyword.hg
1 NO CONTENT: file renamed from tests/test-manifest.hg to tests/bundles/test-manifest.hg
NO CONTENT: file renamed from tests/test-manifest.hg to tests/bundles/test-manifest.hg
1 NO CONTENT: file renamed from tests/test-merge-symlinks.hg to tests/bundles/test-merge-symlinks.hg
NO CONTENT: file renamed from tests/test-merge-symlinks.hg to tests/bundles/test-merge-symlinks.hg
1 NO CONTENT: file renamed from tests/test-no-symlinks.hg to tests/bundles/test-no-symlinks.hg
NO CONTENT: file renamed from tests/test-no-symlinks.hg to tests/bundles/test-no-symlinks.hg
@@ -33,7 +33,7 b' unbundle tampered bundle'
33
33
34 $ hg init target
34 $ hg init target
35 $ cd target
35 $ cd target
36 $ hg unbundle $TESTDIR/tampered.hg
36 $ hg unbundle $TESTDIR/bundles/tampered.hg
37 adding changesets
37 adding changesets
38 adding manifests
38 adding manifests
39 adding file changes
39 adding file changes
@@ -1,62 +1,15 b''
1 $ hg init test
1 $ hg init test
2 $ cd test
2 $ cd test
3 $ echo "0" >> afile
3 $ hg unbundle $TESTDIR/bundles/remote.hg
4 $ hg add afile
4 adding changesets
5 $ hg commit -m "0.0"
5 adding manifests
6 $ echo "1" >> afile
6 adding file changes
7 $ hg commit -m "0.1"
7 added 9 changesets with 7 changes to 4 files (+1 heads)
8 $ echo "2" >> afile
8 (run 'hg heads' to see heads, 'hg merge' to merge)
9 $ hg commit -m "0.2"
9 $ hg up tip
10 $ echo "3" >> afile
11 $ hg commit -m "0.3"
12 $ hg update -C 0
13 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
10 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
14 $ echo "1" >> afile
15 $ hg commit -m "1.1"
16 created new head
17 $ echo "2" >> afile
18 $ hg commit -m "1.2"
19 $ echo "a line" > fred
20 $ echo "3" >> afile
21 $ hg add fred
22 $ hg commit -m "1.3"
23 $ hg mv afile adifferentfile
24 $ hg commit -m "1.3m"
25 $ hg update -C 3
26 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
27 $ hg mv afile anotherfile
28 $ hg commit -m "0.3m"
29 $ hg debugindex .hg/store/data/afile.i
30 rev offset length base linkrev nodeid p1 p2
31 0 0 3 0 0 362fef284ce2 000000000000 000000000000
32 1 3 5 1 1 125144f7e028 362fef284ce2 000000000000
33 2 8 7 2 2 4c982badb186 125144f7e028 000000000000
34 3 15 9 3 3 19b1fc555737 4c982badb186 000000000000
35 $ hg debugindex .hg/store/data/adifferentfile.i
36 rev offset length base linkrev nodeid p1 p2
37 0 0 75 0 7 2565f3199a74 000000000000 000000000000
38 $ hg debugindex .hg/store/data/anotherfile.i
39 rev offset length base linkrev nodeid p1 p2
40 0 0 75 0 8 2565f3199a74 000000000000 000000000000
41 $ hg debugindex .hg/store/data/fred.i
42 rev offset length base linkrev nodeid p1 p2
43 0 0 8 0 6 12ab3bcc5ea4 000000000000 000000000000
44 $ hg debugindex .hg/store/00manifest.i
45 rev offset length base linkrev nodeid p1 p2
46 0 0 48 0 0 43eadb1d2d06 000000000000 000000000000
47 1 48 48 1 1 8b89697eba2c 43eadb1d2d06 000000000000
48 2 96 48 2 2 626a32663c2f 8b89697eba2c 000000000000
49 3 144 48 3 3 f54c32f13478 626a32663c2f 000000000000
50 4 192 58 3 6 de68e904d169 626a32663c2f 000000000000
51 5 250 68 3 7 09bb521d218d de68e904d169 000000000000
52 6 318 54 6 8 1fde233dfb0f f54c32f13478 000000000000
53 $ hg verify
54 checking changesets
55 checking manifests
56 crosschecking files in changesets and manifests
57 checking files
58 4 files, 9 changesets, 7 total revisions
59 $ cd ..
11 $ cd ..
12
60 $ for i in 0 1 2 3 4 5 6 7 8; do
13 $ for i in 0 1 2 3 4 5 6 7 8; do
61 > mkdir test-"$i"
14 > mkdir test-"$i"
62 > hg --cwd test-"$i" init
15 > hg --cwd test-"$i" init
@@ -79,7 +32,7 b''
79 crosschecking files in changesets and manifests
32 crosschecking files in changesets and manifests
80 checking files
33 checking files
81 1 files, 1 changesets, 1 total revisions
34 1 files, 1 changesets, 1 total revisions
82 0:f9ee2f85a263
35 0:bfaf4b5cbf01
83 searching for changes
36 searching for changes
84 2 changesets found
37 2 changesets found
85 adding changesets
38 adding changesets
@@ -92,7 +45,7 b''
92 crosschecking files in changesets and manifests
45 crosschecking files in changesets and manifests
93 checking files
46 checking files
94 1 files, 2 changesets, 2 total revisions
47 1 files, 2 changesets, 2 total revisions
95 1:34c2bf6b0626
48 1:21f32785131f
96 searching for changes
49 searching for changes
97 3 changesets found
50 3 changesets found
98 adding changesets
51 adding changesets
@@ -105,7 +58,7 b''
105 crosschecking files in changesets and manifests
58 crosschecking files in changesets and manifests
106 checking files
59 checking files
107 1 files, 3 changesets, 3 total revisions
60 1 files, 3 changesets, 3 total revisions
108 2:e38ba6f5b7e0
61 2:4ce51a113780
109 searching for changes
62 searching for changes
110 4 changesets found
63 4 changesets found
111 adding changesets
64 adding changesets
@@ -118,7 +71,7 b''
118 crosschecking files in changesets and manifests
71 crosschecking files in changesets and manifests
119 checking files
72 checking files
120 1 files, 4 changesets, 4 total revisions
73 1 files, 4 changesets, 4 total revisions
121 3:eebf5a27f8ca
74 3:93ee6ab32777
122 searching for changes
75 searching for changes
123 2 changesets found
76 2 changesets found
124 adding changesets
77 adding changesets
@@ -131,7 +84,7 b''
131 crosschecking files in changesets and manifests
84 crosschecking files in changesets and manifests
132 checking files
85 checking files
133 1 files, 2 changesets, 2 total revisions
86 1 files, 2 changesets, 2 total revisions
134 1:095197eb4973
87 1:c70afb1ee985
135 searching for changes
88 searching for changes
136 3 changesets found
89 3 changesets found
137 adding changesets
90 adding changesets
@@ -144,7 +97,7 b''
144 crosschecking files in changesets and manifests
97 crosschecking files in changesets and manifests
145 checking files
98 checking files
146 1 files, 3 changesets, 3 total revisions
99 1 files, 3 changesets, 3 total revisions
147 2:1bb50a9436a7
100 2:f03ae5a9b979
148 searching for changes
101 searching for changes
149 4 changesets found
102 4 changesets found
150 adding changesets
103 adding changesets
@@ -157,7 +110,7 b''
157 crosschecking files in changesets and manifests
110 crosschecking files in changesets and manifests
158 checking files
111 checking files
159 2 files, 4 changesets, 5 total revisions
112 2 files, 4 changesets, 5 total revisions
160 3:7373c1169842
113 3:095cb14b1b4d
161 searching for changes
114 searching for changes
162 5 changesets found
115 5 changesets found
163 adding changesets
116 adding changesets
@@ -170,7 +123,7 b''
170 crosschecking files in changesets and manifests
123 crosschecking files in changesets and manifests
171 checking files
124 checking files
172 3 files, 5 changesets, 6 total revisions
125 3 files, 5 changesets, 6 total revisions
173 4:a6a34bfa0076
126 4:faa2e4234c7a
174 searching for changes
127 searching for changes
175 5 changesets found
128 5 changesets found
176 adding changesets
129 adding changesets
@@ -183,7 +136,7 b''
183 crosschecking files in changesets and manifests
136 crosschecking files in changesets and manifests
184 checking files
137 checking files
185 2 files, 5 changesets, 5 total revisions
138 2 files, 5 changesets, 5 total revisions
186 4:aa35859c02ea
139 4:916f1afdef90
187 $ cd test-8
140 $ cd test-8
188 $ hg pull ../test-7
141 $ hg pull ../test-7
189 pulling from ../test-7
142 pulling from ../test-7
@@ -248,18 +201,18 b' result'
248 revision 2
201 revision 2
249
202
250 $ hg tip -q
203 $ hg tip -q
251 2:e38ba6f5b7e0
204 2:4ce51a113780
252 $ hg unbundle ../test-bundle-should-fail.hg
205 $ hg unbundle ../test-bundle-should-fail.hg
253 adding changesets
206 adding changesets
254 transaction abort!
207 transaction abort!
255 rollback completed
208 rollback completed
256 abort: 00changelog.i@eebf5a27f8ca: unknown parent!
209 abort: 00changelog.i@93ee6ab32777: unknown parent!
257 [255]
210 [255]
258
211
259 revision 2
212 revision 2
260
213
261 $ hg tip -q
214 $ hg tip -q
262 2:e38ba6f5b7e0
215 2:4ce51a113780
263 $ hg unbundle ../test-bundle-all.hg
216 $ hg unbundle ../test-bundle-all.hg
264 adding changesets
217 adding changesets
265 adding manifests
218 adding manifests
@@ -270,7 +223,7 b' revision 2'
270 revision 8
223 revision 8
271
224
272 $ hg tip -q
225 $ hg tip -q
273 8:aa35859c02ea
226 8:916f1afdef90
274 $ hg verify
227 $ hg verify
275 checking changesets
228 checking changesets
276 checking manifests
229 checking manifests
@@ -284,7 +237,7 b' revision 8'
284 revision 2
237 revision 2
285
238
286 $ hg tip -q
239 $ hg tip -q
287 2:e38ba6f5b7e0
240 2:4ce51a113780
288 $ hg unbundle ../test-bundle-branch1.hg
241 $ hg unbundle ../test-bundle-branch1.hg
289 adding changesets
242 adding changesets
290 adding manifests
243 adding manifests
@@ -295,7 +248,7 b' revision 2'
295 revision 4
248 revision 4
296
249
297 $ hg tip -q
250 $ hg tip -q
298 4:aa35859c02ea
251 4:916f1afdef90
299 $ hg verify
252 $ hg verify
300 checking changesets
253 checking changesets
301 checking manifests
254 checking manifests
@@ -315,7 +268,7 b' revision 4'
315 revision 6
268 revision 6
316
269
317 $ hg tip -q
270 $ hg tip -q
318 6:a6a34bfa0076
271 6:faa2e4234c7a
319 $ hg verify
272 $ hg verify
320 checking changesets
273 checking changesets
321 checking manifests
274 checking manifests
@@ -335,7 +288,7 b' revision 6'
335 revision 4
288 revision 4
336
289
337 $ hg tip -q
290 $ hg tip -q
338 4:aa35859c02ea
291 4:916f1afdef90
339 $ hg verify
292 $ hg verify
340 checking changesets
293 checking changesets
341 checking manifests
294 checking manifests
@@ -368,7 +321,7 b' revision 4'
368 revision 9
321 revision 9
369
322
370 $ hg tip -q
323 $ hg tip -q
371 9:905597b0d5d4
324 9:03fc0b0e347c
372 $ hg verify
325 $ hg verify
373 checking changesets
326 checking changesets
374 checking manifests
327 checking manifests
@@ -16,7 +16,7 b" skip if we can't import elementtree"
16
16
17 try converting darcs1 repository
17 try converting darcs1 repository
18
18
19 $ hg clone -q "$TESTDIR/darcs1.hg" darcs
19 $ hg clone -q "$TESTDIR/bundles/darcs1.hg" darcs
20 $ hg convert -s darcs darcs/darcs1 2>&1 | grep darcs-1.0
20 $ hg convert -s darcs darcs/darcs1 2>&1 | grep darcs-1.0
21 darcs-1.0 repository format is unsupported, please upgrade
21 darcs-1.0 repository format is unsupported, please upgrade
22
22
@@ -6,6 +6,11 b' test command parsing and dispatch'
6
6
7 $ hg init a
7 $ hg init a
8 $ cd a
8 $ cd a
9
10 Redundant options used to crash (issue436):
11 $ hg -v log -v
12 $ hg -v log -v x
13
9 $ echo a > a
14 $ echo a > a
10 $ hg ci -Ama
15 $ hg ci -Ama
11 adding a
16 adding a
@@ -5,7 +5,7 b' Test character encoding'
5
5
6 we need a repo with some legacy latin-1 changesets
6 we need a repo with some legacy latin-1 changesets
7
7
8 $ hg unbundle $TESTDIR/legacy-encoding.hg
8 $ hg unbundle $TESTDIR/bundles/legacy-encoding.hg
9 adding changesets
9 adding changesets
10 adding manifests
10 adding manifests
11 adding file changes
11 adding file changes
@@ -1,81 +1,15 b''
1 creating 'remote
1
2
2 $ hg init remote
3 $ hg init remote
3 $ cd remote
4 $ cd remote
4
5 $ hg unbundle $TESTDIR/bundles/remote.hg
5 creating 'remote
6 adding changesets
6
7 adding manifests
7 $ cat >>afile <<EOF
8 adding file changes
8 > 0
9 added 9 changesets with 7 changes to 4 files (+1 heads)
9 > EOF
10 (run 'hg heads' to see heads, 'hg merge' to merge)
10 $ hg add afile
11 $ hg up tip
11 $ hg commit -m "0.0"
12 $ cat >>afile <<EOF
13 > 1
14 > EOF
15 $ hg commit -m "0.1"
16 $ cat >>afile <<EOF
17 > 2
18 > EOF
19 $ hg commit -m "0.2"
20 $ cat >>afile <<EOF
21 > 3
22 > EOF
23 $ hg commit -m "0.3"
24 $ hg update -C 0
25 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
12 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
26 $ cat >>afile <<EOF
27 > 1
28 > EOF
29 $ hg commit -m "1.1"
30 created new head
31 $ cat >>afile <<EOF
32 > 2
33 > EOF
34 $ hg commit -m "1.2"
35 $ cat >fred <<EOF
36 > a line
37 > EOF
38 $ cat >>afile <<EOF
39 > 3
40 > EOF
41 $ hg add fred
42 $ hg commit -m "1.3"
43 $ hg mv afile adifferentfile
44 $ hg commit -m "1.3m"
45 $ hg update -C 3
46 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
47 $ hg mv afile anotherfile
48 $ hg commit -m "0.3m"
49 $ hg debugindex .hg/store/data/afile.i
50 rev offset length base linkrev nodeid p1 p2
51 0 0 3 0 0 362fef284ce2 000000000000 000000000000
52 1 3 5 1 1 125144f7e028 362fef284ce2 000000000000
53 2 8 7 2 2 4c982badb186 125144f7e028 000000000000
54 3 15 9 3 3 19b1fc555737 4c982badb186 000000000000
55 $ hg debugindex .hg/store/data/adifferentfile.i
56 rev offset length base linkrev nodeid p1 p2
57 0 0 75 0 7 2565f3199a74 000000000000 000000000000
58 $ hg debugindex .hg/store/data/anotherfile.i
59 rev offset length base linkrev nodeid p1 p2
60 0 0 75 0 8 2565f3199a74 000000000000 000000000000
61 $ hg debugindex .hg/store/data/fred.i
62 rev offset length base linkrev nodeid p1 p2
63 0 0 8 0 6 12ab3bcc5ea4 000000000000 000000000000
64 $ hg debugindex .hg/store/00manifest.i
65 rev offset length base linkrev nodeid p1 p2
66 0 0 48 0 0 43eadb1d2d06 000000000000 000000000000
67 1 48 48 1 1 8b89697eba2c 43eadb1d2d06 000000000000
68 2 96 48 2 2 626a32663c2f 8b89697eba2c 000000000000
69 3 144 48 3 3 f54c32f13478 626a32663c2f 000000000000
70 4 192 58 3 6 de68e904d169 626a32663c2f 000000000000
71 5 250 68 3 7 09bb521d218d de68e904d169 000000000000
72 6 318 54 6 8 1fde233dfb0f f54c32f13478 000000000000
73 $ hg verify
74 checking changesets
75 checking manifests
76 crosschecking files in changesets and manifests
77 checking files
78 4 files, 9 changesets, 7 total revisions
79
13
80 Starting server
14 Starting server
81
15
@@ -11,6 +11,7 b''
11 > sys.exit(0)
11 > sys.exit(0)
12 > sys.exit(1)
12 > sys.exit(1)
13 > EOF
13 > EOF
14
14 $ hg init a
15 $ hg init a
15 $ cd a
16 $ cd a
16 $ echo "Rev 1" >rev
17 $ echo "Rev 1" >rev
@@ -20,11 +21,17 b''
20 marked working directory as branch abranch
21 marked working directory as branch abranch
21 $ echo "Rev 2" >rev
22 $ echo "Rev 2" >rev
22 $ hg commit -m "With branch."
23 $ hg commit -m "With branch."
23 $ if hg export 0 | python ../findbranch.py; then
24
25 $ hg export 0 > ../r0.patch
26 $ hg export 1 > ../r1.patch
27 $ cd ..
28
29 $ if python findbranch.py < r0.patch; then
24 > echo "Export of default branch revision has Branch header" 1>&2
30 > echo "Export of default branch revision has Branch header" 1>&2
25 > exit 1
31 > exit 1
26 > fi
32 > fi
27 $ if hg export 1 | python ../findbranch.py; then
33
34 $ if python findbranch.py < r1.patch; then
28 > : # Do nothing
35 > : # Do nothing
29 > else
36 > else
30 > echo "Export of branch revision is missing Branch header" 1>&2
37 > echo "Export of branch revision is missing Branch header" 1>&2
@@ -33,18 +40,17 b''
33
40
34 Make sure import still works with branch information in patches.
41 Make sure import still works with branch information in patches.
35
42
36 $ cd ..
37 $ hg init b
43 $ hg init b
38 $ cd b
44 $ cd b
39 $ hg -R ../a export 0 | hg import -
45 $ hg import ../r0.patch
40 applying patch from stdin
46 applying ../r0.patch
41 $ hg -R ../a export 1 | hg import -
47 $ hg import ../r1.patch
42 applying patch from stdin
48 applying ../r1.patch
43 $ cd ..
49 $ cd ..
44 $ rm -rf b
50
45 $ hg init b
51 $ hg init c
46 $ cd b
52 $ cd c
47 $ hg -R ../a export 0 | hg import --exact -
53 $ hg import --exact ../r0.patch
48 applying patch from stdin
54 applying ../r0.patch
49 $ hg -R ../a export 1 | hg import --exact -
55 $ hg import --exact ../r1.patch
50 applying patch from stdin
56 applying ../r1.patch
@@ -11,6 +11,12 b''
11 $ hg --cwd a ci -u someone -d '1 0' -m'second change'
11 $ hg --cwd a ci -u someone -d '1 0' -m'second change'
12
12
13
13
14 generate patches for the test
15
16 $ hg --cwd a export tip > exported-tip.patch
17 $ hg --cwd a diff -r0:1 > diffed-tip.patch
18
19
14 import exported patch
20 import exported patch
15
21
16 $ hg clone -r0 a b
22 $ hg clone -r0 a b
@@ -20,19 +26,18 b' import exported patch'
20 added 1 changesets with 2 changes to 2 files
26 added 1 changesets with 2 changes to 2 files
21 updating to branch default
27 updating to branch default
22 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
28 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
23 $ hg --cwd a export tip > tip.patch
29 $ hg --cwd b import ../exported-tip.patch
24 $ hg --cwd b import ../tip.patch
30 applying ../exported-tip.patch
25 applying ../tip.patch
26
31
27 message should be same
32 message and committer should be same
28
33
29 $ hg --cwd b tip | grep 'second change'
34 $ hg --cwd b tip
35 changeset: 1:1d4bd90af0e4
36 tag: tip
37 user: someone
38 date: Thu Jan 01 00:00:01 1970 +0000
30 summary: second change
39 summary: second change
31
40
32 committer should be same
33
34 $ hg --cwd b tip | grep someone
35 user: someone
36 $ rm -r b
41 $ rm -r b
37
42
38
43
@@ -50,9 +55,8 b' import exported patch with external patc'
50 added 1 changesets with 2 changes to 2 files
55 added 1 changesets with 2 changes to 2 files
51 updating to branch default
56 updating to branch default
52 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
57 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
53 $ hg --cwd a export tip > tip.patch
58 $ hg --config ui.patch='python ../dummypatch.py' --cwd b import ../exported-tip.patch
54 $ hg --config ui.patch='python ../dummypatch.py' --cwd b import ../tip.patch
59 applying ../exported-tip.patch
55 applying ../tip.patch
56 $ cat b/a
60 $ cat b/a
57 line2
61 line2
58 $ rm -r b
62 $ rm -r b
@@ -67,9 +71,8 b' import of plain diff should fail without'
67 added 1 changesets with 2 changes to 2 files
71 added 1 changesets with 2 changes to 2 files
68 updating to branch default
72 updating to branch default
69 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
73 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
70 $ hg --cwd a diff -r0:1 > tip.patch
74 $ hg --cwd b import ../diffed-tip.patch
71 $ hg --cwd b import ../tip.patch
75 applying ../diffed-tip.patch
72 applying ../tip.patch
73 abort: empty commit message
76 abort: empty commit message
74 [255]
77 [255]
75 $ rm -r b
78 $ rm -r b
@@ -84,9 +87,8 b' import of plain diff should be ok with m'
84 added 1 changesets with 2 changes to 2 files
87 added 1 changesets with 2 changes to 2 files
85 updating to branch default
88 updating to branch default
86 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
89 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
87 $ hg --cwd a diff -r0:1 > tip.patch
90 $ hg --cwd b import -mpatch ../diffed-tip.patch
88 $ hg --cwd b import -mpatch ../tip.patch
91 applying ../diffed-tip.patch
89 applying ../tip.patch
90 $ rm -r b
92 $ rm -r b
91
93
92
94
@@ -99,9 +101,8 b' import of plain diff with specific date '
99 added 1 changesets with 2 changes to 2 files
101 added 1 changesets with 2 changes to 2 files
100 updating to branch default
102 updating to branch default
101 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
103 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
102 $ hg --cwd a diff -r0:1 > tip.patch
104 $ hg --cwd b import -mpatch -d '1 0' -u 'user@nowhere.net' ../diffed-tip.patch
103 $ hg --cwd b import -mpatch -d '1 0' -u 'user@nowhere.net' ../tip.patch
105 applying ../diffed-tip.patch
104 applying ../tip.patch
105 $ hg -R b tip -pv
106 $ hg -R b tip -pv
106 changeset: 1:ca68f19f3a40
107 changeset: 1:ca68f19f3a40
107 tag: tip
108 tag: tip
@@ -131,9 +132,8 b' import of plain diff should be ok with -'
131 added 1 changesets with 2 changes to 2 files
132 added 1 changesets with 2 changes to 2 files
132 updating to branch default
133 updating to branch default
133 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
134 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
134 $ hg --cwd a diff -r0:1 > tip.patch
135 $ hg --cwd b import --no-commit ../diffed-tip.patch
135 $ hg --cwd b import --no-commit ../tip.patch
136 applying ../diffed-tip.patch
136 applying ../tip.patch
137 $ hg --cwd b diff --nodates
137 $ hg --cwd b diff --nodates
138 diff -r 80971e65b431 a
138 diff -r 80971e65b431 a
139 --- a/a
139 --- a/a
@@ -153,8 +153,7 b' import of malformed plain diff should fa'
153 added 1 changesets with 2 changes to 2 files
153 added 1 changesets with 2 changes to 2 files
154 updating to branch default
154 updating to branch default
155 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
155 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
156 $ hg --cwd a diff -r0:1 > tip.patch
156 $ sed 's/1,1/foo/' < diffed-tip.patch > broken.patch
157 $ sed 's/1,1/foo/' < tip.patch > broken.patch
158 $ hg --cwd b import -mpatch ../broken.patch
157 $ hg --cwd b import -mpatch ../broken.patch
159 applying ../broken.patch
158 applying ../broken.patch
160 abort: bad hunk #1
159 abort: bad hunk #1
@@ -174,10 +173,9 b' used to hide a bug.'
174 added 1 changesets with 2 changes to 2 files
173 added 1 changesets with 2 changes to 2 files
175 updating to branch default
174 updating to branch default
176 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
175 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
177 $ hg --cwd a export tip > dir/tip.patch
178 $ cd dir
176 $ cd dir
179 $ hg -R b import tip.patch
177 $ hg -R b import ../exported-tip.patch
180 applying tip.patch
178 applying ../exported-tip.patch
181 $ cd ..
179 $ cd ..
182 $ rm -r dir
180 $ rm -r dir
183
181
@@ -191,7 +189,7 b' import from stdin'
191 added 1 changesets with 2 changes to 2 files
189 added 1 changesets with 2 changes to 2 files
192 updating to branch default
190 updating to branch default
193 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
191 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
194 $ hg --cwd a export tip | hg --cwd b import -
192 $ hg --cwd b import - < exported-tip.patch
195 applying patch from stdin
193 applying patch from stdin
196 $ rm -r b
194 $ rm -r b
197
195
@@ -218,7 +216,7 b' override commit message'
218 added 1 changesets with 2 changes to 2 files
216 added 1 changesets with 2 changes to 2 files
219 updating to branch default
217 updating to branch default
220 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
218 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
221 $ hg --cwd a export tip | hg --cwd b import -m 'override' -
219 $ hg --cwd b import -m 'override' - < exported-tip.patch
222 applying patch from stdin
220 applying patch from stdin
223 $ hg --cwd b tip | grep override
221 $ hg --cwd b tip | grep override
224 summary: override
222 summary: override
@@ -227,7 +225,8 b' override commit message'
227 $ cat > mkmsg.py <<EOF
225 $ cat > mkmsg.py <<EOF
228 > import email.Message, sys
226 > import email.Message, sys
229 > msg = email.Message.Message()
227 > msg = email.Message.Message()
230 > msg.set_payload('email commit message\n' + open('tip.patch', 'rb').read())
228 > patch = open(sys.argv[1], 'rb').read()
229 > msg.set_payload('email commit message\n' + patch)
231 > msg['Subject'] = 'email patch'
230 > msg['Subject'] = 'email patch'
232 > msg['From'] = 'email patcher'
231 > msg['From'] = 'email patcher'
233 > sys.stdout.write(msg.as_string())
232 > sys.stdout.write(msg.as_string())
@@ -243,8 +242,7 b' plain diff in email, subject, message bo'
243 added 1 changesets with 2 changes to 2 files
242 added 1 changesets with 2 changes to 2 files
244 updating to branch default
243 updating to branch default
245 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
244 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
246 $ hg --cwd a diff -r0:1 > tip.patch
245 $ python mkmsg.py diffed-tip.patch > msg.patch
247 $ python mkmsg.py > msg.patch
248 $ hg --cwd b import ../msg.patch
246 $ hg --cwd b import ../msg.patch
249 applying ../msg.patch
247 applying ../msg.patch
250 $ hg --cwd b tip | grep email
248 $ hg --cwd b tip | grep email
@@ -306,8 +304,7 b' hg export in email, should use patch hea'
306 added 1 changesets with 2 changes to 2 files
304 added 1 changesets with 2 changes to 2 files
307 updating to branch default
305 updating to branch default
308 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
306 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
309 $ hg --cwd a export tip > tip.patch
307 $ python mkmsg.py exported-tip.patch | hg --cwd b import -
310 $ python mkmsg.py | hg --cwd b import -
311 applying patch from stdin
308 applying patch from stdin
312 $ hg --cwd b tip | grep second
309 $ hg --cwd b tip | grep second
313 summary: second change
310 summary: second change
@@ -320,7 +317,8 b" The '---' tests the gitsendmail handling"
320 $ cat > mkmsg2.py <<EOF
317 $ cat > mkmsg2.py <<EOF
321 > import email.Message, sys
318 > import email.Message, sys
322 > msg = email.Message.Message()
319 > msg = email.Message.Message()
323 > msg.set_payload('email patch\n\nnext line\n---\n' + open('tip.patch').read())
320 > patch = open(sys.argv[1], 'rb').read()
321 > msg.set_payload('email patch\n\nnext line\n---\n' + patch)
324 > msg['Subject'] = '[PATCH] email patch'
322 > msg['Subject'] = '[PATCH] email patch'
325 > msg['From'] = 'email patcher'
323 > msg['From'] = 'email patcher'
326 > sys.stdout.write(msg.as_string())
324 > sys.stdout.write(msg.as_string())
@@ -336,8 +334,7 b' plain diff in email, [PATCH] subject, me'
336 added 1 changesets with 2 changes to 2 files
334 added 1 changesets with 2 changes to 2 files
337 updating to branch default
335 updating to branch default
338 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
336 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
339 $ hg --cwd a diff -r0:1 > tip.patch
337 $ python mkmsg2.py diffed-tip.patch | hg --cwd b import -
340 $ python mkmsg2.py | hg --cwd b import -
341 applying patch from stdin
338 applying patch from stdin
342 $ hg --cwd b tip --template '{desc}\n'
339 $ hg --cwd b tip --template '{desc}\n'
343 email patch
340 email patch
@@ -386,22 +383,23 b' hg import in a subdirectory'
386 updating to branch default
383 updating to branch default
387 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
384 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
388 $ hg --cwd a export tip > tmp
385 $ hg --cwd a export tip > tmp
389 $ sed -e 's/d1\/d2\///' < tmp > tip.patch
386 $ sed -e 's/d1\/d2\///' < tmp > subdir-tip.patch
390 $ dir=`pwd`
387 $ dir=`pwd`
391 $ cd b/d1/d2 2>&1 > /dev/null
388 $ cd b/d1/d2 2>&1 > /dev/null
392 $ hg import ../../../tip.patch
389 $ hg import ../../../subdir-tip.patch
393 applying ../../../tip.patch
390 applying ../../../subdir-tip.patch
394 $ cd "$dir"
391 $ cd "$dir"
395
392
396 message should be 'subdir change'
393 message should be 'subdir change'
397
398 $ hg --cwd b tip | grep 'subdir change'
399 summary: subdir change
400
401 committer should be 'someoneelse'
394 committer should be 'someoneelse'
402
395
403 $ hg --cwd b tip | grep someoneelse
396 $ hg --cwd b tip
397 changeset: 1:3577f5aea227
398 tag: tip
404 user: someoneelse
399 user: someoneelse
400 date: Thu Jan 01 00:00:01 1970 +0000
401 summary: subdir change
402
405
403
406 should be empty
404 should be empty
407
405
@@ -422,7 +420,7 b' Test fuzziness (ambiguous patch location'
422 $ echo line0 >> a
420 $ echo line0 >> a
423 $ echo line3 >> a
421 $ echo line3 >> a
424 $ hg ci -m change a
422 $ hg ci -m change a
425 $ hg export tip > tip.patch
423 $ hg export tip > fuzzy-tip.patch
426 $ hg up -C 0
424 $ hg up -C 0
427 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
425 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
428 $ echo line1 > a
426 $ echo line1 > a
@@ -431,8 +429,8 b' Test fuzziness (ambiguous patch location'
431 $ echo line0 >> a
429 $ echo line0 >> a
432 $ hg ci -m brancha
430 $ hg ci -m brancha
433 created new head
431 created new head
434 $ hg import --no-commit -v tip.patch
432 $ hg import --no-commit -v fuzzy-tip.patch
435 applying tip.patch
433 applying fuzzy-tip.patch
436 patching file a
434 patching file a
437 Hunk #1 succeeded at 1 with fuzz 2 (offset -2 lines).
435 Hunk #1 succeeded at 1 with fuzz 2 (offset -2 lines).
438 $ hg revert -a
436 $ hg revert -a
@@ -447,8 +445,8 b' import with --no-commit should have writ'
447
445
448 test fuzziness with eol=auto
446 test fuzziness with eol=auto
449
447
450 $ hg --config patch.eol=auto import --no-commit -v tip.patch
448 $ hg --config patch.eol=auto import --no-commit -v fuzzy-tip.patch
451 applying tip.patch
449 applying fuzzy-tip.patch
452 patching file a
450 patching file a
453 Hunk #1 succeeded at 1 with fuzz 2 (offset -2 lines).
451 Hunk #1 succeeded at 1 with fuzz 2 (offset -2 lines).
454 $ cd ..
452 $ cd ..
1 NO CONTENT: modified file chmod 100755 => 100644
NO CONTENT: modified file chmod 100755 => 100644
@@ -1,4 +1,5 b''
1 http://mercurial.selenic.com/bts/issue660
1 http://mercurial.selenic.com/bts/issue660 and:
2 http://mercurial.selenic.com/bts/issue322
2
3
3 $ hg init
4 $ hg init
4 $ echo a > a
5 $ echo a > a
@@ -78,7 +78,7 b' A bundle to test this was made with:'
78 hg ci -m addsym -u mercurial
78 hg ci -m addsym -u mercurial
79 hg bundle --base null ../test-keyword.hg
79 hg bundle --base null ../test-keyword.hg
80
80
81 $ hg pull -u "$TESTDIR"/test-keyword.hg
81 $ hg pull -u "$TESTDIR"/bundles/test-keyword.hg
82 pulling from *test-keyword.hg (glob)
82 pulling from *test-keyword.hg (glob)
83 requesting all changes
83 requesting all changes
84 adding changesets
84 adding changesets
@@ -10,7 +10,7 b' Source bundle was generated with the fol'
10 # hg ci -Amb -d'1 0'
10 # hg ci -Amb -d'1 0'
11
11
12 $ hg init
12 $ hg init
13 $ hg -q pull "$TESTDIR/test-manifest.hg"
13 $ hg -q pull "$TESTDIR/bundles/test-manifest.hg"
14
14
15 The next call is expected to return nothing:
15 The next call is expected to return nothing:
16
16
@@ -30,7 +30,7 b' a file, once as a link. Bundle was gener'
30
30
31 $ hg init t
31 $ hg init t
32 $ cd t
32 $ cd t
33 $ hg -q pull "$TESTDIR/test-merge-symlinks.hg"
33 $ hg -q pull "$TESTDIR/bundles/test-merge-symlinks.hg"
34 $ hg up -C 3
34 $ hg up -C 3
35 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
35 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
36
36
@@ -16,7 +16,7 b' Extract a symlink on a platform not supp'
16
16
17 $ hg init t
17 $ hg init t
18 $ cd t
18 $ cd t
19 $ hg pull -q "$TESTDIR/test-no-symlinks.hg"
19 $ hg pull -q "$TESTDIR/bundles/test-no-symlinks.hg"
20 $ hg update
20 $ hg update
21 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
21 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
22 $ cat a.lnk && echo
22 $ cat a.lnk && echo
1 NO CONTENT: modified file chmod 100755 => 100644
NO CONTENT: modified file chmod 100755 => 100644
@@ -1,95 +1,13 b''
1 $ hg init test
1 $ hg init test
2 $ cd test
2 $ cd test
3
3 $ hg unbundle $TESTDIR/bundles/remote.hg
4 $ cat >>afile <<EOF
4 adding changesets
5 > 0
5 adding manifests
6 > EOF
6 adding file changes
7 $ hg add afile
7 added 9 changesets with 7 changes to 4 files (+1 heads)
8 $ hg commit -m "0.0"
8 (run 'hg heads' to see heads, 'hg merge' to merge)
9
9 $ hg up tip
10 $ cat >>afile <<EOF
11 > 1
12 > EOF
13 $ hg commit -m "0.1"
14
15 $ cat >>afile <<EOF
16 > 2
17 > EOF
18 $ hg commit -m "0.2"
19
20 $ cat >>afile <<EOF
21 > 3
22 > EOF
23 $ hg commit -m "0.3"
24
25 $ hg update -C 0
26 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
10 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
27
28 $ cat >>afile <<EOF
29 > 1
30 > EOF
31 $ hg commit -m "1.1"
32 created new head
33
34 $ cat >>afile <<EOF
35 > 2
36 > EOF
37 $ hg commit -m "1.2"
38
39 $ cat >fred <<EOF
40 > a line
41 > EOF
42 $ cat >>afile <<EOF
43 > 3
44 > EOF
45 $ hg add fred
46 $ hg commit -m "1.3"
47
48 $ hg mv afile adifferentfile
49 $ hg commit -m "1.3m"
50
51 $ hg update -C 3
52 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
53
54 $ hg mv afile anotherfile
55 $ hg commit -m "0.3m"
56
57 $ hg debugindex .hg/store/data/afile.i
58 rev offset length base linkrev nodeid p1 p2
59 0 0 3 0 0 362fef284ce2 000000000000 000000000000
60 1 3 5 1 1 125144f7e028 362fef284ce2 000000000000
61 2 8 7 2 2 4c982badb186 125144f7e028 000000000000
62 3 15 9 3 3 19b1fc555737 4c982badb186 000000000000
63
64 $ hg debugindex .hg/store/data/adifferentfile.i
65 rev offset length base linkrev nodeid p1 p2
66 0 0 75 0 7 2565f3199a74 000000000000 000000000000
67
68 $ hg debugindex .hg/store/data/anotherfile.i
69 rev offset length base linkrev nodeid p1 p2
70 0 0 75 0 8 2565f3199a74 000000000000 000000000000
71
72 $ hg debugindex .hg/store/data/fred.i
73 rev offset length base linkrev nodeid p1 p2
74 0 0 8 0 6 12ab3bcc5ea4 000000000000 000000000000
75
76 $ hg debugindex .hg/store/00manifest.i
77 rev offset length base linkrev nodeid p1 p2
78 0 0 48 0 0 43eadb1d2d06 000000000000 000000000000
79 1 48 48 1 1 8b89697eba2c 43eadb1d2d06 000000000000
80 2 96 48 2 2 626a32663c2f 8b89697eba2c 000000000000
81 3 144 48 3 3 f54c32f13478 626a32663c2f 000000000000
82 4 192 58 3 6 de68e904d169 626a32663c2f 000000000000
83 5 250 68 3 7 09bb521d218d de68e904d169 000000000000
84 6 318 54 6 8 1fde233dfb0f f54c32f13478 000000000000
85
86 $ hg verify
87 checking changesets
88 checking manifests
89 crosschecking files in changesets and manifests
90 checking files
91 4 files, 9 changesets, 7 total revisions
92
93 $ cd ..
11 $ cd ..
94
12
95 $ for i in 0 1 2 3 4 5 6 7 8; do
13 $ for i in 0 1 2 3 4 5 6 7 8; do
@@ -11,45 +11,14 b' Create repo a:'
11
11
12 $ hg init a
12 $ hg init a
13 $ cd a
13 $ cd a
14
14 $ hg unbundle $TESTDIR/bundles/rebase.hg
15 $ echo A > A
15 adding changesets
16 $ hg ci -Am A
16 adding manifests
17 adding A
17 adding file changes
18 $ echo B > B
18 added 8 changesets with 7 changes to 7 files (+2 heads)
19 $ hg ci -Am B
19 (run 'hg heads' to see heads, 'hg merge' to merge)
20 adding B
20 $ hg up tip
21 $ echo C > C
21 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
22 $ hg ci -Am C
23 adding C
24 $ echo D > D
25 $ hg ci -Am D
26 adding D
27
28 $ hg up -q -C 0
29
30 $ echo E > E
31 $ hg ci -Am E
32 adding E
33 created new head
34
35 $ hg up -q -C 0
36
37 $ echo F > F
38 $ hg ci -Am F
39 adding F
40 created new head
41
42 $ hg merge -r 4
43 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
44 (branch merge, don't forget to commit)
45 $ hg ci -m G
46
47 $ hg up -q -C 5
48
49 $ echo H > H
50 $ hg ci -Am H
51 adding H
52 created new head
53
22
54 $ hg tglog
23 $ hg tglog
55 @ 7: 'H'
24 @ 7: 'H'
@@ -10,41 +10,32 b''
10
10
11 $ hg init a
11 $ hg init a
12 $ cd a
12 $ cd a
13
13 $ hg unbundle $TESTDIR/bundles/rebase.hg
14 $ echo A > A
14 adding changesets
15 $ hg ci -Am A
15 adding manifests
16 adding A
16 adding file changes
17
17 added 8 changesets with 7 changes to 7 files (+2 heads)
18 $ echo B > B
18 (run 'hg heads' to see heads, 'hg merge' to merge)
19 $ hg ci -Am B
19 $ hg up tip
20 adding B
20 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
21
22 $ echo C > C
23 $ hg ci -Am C
24 adding C
25
26 $ echo D > D
27 $ hg ci -Am D
28 adding D
29
30 $ hg up -q -C 0
31
32 $ echo E > E
33 $ hg ci -Am E
34 adding E
35 created new head
36
21
37 $ cd ..
22 $ cd ..
38
23
39
24
40 Rebasing D onto E detaching from C:
25 Rebasing D onto H detaching from C:
41
26
42 $ hg clone -q -u . a a1
27 $ hg clone -q -u . a a1
43 $ cd a1
28 $ cd a1
44
29
45 $ hg tglog
30 $ hg tglog
46 @ 4: 'E'
31 @ 7: 'H'
47 |
32 |
33 | o 6: 'G'
34 |/|
35 o | 5: 'F'
36 | |
37 | o 4: 'E'
38 |/
48 | o 3: 'D'
39 | o 3: 'D'
49 | |
40 | |
50 | o 2: 'C'
41 | o 2: 'C'
@@ -53,14 +44,20 b' Rebasing D onto E detaching from C:'
53 |/
44 |/
54 o 0: 'A'
45 o 0: 'A'
55
46
56 $ hg rebase --detach -s 3 -d 4
47 $ hg rebase --detach -s 3 -d 7
57 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
48 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
58
49
59 $ hg tglog
50 $ hg tglog
60 @ 4: 'D'
51 @ 7: 'D'
52 |
53 o 6: 'H'
61 |
54 |
62 o 3: 'E'
55 | o 5: 'G'
63 |
56 |/|
57 o | 4: 'F'
58 | |
59 | o 3: 'E'
60 |/
64 | o 2: 'C'
61 | o 2: 'C'
65 | |
62 | |
66 | o 1: 'B'
63 | o 1: 'B'
@@ -70,19 +67,26 b' Rebasing D onto E detaching from C:'
70 $ hg manifest
67 $ hg manifest
71 A
68 A
72 D
69 D
73 E
70 F
71 H
74
72
75 $ cd ..
73 $ cd ..
76
74
77
75
78 Rebasing C onto E detaching from B:
76 Rebasing C onto H detaching from B:
79
77
80 $ hg clone -q -u . a a2
78 $ hg clone -q -u . a a2
81 $ cd a2
79 $ cd a2
82
80
83 $ hg tglog
81 $ hg tglog
84 @ 4: 'E'
82 @ 7: 'H'
85 |
83 |
84 | o 6: 'G'
85 |/|
86 o | 5: 'F'
87 | |
88 | o 4: 'E'
89 |/
86 | o 3: 'D'
90 | o 3: 'D'
87 | |
91 | |
88 | o 2: 'C'
92 | o 2: 'C'
@@ -91,16 +95,22 b' Rebasing C onto E detaching from B:'
91 |/
95 |/
92 o 0: 'A'
96 o 0: 'A'
93
97
94 $ hg rebase --detach -s 2 -d 4
98 $ hg rebase --detach -s 2 -d 7
95 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob)
99 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob)
96
100
97 $ hg tglog
101 $ hg tglog
98 @ 4: 'D'
102 @ 7: 'D'
103 |
104 o 6: 'C'
105 |
106 o 5: 'H'
99 |
107 |
100 o 3: 'C'
108 | o 4: 'G'
101 |
109 |/|
102 o 2: 'E'
110 o | 3: 'F'
103 |
111 | |
112 | o 2: 'E'
113 |/
104 | o 1: 'B'
114 | o 1: 'B'
105 |/
115 |/
106 o 0: 'A'
116 o 0: 'A'
@@ -109,19 +119,26 b' Rebasing C onto E detaching from B:'
109 A
119 A
110 C
120 C
111 D
121 D
112 E
122 F
123 H
113
124
114 $ cd ..
125 $ cd ..
115
126
116
127
117 Rebasing B onto E using detach (same as not using it):
128 Rebasing B onto H using detach (same as not using it):
118
129
119 $ hg clone -q -u . a a3
130 $ hg clone -q -u . a a3
120 $ cd a3
131 $ cd a3
121
132
122 $ hg tglog
133 $ hg tglog
123 @ 4: 'E'
134 @ 7: 'H'
124 |
135 |
136 | o 6: 'G'
137 |/|
138 o | 5: 'F'
139 | |
140 | o 4: 'E'
141 |/
125 | o 3: 'D'
142 | o 3: 'D'
126 | |
143 | |
127 | o 2: 'C'
144 | o 2: 'C'
@@ -130,18 +147,24 b' Rebasing B onto E using detach (same as '
130 |/
147 |/
131 o 0: 'A'
148 o 0: 'A'
132
149
133 $ hg rebase --detach -s 1 -d 4
150 $ hg rebase --detach -s 1 -d 7
134 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob)
151 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob)
135
152
136 $ hg tglog
153 $ hg tglog
137 @ 4: 'D'
154 @ 7: 'D'
138 |
155 |
139 o 3: 'C'
156 o 6: 'C'
157 |
158 o 5: 'B'
140 |
159 |
141 o 2: 'B'
160 o 4: 'H'
142 |
161 |
143 o 1: 'E'
162 | o 3: 'G'
144 |
163 |/|
164 o | 2: 'F'
165 | |
166 | o 1: 'E'
167 |/
145 o 0: 'A'
168 o 0: 'A'
146
169
147 $ hg manifest
170 $ hg manifest
@@ -149,19 +172,26 b' Rebasing B onto E using detach (same as '
149 B
172 B
150 C
173 C
151 D
174 D
152 E
175 F
176 H
153
177
154 $ cd ..
178 $ cd ..
155
179
156
180
157 Rebasing C onto E detaching from B and collapsing:
181 Rebasing C onto H detaching from B and collapsing:
158
182
159 $ hg clone -q -u . a a4
183 $ hg clone -q -u . a a4
160 $ cd a4
184 $ cd a4
161
185
162 $ hg tglog
186 $ hg tglog
163 @ 4: 'E'
187 @ 7: 'H'
164 |
188 |
189 | o 6: 'G'
190 |/|
191 o | 5: 'F'
192 | |
193 | o 4: 'E'
194 |/
165 | o 3: 'D'
195 | o 3: 'D'
166 | |
196 | |
167 | o 2: 'C'
197 | o 2: 'C'
@@ -170,15 +200,21 b' Rebasing C onto E detaching from B and c'
170 |/
200 |/
171 o 0: 'A'
201 o 0: 'A'
172
202
173 $ hg rebase --detach --collapse -s 2 -d 4
203 $ hg rebase --detach --collapse -s 2 -d 7
174 saved backup bundle to $TESTTMP/a4/.hg/strip-backup/*-backup.hg (glob)
204 saved backup bundle to $TESTTMP/a4/.hg/strip-backup/*-backup.hg (glob)
175
205
176 $ hg tglog
206 $ hg tglog
177 @ 3: 'Collapsed revision
207 @ 6: 'Collapsed revision
178 | * C
208 | * C
179 | * D'
209 | * D'
180 o 2: 'E'
210 o 5: 'H'
181 |
211 |
212 | o 4: 'G'
213 |/|
214 o | 3: 'F'
215 | |
216 | o 2: 'E'
217 |/
182 | o 1: 'B'
218 | o 1: 'B'
183 |/
219 |/
184 o 0: 'A'
220 o 0: 'A'
@@ -187,7 +223,8 b' Rebasing C onto E detaching from B and c'
187 A
223 A
188 C
224 C
189 D
225 D
190 E
226 F
227 H
191
228
192 $ cd ..
229 $ cd ..
193
230
@@ -204,10 +241,16 b' Rebasing across null as ancestor'
204 created new head
241 created new head
205
242
206 $ hg tglog
243 $ hg tglog
207 @ 5: 'extra branch'
244 @ 8: 'extra branch'
208
245
209 o 4: 'E'
246 o 7: 'H'
210 |
247 |
248 | o 6: 'G'
249 |/|
250 o | 5: 'F'
251 | |
252 | o 4: 'E'
253 |/
211 | o 3: 'D'
254 | o 3: 'D'
212 | |
255 | |
213 | o 2: 'C'
256 | o 2: 'C'
@@ -220,15 +263,21 b' Rebasing across null as ancestor'
220 saved backup bundle to $TESTTMP/a5/.hg/strip-backup/*-backup.hg (glob)
263 saved backup bundle to $TESTTMP/a5/.hg/strip-backup/*-backup.hg (glob)
221
264
222 $ hg tglog
265 $ hg tglog
223 @ 5: 'D'
266 @ 8: 'D'
224 |
267 |
225 o 4: 'C'
268 o 7: 'C'
269 |
270 o 6: 'B'
226 |
271 |
227 o 3: 'B'
272 o 5: 'extra branch'
273
274 o 4: 'H'
228 |
275 |
229 o 2: 'extra branch'
276 | o 3: 'G'
230
277 |/|
231 o 1: 'E'
278 o | 2: 'F'
232 |
279 | |
280 | o 1: 'E'
281 |/
233 o 0: 'A'
282 o 0: 'A'
234
283
@@ -7,45 +7,16 b''
7 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
7 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
8 > EOF
8 > EOF
9
9
10
11 $ hg init a
10 $ hg init a
12 $ cd a
11 $ cd a
13
12 $ hg unbundle $TESTDIR/bundles/rebase.hg
14 $ echo A > A
13 adding changesets
15 $ hg ci -Am A
14 adding manifests
16 adding A
15 adding file changes
17
16 added 8 changesets with 7 changes to 7 files (+2 heads)
18 $ echo B > B
17 (run 'hg heads' to see heads, 'hg merge' to merge)
19 $ hg ci -Am B
18 $ hg up tip
20 adding B
19 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
21
22 $ hg up -q -C 0
23
24 $ echo C > C
25 $ hg ci -Am C
26 adding C
27 created new head
28
29 $ hg up -q -C 0
30
31 $ echo D > D
32 $ hg ci -Am D
33 adding D
34 created new head
35
36 $ hg merge -r 2
37 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
38 (branch merge, don't forget to commit)
39
40 $ hg ci -m E
41
42 $ hg up -q -C 3
43
44 $ echo F > F
45 $ hg ci -Am F
46 adding F
47 created new head
48
49 $ cd ..
20 $ cd ..
50
21
51
22
@@ -65,107 +36,72 b' Rebasing descendant onto ancestor across'
65 $ hg ci -m 'extra named branch'
36 $ hg ci -m 'extra named branch'
66
37
67 $ hg tglog
38 $ hg tglog
68 @ 6: 'extra named branch' dev
39 @ 8: 'extra named branch' dev
69 |
40 |
70 o 5: 'F'
41 o 7: 'H'
71 |
42 |
72 | o 4: 'E'
43 | o 6: 'G'
73 |/|
44 |/|
74 o | 3: 'D'
45 o | 5: 'F'
46 | |
47 | o 4: 'E'
48 |/
49 | o 3: 'D'
75 | |
50 | |
76 | o 2: 'C'
51 | o 2: 'C'
77 |/
52 | |
78 | o 1: 'B'
53 | o 1: 'B'
79 |/
54 |/
80 o 0: 'A'
55 o 0: 'A'
81
56
82 $ hg rebase -s 6 -d 5
57
58
59 $ hg rebase -s 1 -d 8 --keepbranches
83 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
60 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
84
61
85 $ hg tglog
62 $ hg tglog
86 @ 6: 'extra named branch'
63 @ 8: 'D'
64 |
65 o 7: 'C'
66 |
67 o 6: 'B'
87 |
68 |
88 o 5: 'F'
69 o 5: 'extra named branch' dev
89 |
70 |
90 | o 4: 'E'
71 o 4: 'H'
72 |
73 | o 3: 'G'
91 |/|
74 |/|
92 o | 3: 'D'
75 o | 2: 'F'
93 | |
76 | |
94 | o 2: 'C'
77 | o 1: 'E'
95 |/
78 |/
96 | o 1: 'B'
79 o 0: 'A'
80
81 $ hg rebase -s 4 -d 5
82 abort: source is ancestor of destination
83 [255]
84
85 $ hg rebase -s 5 -d 4
86 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
87
88 $ hg tglog
89 @ 8: 'D'
90 |
91 o 7: 'C'
92 |
93 o 6: 'B'
94 |
95 o 5: 'extra named branch'
96 |
97 o 4: 'H'
98 |
99 | o 3: 'G'
100 |/|
101 o | 2: 'F'
102 | |
103 | o 1: 'E'
97 |/
104 |/
98 o 0: 'A'
105 o 0: 'A'
99
106
100 $ cd ..
107 $ cd ..
101
102 Rebasing descendant onto ancestor across the same named branches
103
104 $ hg clone -q -u . a a2
105
106 $ cd a2
107
108 $ echo x > x
109
110 $ hg add x
111
112 $ hg ci -m 'G'
113
114 $ hg tglog
115 @ 6: 'G'
116 |
117 o 5: 'F'
118 |
119 | o 4: 'E'
120 |/|
121 o | 3: 'D'
122 | |
123 | o 2: 'C'
124 |/
125 | o 1: 'B'
126 |/
127 o 0: 'A'
128
129 $ hg rebase -s 6 -d 5
130 abort: source is descendant of destination
131 [255]
132
133 $ cd ..
134
135 Rebasing ancestor onto descendant across different named branches
136
137 $ hg clone -q -u . a a3
138
139 $ cd a3
140
141 $ hg branch dev
142 marked working directory as branch dev
143
144 $ echo x > x
145
146 $ hg add x
147
148 $ hg ci -m 'extra named branch'
149
150 $ hg tglog
151 @ 6: 'extra named branch' dev
152 |
153 o 5: 'F'
154 |
155 | o 4: 'E'
156 |/|
157 o | 3: 'D'
158 | |
159 | o 2: 'C'
160 |/
161 | o 1: 'B'
162 |/
163 o 0: 'A'
164
165 $ hg rebase -s 5 -d 6
166 abort: source is ancestor of destination
167 [255]
168
169 $ cd ..
170
171
@@ -10,60 +10,37 b''
10
10
11 $ hg init a
11 $ hg init a
12 $ cd a
12 $ cd a
13
13 $ hg unbundle $TESTDIR/bundles/rebase.hg
14 $ echo c1 > c1
14 adding changesets
15 $ hg ci -Am c1
15 adding manifests
16 adding c1
16 adding file changes
17
17 added 8 changesets with 7 changes to 7 files (+2 heads)
18 $ echo c2 > c2
18 (run 'hg heads' to see heads, 'hg merge' to merge)
19 $ hg ci -Am c2
19 $ hg up tip
20 adding c2
20 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
21
22 $ echo c3 > c3
23 $ hg ci -Am c3
24 adding c3
25
26 $ hg up -q -C 1
27
21
28 $ echo l1 > l1
22 $ echo I > I
29 $ hg ci -Am l1
23 $ hg ci -AmI
30 adding l1
24 adding I
31 created new head
32
33 $ echo l2 > l2
34 $ hg ci -Am l2
35 adding l2
36
37 $ echo l3 > l3
38 $ hg ci -Am l3
39 adding l3
40
41 $ hg up -q -C 2
42
43 $ echo r1 > r1
44 $ hg ci -Am r1
45 adding r1
46
47 $ echo r2 > r2
48 $ hg ci -Am r2
49 adding r2
50
25
51 $ hg tglog
26 $ hg tglog
52 @ 7: 'r2'
27 @ 8: 'I'
53 |
28 |
54 o 6: 'r1'
29 o 7: 'H'
55 |
30 |
56 | o 5: 'l3'
31 | o 6: 'G'
57 | |
32 |/|
58 | o 4: 'l2'
33 o | 5: 'F'
59 | |
34 | |
60 | o 3: 'l1'
35 | o 4: 'E'
61 | |
62 o | 2: 'c3'
63 |/
36 |/
64 o 1: 'c2'
37 | o 3: 'D'
65 |
38 | |
66 o 0: 'c1'
39 | o 2: 'C'
40 | |
41 | o 1: 'B'
42 |/
43 o 0: 'A'
67
44
68 $ cd ..
45 $ cd ..
69
46
@@ -73,6 +50,10 b' These fail:'
73 $ hg clone -q -u . a a1
50 $ hg clone -q -u . a a1
74 $ cd a1
51 $ cd a1
75
52
53 $ hg rebase -s 8 -d 7
54 abort: source is descendant of destination
55 [255]
56
76 $ hg rebase --continue --abort
57 $ hg rebase --continue --abort
77 abort: cannot use both abort and continue
58 abort: cannot use both abort and continue
78 [255]
59 [255]
@@ -93,7 +74,7 b' These fail:'
93 nothing to rebase
74 nothing to rebase
94 [1]
75 [1]
95
76
96 $ hg up -q 6
77 $ hg up -q 7
97
78
98 $ hg rebase
79 $ hg rebase
99 nothing to rebase
80 nothing to rebase
@@ -102,29 +83,31 b' These fail:'
102
83
103 These work:
84 These work:
104
85
105 Rebase with no arguments (from 3 onto 7):
86 Rebase with no arguments (from 3 onto 8):
106
87
107 $ hg up -q -C 5
88 $ hg up -q -C 3
108
89
109 $ hg rebase
90 $ hg rebase
110 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
91 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
111
92
112 $ hg tglog
93 $ hg tglog
113 @ 7: 'l3'
94 @ 8: 'D'
114 |
95 |
115 o 6: 'l2'
96 o 7: 'C'
116 |
97 |
117 o 5: 'l1'
98 o 6: 'B'
118 |
99 |
119 o 4: 'r2'
100 o 5: 'I'
120 |
101 |
121 o 3: 'r1'
102 o 4: 'H'
122 |
123 o 2: 'c3'
124 |
103 |
125 o 1: 'c2'
104 | o 3: 'G'
126 |
105 |/|
127 o 0: 'c1'
106 o | 2: 'F'
107 | |
108 | o 1: 'E'
109 |/
110 o 0: 'A'
128
111
129 Try to rollback after a rebase (fail):
112 Try to rollback after a rebase (fail):
130
113
@@ -135,198 +118,212 b' Try to rollback after a rebase (fail):'
135 $ cd ..
118 $ cd ..
136
119
137
120
138 Rebase with base == '.' => same as no arguments (from 3 onto 7):
121 Rebase with base == '.' => same as no arguments (from 3 onto 8):
139
122
140 $ hg clone -q -u 5 a a2
123 $ hg clone -q -u 3 a a2
141 $ cd a2
124 $ cd a2
142
125
143 $ hg rebase --base .
126 $ hg rebase --base .
144 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob)
127 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob)
145
128
146 $ hg tglog
129 $ hg tglog
147 @ 7: 'l3'
130 @ 8: 'D'
148 |
131 |
149 o 6: 'l2'
132 o 7: 'C'
150 |
133 |
151 o 5: 'l1'
134 o 6: 'B'
152 |
135 |
153 o 4: 'r2'
136 o 5: 'I'
154 |
137 |
155 o 3: 'r1'
138 o 4: 'H'
156 |
157 o 2: 'c3'
158 |
139 |
159 o 1: 'c2'
140 | o 3: 'G'
160 |
141 |/|
161 o 0: 'c1'
142 o | 2: 'F'
143 | |
144 | o 1: 'E'
145 |/
146 o 0: 'A'
162
147
163 $ cd ..
148 $ cd ..
164
149
165
150
166 Rebase with dest == `hg branch` => same as no arguments (from 3 onto 7):
151 Rebase with dest == `hg branch` => same as no arguments (from 3 onto 8):
167
152
168 $ hg clone -q -u 5 a a3
153 $ hg clone -q -u 3 a a3
169 $ cd a3
154 $ cd a3
170
155
171 $ hg rebase --dest `hg branch`
156 $ hg rebase --dest `hg branch`
172 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob)
157 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob)
173
158
174 $ hg tglog
159 $ hg tglog
175 @ 7: 'l3'
160 @ 8: 'D'
176 |
161 |
177 o 6: 'l2'
162 o 7: 'C'
178 |
163 |
179 o 5: 'l1'
164 o 6: 'B'
180 |
165 |
181 o 4: 'r2'
166 o 5: 'I'
182 |
167 |
183 o 3: 'r1'
168 o 4: 'H'
184 |
185 o 2: 'c3'
186 |
169 |
187 o 1: 'c2'
170 | o 3: 'G'
188 |
171 |/|
189 o 0: 'c1'
172 o | 2: 'F'
173 | |
174 | o 1: 'E'
175 |/
176 o 0: 'A'
190
177
191 $ cd ..
178 $ cd ..
192
179
193
180
194 Specify only source (from 4 onto 7):
181 Specify only source (from 2 onto 8):
195
182
196 $ hg clone -q -u . a a4
183 $ hg clone -q -u . a a4
197 $ cd a4
184 $ cd a4
198
185
199 $ hg rebase --source 4
186 $ hg rebase --source 2
200 saved backup bundle to $TESTTMP/a4/.hg/strip-backup/*-backup.hg (glob)
187 saved backup bundle to $TESTTMP/a4/.hg/strip-backup/*-backup.hg (glob)
201
188
202 $ hg tglog
189 $ hg tglog
203 @ 7: 'l3'
190 @ 8: 'D'
204 |
191 |
205 o 6: 'l2'
192 o 7: 'C'
206 |\
193 |\
207 | o 5: 'r2'
194 | o 6: 'I'
208 | |
195 | |
209 | o 4: 'r1'
196 | o 5: 'H'
210 | |
197 | |
211 o | 3: 'l1'
198 | | o 4: 'G'
212 | |
199 | |/|
213 | o 2: 'c3'
200 | o | 3: 'F'
201 | | |
202 | | o 2: 'E'
203 | |/
204 o | 1: 'B'
214 |/
205 |/
215 o 1: 'c2'
206 o 0: 'A'
216 |
217 o 0: 'c1'
218
207
219 $ cd ..
208 $ cd ..
220
209
221
210
222 Specify only dest (from 3 onto 6):
211 Specify only dest (from 3 onto 6):
223
212
224 $ hg clone -q -u 5 a a5
213 $ hg clone -q -u 3 a a5
225 $ cd a5
214 $ cd a5
226
215
227 $ hg rebase --dest 6
216 $ hg rebase --dest 6
228 saved backup bundle to $TESTTMP/a5/.hg/strip-backup/*-backup.hg (glob)
217 saved backup bundle to $TESTTMP/a5/.hg/strip-backup/*-backup.hg (glob)
229
218
230 $ hg tglog
219 $ hg tglog
231 @ 7: 'l3'
220 @ 8: 'D'
232 |
221 |
233 o 6: 'l2'
222 o 7: 'C'
223 |
224 o 6: 'B'
234 |
225 |
235 o 5: 'l1'
226 | o 5: 'I'
236 |
227 | |
237 | o 4: 'r2'
228 | o 4: 'H'
229 | |
230 o | 3: 'G'
231 |\|
232 | o 2: 'F'
233 | |
234 o | 1: 'E'
238 |/
235 |/
239 o 3: 'r1'
236 o 0: 'A'
240 |
241 o 2: 'c3'
242 |
243 o 1: 'c2'
244 |
245 o 0: 'c1'
246
237
247 $ cd ..
238 $ cd ..
248
239
249
240
250 Specify only base (from 3 onto 7):
241 Specify only base (from 1 onto 8):
251
242
252 $ hg clone -q -u . a a6
243 $ hg clone -q -u . a a6
253 $ cd a6
244 $ cd a6
254
245
255 $ hg rebase --base 5
246 $ hg rebase --base 3
256 saved backup bundle to $TESTTMP/a6/.hg/strip-backup/*-backup.hg (glob)
247 saved backup bundle to $TESTTMP/a6/.hg/strip-backup/*-backup.hg (glob)
257
248
258 $ hg tglog
249 $ hg tglog
259 @ 7: 'l3'
250 @ 8: 'D'
260 |
251 |
261 o 6: 'l2'
252 o 7: 'C'
262 |
253 |
263 o 5: 'l1'
254 o 6: 'B'
264 |
255 |
265 o 4: 'r2'
256 o 5: 'I'
266 |
257 |
267 o 3: 'r1'
258 o 4: 'H'
268 |
269 o 2: 'c3'
270 |
259 |
271 o 1: 'c2'
260 | o 3: 'G'
272 |
261 |/|
273 o 0: 'c1'
262 o | 2: 'F'
263 | |
264 | o 1: 'E'
265 |/
266 o 0: 'A'
274
267
275 $ cd ..
268 $ cd ..
276
269
277
270
278 Specify source and dest (from 4 onto 6):
271 Specify source and dest (from 2 onto 7):
279
272
280 $ hg clone -q -u . a a7
273 $ hg clone -q -u . a a7
281 $ cd a7
274 $ cd a7
282
275
283 $ hg rebase --source 4 --dest 6
276 $ hg rebase --detach --source 2 --dest 7
284 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/*-backup.hg (glob)
277 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/*-backup.hg (glob)
285
278
286 $ hg tglog
279 $ hg tglog
287 @ 7: 'l3'
280 @ 8: 'D'
281 |
282 o 7: 'C'
288 |
283 |
289 o 6: 'l2'
284 | o 6: 'I'
290 |\
285 |/
291 | | o 5: 'r2'
286 o 5: 'H'
292 | |/
287 |
293 | o 4: 'r1'
288 | o 4: 'G'
289 |/|
290 o | 3: 'F'
294 | |
291 | |
295 o | 3: 'l1'
292 | o 2: 'E'
296 | |
297 | o 2: 'c3'
298 |/
293 |/
299 o 1: 'c2'
294 | o 1: 'B'
300 |
295 |/
301 o 0: 'c1'
296 o 0: 'A'
302
297
303 $ cd ..
298 $ cd ..
304
299
305
300
306 Specify base and dest (from 3 onto 6):
301 Specify base and dest (from 1 onto 7):
307
302
308 $ hg clone -q -u . a a8
303 $ hg clone -q -u . a a8
309 $ cd a8
304 $ cd a8
310
305
311 $ hg rebase --base 4 --dest 6
306 $ hg rebase --base 3 --dest 7
312 saved backup bundle to $TESTTMP/a8/.hg/strip-backup/*-backup.hg (glob)
307 saved backup bundle to $TESTTMP/a8/.hg/strip-backup/*-backup.hg (glob)
313
308
314 $ hg tglog
309 $ hg tglog
315 @ 7: 'l3'
310 @ 8: 'D'
316 |
311 |
317 o 6: 'l2'
312 o 7: 'C'
318 |
313 |
319 o 5: 'l1'
314 o 6: 'B'
320 |
315 |
321 | o 4: 'r2'
316 | o 5: 'I'
322 |/
317 |/
323 o 3: 'r1'
318 o 4: 'H'
324 |
325 o 2: 'c3'
326 |
319 |
327 o 1: 'c2'
320 | o 3: 'G'
328 |
321 |/|
329 o 0: 'c1'
322 o | 2: 'F'
323 | |
324 | o 1: 'E'
325 |/
326 o 0: 'A'
330
327
331 $ cd ..
328 $ cd ..
332
329
@@ -10,122 +10,111 b''
10
10
11 $ hg init a
11 $ hg init a
12 $ cd a
12 $ cd a
13
13 $ hg unbundle $TESTDIR/bundles/rebase.hg
14 $ echo A > A
14 adding changesets
15 $ hg ci -Am A
15 adding manifests
16 adding A
16 adding file changes
17
17 added 8 changesets with 7 changes to 7 files (+2 heads)
18 $ echo B > B
18 (run 'hg heads' to see heads, 'hg merge' to merge)
19 $ hg ci -Am B
19 $ hg up tip
20 adding B
20 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
21
22 $ hg up -q -C 0
23
24 $ echo C > C
25 $ hg ci -Am C
26 adding C
27 created new head
28
29 $ hg up -q -C 0
30
31 $ echo D > D
32 $ hg ci -Am D
33 adding D
34 created new head
35
36 $ hg merge -r 2
37 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
38 (branch merge, don't forget to commit)
39
40 $ hg ci -m E
41
42 $ hg up -q -C 3
43
44 $ echo F > F
45 $ hg ci -Am F
46 adding F
47 created new head
48
49 $ cd ..
21 $ cd ..
50
22
51
23
52 Rebasing
24 Rebasing
53 B onto F - simple rebase:
25 D onto H - simple rebase:
54
26
55 $ hg clone -q -u . a a1
27 $ hg clone -q -u . a a1
56 $ cd a1
28 $ cd a1
57
29
58 $ hg tglog
30 $ hg tglog
59 @ 5: 'F'
31 @ 7: 'H'
60 |
32 |
33 | o 6: 'G'
34 |/|
35 o | 5: 'F'
36 | |
61 | o 4: 'E'
37 | o 4: 'E'
62 |/|
38 |/
63 o | 3: 'D'
39 | o 3: 'D'
64 | |
40 | |
65 | o 2: 'C'
41 | o 2: 'C'
66 |/
42 | |
67 | o 1: 'B'
43 | o 1: 'B'
68 |/
44 |/
69 o 0: 'A'
45 o 0: 'A'
70
46
71 $ hg rebase -s 1 -d 5
47
48 $ hg rebase -s 3 -d 7
72 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
49 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
73
50
74 $ hg tglog
51 $ hg tglog
75 @ 5: 'B'
52 @ 7: 'D'
76 |
53 |\
77 o 4: 'F'
54 | o 6: 'H'
78 |
79 | o 3: 'E'
80 |/|
81 o | 2: 'D'
82 | |
55 | |
83 | o 1: 'C'
56 | | o 5: 'G'
57 | |/|
58 | o | 4: 'F'
59 | | |
60 | | o 3: 'E'
61 | |/
62 o | 2: 'C'
63 | |
64 o | 1: 'B'
84 |/
65 |/
85 o 0: 'A'
66 o 0: 'A'
86
67
87 $ cd ..
68 $ cd ..
88
69
89
70
90 B onto D - intermediate point:
71 D onto F - intermediate point:
91
72
92 $ hg clone -q -u . a a2
73 $ hg clone -q -u . a a2
93 $ cd a2
74 $ cd a2
94
75
95 $ hg rebase -s 1 -d 3
76 $ hg rebase -s 3 -d 5
96 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob)
77 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob)
97
78
98 $ hg tglog
79 $ hg tglog
99 @ 5: 'B'
80 @ 7: 'D'
100 |
81 |\
101 | o 4: 'F'
82 | | o 6: 'H'
102 |/
83 | |/
103 | o 3: 'E'
84 | | o 5: 'G'
104 |/|
85 | |/|
105 o | 2: 'D'
86 | o | 4: 'F'
87 | | |
88 | | o 3: 'E'
89 | |/
90 o | 2: 'C'
106 | |
91 | |
107 | o 1: 'C'
92 o | 1: 'B'
108 |/
93 |/
109 o 0: 'A'
94 o 0: 'A'
110
95
111 $ cd ..
96 $ cd ..
112
97
113
98
114 C onto F - skip of E:
99 E onto H - skip of G:
115
100
116 $ hg clone -q -u . a a3
101 $ hg clone -q -u . a a3
117 $ cd a3
102 $ cd a3
118
103
119 $ hg rebase -s 2 -d 5
104 $ hg rebase -s 4 -d 7
120 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob)
105 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob)
121
106
122 $ hg tglog
107 $ hg tglog
123 @ 4: 'C'
108 @ 6: 'E'
109 |
110 o 5: 'H'
124 |
111 |
125 o 3: 'F'
112 o 4: 'F'
126 |
113 |
127 o 2: 'D'
114 | o 3: 'D'
128 |
115 | |
116 | o 2: 'C'
117 | |
129 | o 1: 'B'
118 | o 1: 'B'
130 |/
119 |/
131 o 0: 'A'
120 o 0: 'A'
@@ -133,21 +122,25 b' C onto F - skip of E:'
133 $ cd ..
122 $ cd ..
134
123
135
124
136 D onto C - rebase of a branching point (skip E):
125 F onto E - rebase of a branching point (skip G):
137
126
138 $ hg clone -q -u . a a4
127 $ hg clone -q -u . a a4
139 $ cd a4
128 $ cd a4
140
129
141 $ hg rebase -s 3 -d 2
130 $ hg rebase -s 5 -d 4
142 saved backup bundle to $TESTTMP/a4/.hg/strip-backup/*-backup.hg (glob)
131 saved backup bundle to $TESTTMP/a4/.hg/strip-backup/*-backup.hg (glob)
143
132
144 $ hg tglog
133 $ hg tglog
145 @ 4: 'F'
134 @ 6: 'H'
135 |
136 o 5: 'F'
146 |
137 |
147 o 3: 'D'
138 o 4: 'E'
148 |
139 |
149 o 2: 'C'
140 | o 3: 'D'
150 |
141 | |
142 | o 2: 'C'
143 | |
151 | o 1: 'B'
144 | o 1: 'B'
152 |/
145 |/
153 o 0: 'A'
146 o 0: 'A'
@@ -155,23 +148,27 b' D onto C - rebase of a branching point ('
155 $ cd ..
148 $ cd ..
156
149
157
150
158 E onto F - merged revision having a parent in ancestors of target:
151 G onto H - merged revision having a parent in ancestors of target:
159
152
160 $ hg clone -q -u . a a5
153 $ hg clone -q -u . a a5
161 $ cd a5
154 $ cd a5
162
155
163 $ hg rebase -s 4 -d 5
156 $ hg rebase -s 6 -d 7
164 saved backup bundle to $TESTTMP/a5/.hg/strip-backup/*-backup.hg (glob)
157 saved backup bundle to $TESTTMP/a5/.hg/strip-backup/*-backup.hg (glob)
165
158
166 $ hg tglog
159 $ hg tglog
167 @ 5: 'E'
160 @ 7: 'G'
168 |\
161 |\
169 | o 4: 'F'
162 | o 6: 'H'
170 | |
163 | |
164 | o 5: 'F'
165 | |
166 o | 4: 'E'
167 |/
171 | o 3: 'D'
168 | o 3: 'D'
172 | |
169 | |
173 o | 2: 'C'
170 | o 2: 'C'
174 |/
171 | |
175 | o 1: 'B'
172 | o 1: 'B'
176 |/
173 |/
177 o 0: 'A'
174 o 0: 'A'
@@ -179,22 +176,26 b' E onto F - merged revision having a pare'
179 $ cd ..
176 $ cd ..
180
177
181
178
182 D onto B - E maintains C as parent:
179 F onto B - G maintains E as parent:
183
180
184 $ hg clone -q -u . a a6
181 $ hg clone -q -u . a a6
185 $ cd a6
182 $ cd a6
186
183
187 $ hg rebase -s 3 -d 1
184 $ hg rebase -s 5 -d 1
188 saved backup bundle to $TESTTMP/a6/.hg/strip-backup/*-backup.hg (glob)
185 saved backup bundle to $TESTTMP/a6/.hg/strip-backup/*-backup.hg (glob)
189
186
190 $ hg tglog
187 $ hg tglog
191 @ 5: 'F'
188 @ 7: 'H'
192 |
189 |
193 | o 4: 'E'
190 | o 6: 'G'
194 |/|
191 |/|
195 o | 3: 'D'
192 o | 5: 'F'
193 | |
194 | o 4: 'E'
196 | |
195 | |
197 | o 2: 'C'
196 | | o 3: 'D'
197 | | |
198 +---o 2: 'C'
198 | |
199 | |
199 o | 1: 'B'
200 o | 1: 'B'
200 |/
201 |/
@@ -205,45 +206,45 b' D onto B - E maintains C as parent:'
205
206
206 These will fail (using --source):
207 These will fail (using --source):
207
208
208 E onto D - rebase onto an ancestor:
209 G onto F - rebase onto an ancestor:
209
210
210 $ hg clone -q -u . a a7
211 $ hg clone -q -u . a a7
211 $ cd a7
212 $ cd a7
212
213
213 $ hg rebase -s 4 -d 3
214 $ hg rebase -s 6 -d 5
214 abort: source is descendant of destination
215 abort: source is descendant of destination
215 [255]
216 [255]
216
217
217 D onto E - rebase onto a descendant:
218 F onto G - rebase onto a descendant:
218
219
219 $ hg rebase -s 3 -d 4
220 $ hg rebase -s 5 -d 6
220 abort: source is ancestor of destination
221 abort: source is ancestor of destination
221 [255]
222 [255]
222
223
223 E onto B - merge revision with both parents not in ancestors of target:
224 G onto B - merge revision with both parents not in ancestors of target:
224
225
225 $ hg rebase -s 4 -d 1
226 $ hg rebase -s 6 -d 1
226 abort: cannot use revision 4 as base, result would have 3 parents
227 abort: cannot use revision 6 as base, result would have 3 parents
227 [255]
228 [255]
228
229
229
230
230 These will abort gracefully (using --base):
231 These will abort gracefully (using --base):
231
232
232 E onto E - rebase onto same changeset:
233 G onto G - rebase onto same changeset:
233
234
234 $ hg rebase -b 4 -d 4
235 $ hg rebase -b 6 -d 6
235 nothing to rebase
236 nothing to rebase
236 [1]
237 [1]
237
238
238 E onto D - rebase onto an ancestor:
239 G onto F - rebase onto an ancestor:
239
240
240 $ hg rebase -b 4 -d 3
241 $ hg rebase -b 6 -d 5
241 nothing to rebase
242 nothing to rebase
242 [1]
243 [1]
243
244
244 D onto E - rebase onto a descendant:
245 F onto G - rebase onto a descendant:
245
246
246 $ hg rebase -b 3 -d 4
247 $ hg rebase -b 5 -d 6
247 nothing to rebase
248 nothing to rebase
248 [1]
249 [1]
249
250
@@ -22,83 +22,19 b' This test tries to exercise the ssh func'
22 > r = os.system(sys.argv[2])
22 > r = os.system(sys.argv[2])
23 > sys.exit(bool(r))
23 > sys.exit(bool(r))
24 > EOF
24 > EOF
25 $ hg init remote
26 $ cd remote
27
25
28 creating 'remote
26 creating 'remote
29
27
30 $ cat >>afile <<EOF
28 $ hg init remote
31 > 0
29 $ cd remote
32 > EOF
30 $ hg unbundle $TESTDIR/bundles/remote.hg
33 $ hg add afile
31 adding changesets
34 $ hg commit -m "0.0"
32 adding manifests
35 $ cat >>afile <<EOF
33 adding file changes
36 > 1
34 added 9 changesets with 7 changes to 4 files (+1 heads)
37 > EOF
35 (run 'hg heads' to see heads, 'hg merge' to merge)
38 $ hg commit -m "0.1"
36 $ hg up tip
39 $ cat >>afile <<EOF
40 > 2
41 > EOF
42 $ hg commit -m "0.2"
43 $ cat >>afile <<EOF
44 > 3
45 > EOF
46 $ hg commit -m "0.3"
47 $ hg update -C 0
48 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
37 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
49 $ cat >>afile <<EOF
50 > 1
51 > EOF
52 $ hg commit -m "1.1"
53 created new head
54 $ cat >>afile <<EOF
55 > 2
56 > EOF
57 $ hg commit -m "1.2"
58 $ cat >fred <<EOF
59 > a line
60 > EOF
61 $ cat >>afile <<EOF
62 > 3
63 > EOF
64 $ hg add fred
65 $ hg commit -m "1.3"
66 $ hg mv afile adifferentfile
67 $ hg commit -m "1.3m"
68 $ hg update -C 3
69 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
70 $ hg mv afile anotherfile
71 $ hg commit -m "0.3m"
72 $ hg debugindex .hg/store/data/afile.i
73 rev offset length base linkrev nodeid p1 p2
74 0 0 3 0 0 362fef284ce2 000000000000 000000000000
75 1 3 5 1 1 125144f7e028 362fef284ce2 000000000000
76 2 8 7 2 2 4c982badb186 125144f7e028 000000000000
77 3 15 9 3 3 19b1fc555737 4c982badb186 000000000000
78 $ hg debugindex .hg/store/data/adifferentfile.i
79 rev offset length base linkrev nodeid p1 p2
80 0 0 75 0 7 2565f3199a74 000000000000 000000000000
81 $ hg debugindex .hg/store/data/anotherfile.i
82 rev offset length base linkrev nodeid p1 p2
83 0 0 75 0 8 2565f3199a74 000000000000 000000000000
84 $ hg debugindex .hg/store/data/fred.i
85 rev offset length base linkrev nodeid p1 p2
86 0 0 8 0 6 12ab3bcc5ea4 000000000000 000000000000
87 $ hg debugindex .hg/store/00manifest.i
88 rev offset length base linkrev nodeid p1 p2
89 0 0 48 0 0 43eadb1d2d06 000000000000 000000000000
90 1 48 48 1 1 8b89697eba2c 43eadb1d2d06 000000000000
91 2 96 48 2 2 626a32663c2f 8b89697eba2c 000000000000
92 3 144 48 3 3 f54c32f13478 626a32663c2f 000000000000
93 4 192 58 3 6 de68e904d169 626a32663c2f 000000000000
94 5 250 68 3 7 09bb521d218d de68e904d169 000000000000
95 6 318 54 6 8 1fde233dfb0f f54c32f13478 000000000000
96 $ hg verify
97 checking changesets
98 checking manifests
99 crosschecking files in changesets and manifests
100 checking files
101 4 files, 9 changesets, 7 total revisions
102 $ cd ..
38 $ cd ..
103
39
104 clone remote via stream
40 clone remote via stream
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now