Show More
@@ -433,7 +433,7 b' def update(repo, node, branchmerge, forc' | |||||
433 | the parent rev to the target rev (linear, on the same named |
|
433 | the parent rev to the target rev (linear, on the same named | |
434 | branch, or on another named branch). |
|
434 | branch, or on another named branch). | |
435 |
|
435 | |||
436 | This logic is tested by test-update-branches. |
|
436 | This logic is tested by test-update-branches.t. | |
437 |
|
437 | |||
438 | -c -C dirty rev | linear same cross |
|
438 | -c -C dirty rev | linear same cross | |
439 | n n n n | ok (1) x |
|
439 | n n n n | ok (1) x |
@@ -1,15 +1,33 b'' | |||||
1 | #!/bin/sh |
|
1 | $ hg init | |
|
2 | $ echo a > a | |||
|
3 | $ hg add a | |||
|
4 | $ hg commit -m test | |||
|
5 | ||||
|
6 | Do we ever miss a sub-second change?: | |||
2 |
|
7 | |||
3 | mkdir t |
|
8 | $ for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do | |
4 | cd t |
|
9 | > hg co -qC 0 | |
5 | hg init |
|
10 | > echo b > a | |
6 | echo a > a |
|
11 | > hg st | |
7 | hg add a |
|
12 | > done | |
8 | hg commit -m test |
|
13 | M a | |
|
14 | M a | |||
|
15 | M a | |||
|
16 | M a | |||
|
17 | M a | |||
|
18 | M a | |||
|
19 | M a | |||
|
20 | M a | |||
|
21 | M a | |||
|
22 | M a | |||
|
23 | M a | |||
|
24 | M a | |||
|
25 | M a | |||
|
26 | M a | |||
|
27 | M a | |||
|
28 | M a | |||
|
29 | M a | |||
|
30 | M a | |||
|
31 | M a | |||
|
32 | M a | |||
9 |
|
33 | |||
10 | # do we ever miss a sub-second change? |
|
|||
11 | for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do |
|
|||
12 | hg co -qC 0 |
|
|||
13 | echo b > a |
|
|||
14 | hg st |
|
|||
15 | done |
|
@@ -1,44 +1,74 b'' | |||||
1 | #!/bin/sh |
|
1 | $ hg init | |
|
2 | ||||
|
3 | $ echo "added file1" > file1 | |||
|
4 | $ echo "added file2" > file2 | |||
|
5 | $ hg add file1 file2 | |||
|
6 | $ hg commit -m "added file1 and file2" | |||
|
7 | ||||
|
8 | $ echo "changed file1" >> file1 | |||
|
9 | $ hg commit -m "changed file1" | |||
|
10 | ||||
|
11 | $ hg -q log | |||
|
12 | 1:08a16e8e4408 | |||
|
13 | 0:d29c767a4b52 | |||
|
14 | $ hg id | |||
|
15 | 08a16e8e4408 tip | |||
|
16 | ||||
|
17 | $ hg update -C 0 | |||
|
18 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
19 | $ hg id | |||
|
20 | d29c767a4b52 | |||
|
21 | $ echo "changed file1" >> file1 | |||
|
22 | $ hg id | |||
|
23 | d29c767a4b52+ | |||
|
24 | ||||
|
25 | $ hg revert --all | |||
|
26 | reverting file1 | |||
|
27 | $ hg diff | |||
|
28 | $ hg status | |||
|
29 | ? file1.orig | |||
|
30 | $ hg id | |||
|
31 | d29c767a4b52 | |||
2 |
|
32 | |||
3 | mkdir t |
|
33 | $ hg update | |
4 | cd t |
|
34 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
5 | hg init |
|
35 | $ hg diff | |
6 | echo "added file1" > file1 |
|
36 | $ hg status | |
7 | echo "added file2" > file2 |
|
37 | ? file1.orig | |
8 | hg add file1 file2 |
|
38 | $ hg id | |
9 | hg commit -m "added file1 and file2" |
|
39 | 08a16e8e4408 tip | |
10 | echo "changed file1" >> file1 |
|
40 | ||
11 | hg commit -m "changed file1" |
|
41 | $ hg update -C 0 | |
12 | hg -q log |
|
42 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
13 | hg id |
|
43 | $ echo "changed file1" >> file1 | |
14 | hg update -C 0 |
|
44 | ||
15 | hg id |
|
45 | $ hg update | |
16 | echo "changed file1" >> file1 |
|
46 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
17 | hg id |
|
47 | $ hg diff | |
18 | hg revert --all |
|
48 | $ hg status | |
19 | hg diff |
|
49 | ? file1.orig | |
20 | hg status |
|
50 | $ hg id | |
21 | hg id |
|
51 | 08a16e8e4408 tip | |
22 | hg update |
|
|||
23 | hg diff |
|
|||
24 | hg status |
|
|||
25 | hg id |
|
|||
26 | hg update -C 0 |
|
|||
27 | echo "changed file1" >> file1 |
|
|||
28 | hg update |
|
|||
29 | hg diff |
|
|||
30 | hg status |
|
|||
31 | hg id |
|
|||
32 | hg revert --all |
|
|||
33 | hg diff |
|
|||
34 | hg status |
|
|||
35 | hg id |
|
|||
36 | hg revert -r tip --all |
|
|||
37 | hg diff |
|
|||
38 | hg status |
|
|||
39 | hg id |
|
|||
40 | hg update -C |
|
|||
41 | hg diff |
|
|||
42 | hg status |
|
|||
43 | hg id |
|
|||
44 |
|
52 | |||
|
53 | $ hg revert --all | |||
|
54 | $ hg diff | |||
|
55 | $ hg status | |||
|
56 | ? file1.orig | |||
|
57 | $ hg id | |||
|
58 | 08a16e8e4408 tip | |||
|
59 | ||||
|
60 | $ hg revert -r tip --all | |||
|
61 | $ hg diff | |||
|
62 | $ hg status | |||
|
63 | ? file1.orig | |||
|
64 | $ hg id | |||
|
65 | 08a16e8e4408 tip | |||
|
66 | ||||
|
67 | $ hg update -C | |||
|
68 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
69 | $ hg diff | |||
|
70 | $ hg status | |||
|
71 | ? file1.orig | |||
|
72 | $ hg id | |||
|
73 | 08a16e8e4408 tip | |||
|
74 |
@@ -1,45 +1,93 b'' | |||||
1 | #!/bin/sh |
|
1 | $ hg init | |
|
2 | ||||
|
3 | $ echo "added file1" > file1 | |||
|
4 | $ echo "another line of text" >> file1 | |||
|
5 | $ echo "added file2" > file2 | |||
|
6 | $ hg add file1 file2 | |||
|
7 | $ hg commit -m "added file1 and file2" | |||
|
8 | ||||
|
9 | $ echo "changed file1" >> file1 | |||
|
10 | $ hg commit -m "changed file1" | |||
|
11 | ||||
|
12 | $ hg -q log | |||
|
13 | 1:dfab7f3c2efb | |||
|
14 | 0:c3fa057dd86f | |||
|
15 | $ hg id | |||
|
16 | dfab7f3c2efb tip | |||
|
17 | ||||
|
18 | $ hg update -C 0 | |||
|
19 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
20 | $ hg id | |||
|
21 | c3fa057dd86f | |||
|
22 | ||||
|
23 | $ echo "changed file1" >> file1 | |||
|
24 | $ hg id | |||
|
25 | c3fa057dd86f+ | |||
|
26 | ||||
|
27 | $ hg revert --no-backup --all | |||
|
28 | reverting file1 | |||
|
29 | $ hg diff | |||
|
30 | $ hg status | |||
|
31 | $ hg id | |||
|
32 | c3fa057dd86f | |||
|
33 | ||||
|
34 | $ hg update | |||
|
35 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
36 | $ hg diff | |||
|
37 | $ hg status | |||
|
38 | $ hg id | |||
|
39 | dfab7f3c2efb tip | |||
|
40 | ||||
|
41 | $ hg update -C 0 | |||
|
42 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
43 | $ echo "changed file1 different" >> file1 | |||
2 |
|
44 | |||
3 | mkdir t |
|
45 | $ hg update | |
4 | cd t |
|
46 | merging file1 | |
5 | hg init |
|
47 | warning: conflicts during merge. | |
6 | echo "added file1" > file1 |
|
48 | merging file1 failed! | |
7 | echo "another line of text" >> file1 |
|
49 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
8 | echo "added file2" > file2 |
|
50 | use 'hg resolve' to retry unresolved file merges | |
9 | hg add file1 file2 |
|
51 | ||
10 | hg commit -m "added file1 and file2" |
|
52 | $ hg diff --nodates | |
11 | echo "changed file1" >> file1 |
|
53 | diff -r dfab7f3c2efb file1 | |
12 | hg commit -m "changed file1" |
|
54 | --- a/file1 | |
13 | hg -q log |
|
55 | +++ b/file1 | |
14 | hg id |
|
56 | @@ -1,3 +1,7 @@ | |
15 | hg update -C 0 |
|
57 | added file1 | |
16 | hg id |
|
58 | another line of text | |
17 | echo "changed file1" >> file1 |
|
59 | +<<<<<<< local | |
18 | hg id |
|
60 | +changed file1 different | |
19 | hg revert --no-backup --all |
|
61 | +======= | |
20 | hg diff |
|
62 | changed file1 | |
21 | hg status |
|
63 | +>>>>>>> other | |
22 | hg id |
|
|||
23 | hg update |
|
|||
24 | hg diff |
|
|||
25 | hg status |
|
|||
26 | hg id |
|
|||
27 | hg update -C 0 |
|
|||
28 | echo "changed file1 different" >> file1 |
|
|||
29 | hg update |
|
|||
30 | hg diff --nodates |
|
|||
31 | hg status |
|
|||
32 | hg id |
|
|||
33 | hg revert --no-backup --all |
|
|||
34 | hg diff |
|
|||
35 | hg status |
|
|||
36 | hg id |
|
|||
37 | hg revert -r tip --no-backup --all |
|
|||
38 | hg diff |
|
|||
39 | hg status |
|
|||
40 | hg id |
|
|||
41 | hg update -C |
|
|||
42 | hg diff |
|
|||
43 | hg status |
|
|||
44 | hg id |
|
|||
45 |
|
64 | |||
|
65 | $ hg status | |||
|
66 | M file1 | |||
|
67 | ? file1.orig | |||
|
68 | $ hg id | |||
|
69 | dfab7f3c2efb+ tip | |||
|
70 | ||||
|
71 | $ hg revert --no-backup --all | |||
|
72 | reverting file1 | |||
|
73 | $ hg diff | |||
|
74 | $ hg status | |||
|
75 | ? file1.orig | |||
|
76 | $ hg id | |||
|
77 | dfab7f3c2efb tip | |||
|
78 | ||||
|
79 | $ hg revert -r tip --no-backup --all | |||
|
80 | $ hg diff | |||
|
81 | $ hg status | |||
|
82 | ? file1.orig | |||
|
83 | $ hg id | |||
|
84 | dfab7f3c2efb tip | |||
|
85 | ||||
|
86 | $ hg update -C | |||
|
87 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
88 | $ hg diff | |||
|
89 | $ hg status | |||
|
90 | ? file1.orig | |||
|
91 | $ hg id | |||
|
92 | dfab7f3c2efb tip | |||
|
93 |
@@ -1,39 +1,70 b'' | |||||
1 | #!/bin/sh |
|
1 | $ hg init | |
2 |
|
2 | |||
3 | hg init |
|
3 | $ echo a > a | |
4 | echo a > a |
|
4 | $ hg ci -Amadd | |
5 | hg ci -Amadd # 0 |
|
5 | adding a | |
|
6 | ||||
|
7 | $ chmod +x a | |||
|
8 | $ hg ci -mexecutable | |||
6 |
|
9 | |||
7 | chmod +x a |
|
10 | $ hg up 0 | |
8 | hg ci -mexecutable # 1 |
|
11 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
12 | $ rm a | |||
|
13 | $ ln -s symlink a | |||
|
14 | $ hg ci -msymlink | |||
|
15 | created new head | |||
9 |
|
16 | |||
10 | hg up 0 |
|
17 | $ hg merge --debug | |
11 | rm a |
|
18 | searching for copies back to rev 1 | |
12 | ln -s symlink a |
|
19 | resolving manifests | |
13 | hg ci -msymlink # 2 |
|
20 | overwrite None partial False | |
14 | hg merge --debug |
|
21 | ancestor c334dc3be0da local 521a1e40188f+ remote 3574f3e69b1c | |
|
22 | conflicting flags for a | |||
|
23 | (n)one, e(x)ec or sym(l)ink? n | |||
|
24 | a: update permissions -> e | |||
|
25 | updating: a 1/1 files (100.00%) | |||
|
26 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
27 | (branch merge, don't forget to commit) | |||
15 |
|
28 | |||
16 | echo % symlink is local parent, executable is other |
|
29 | ||
|
30 | Symlink is local parent, executable is other: | |||
17 |
|
31 | |||
18 | if [ -h a ]; then |
|
32 | $ if [ -h a ]; then | |
19 | echo a is a symlink |
|
33 | > echo a is a symlink | |
20 | $TESTDIR/readlink.py a |
|
34 | > $TESTDIR/readlink.py a | |
21 | elif [ -x a ]; then |
|
35 | > elif [ -x a ]; then | |
22 | echo a is executable |
|
36 | > echo a is executable | |
23 | else |
|
37 | > else | |
24 | echo "a has no flags (default for conflicts)" |
|
38 | > echo "a has no flags (default for conflicts)" | |
25 | fi |
|
39 | > fi | |
|
40 | a has no flags (default for conflicts) | |||
|
41 | ||||
|
42 | $ hg update -C 1 | |||
|
43 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
26 |
|
44 | |||
27 | hg update -C 1 |
|
45 | $ hg merge --debug | |
28 | hg merge --debug |
|
46 | searching for copies back to rev 1 | |
29 |
|
47 | resolving manifests | ||
30 | echo % symlink is other parent, executable is local |
|
48 | overwrite None partial False | |
|
49 | ancestor c334dc3be0da local 3574f3e69b1c+ remote 521a1e40188f | |||
|
50 | conflicting flags for a | |||
|
51 | (n)one, e(x)ec or sym(l)ink? n | |||
|
52 | a: remote is newer -> g | |||
|
53 | updating: a 1/1 files (100.00%) | |||
|
54 | getting a | |||
|
55 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
56 | (branch merge, don't forget to commit) | |||
31 |
|
57 | |||
32 | if [ -h a ]; then |
|
58 | ||
33 | echo a is a symlink |
|
59 | Symlink is other parent, executable is local: | |
34 | $TESTDIR/readlink.py a |
|
60 | ||
35 |
|
|
61 | $ if [ -h a ]; then | |
36 |
echo a is |
|
62 | > echo a is a symlink | |
37 | else |
|
63 | > $TESTDIR/readlink.py a | |
38 | echo "a has no flags (default for conflicts)" |
|
64 | > elif [ -x a ]; then | |
39 | fi |
|
65 | > echo a is executable | |
|
66 | > else | |||
|
67 | > echo "a has no flags (default for conflicts)" | |||
|
68 | > fi | |||
|
69 | a has no flags (default for conflicts) | |||
|
70 |
@@ -1,28 +1,36 b'' | |||||
1 | #!/bin/sh |
|
1 | $ hg init a | |
|
2 | $ cd a | |||
|
3 | $ hg init b | |||
|
4 | $ echo x > b/x | |||
|
5 | ||||
|
6 | Should print nothing: | |||
2 |
|
7 | |||
3 | hg init a |
|
8 | $ hg add b | |
4 | cd a |
|
9 | $ hg st | |
5 | hg init b |
|
10 | ||
6 | echo x > b/x |
|
11 | Should fail: | |
7 |
|
12 | |||
8 | echo '# should print nothing' |
|
13 | $ hg st b/x | |
9 | hg add b |
|
14 | abort: path 'b/x' is inside repo 'b' | |
10 | hg st |
|
15 | $ hg add b/x | |
|
16 | abort: path 'b/x' is inside repo 'b' | |||
11 |
|
17 | |||
12 |
|
|
18 | Should fail: | |
13 | hg st b/x |
|
|||
14 | hg add b/x |
|
|||
15 |
|
19 | |||
16 | echo '# should fail' |
|
20 | $ hg add b b/x | |
17 | hg add b b/x |
|
21 | abort: path 'b/x' is inside repo 'b' | |
18 | hg st |
|
22 | $ hg st | |
|
23 | ||||
|
24 | Should arguably print nothing: | |||
|
25 | ||||
|
26 | $ hg st b | |||
19 |
|
27 | |||
20 | echo '# should arguably print nothing' |
|
28 | $ echo a > a | |
21 | hg st b |
|
29 | $ hg ci -Ama a | |
|
30 | ||||
|
31 | Should fail: | |||
22 |
|
32 | |||
23 | echo a > a |
|
33 | $ hg mv a b | |
24 | hg ci -Ama a |
|
34 | abort: path 'b/a' is inside repo 'b' | |
|
35 | $ hg st | |||
25 |
|
36 | |||
26 | echo '# should fail' |
|
|||
27 | hg mv a b |
|
|||
28 | hg st |
|
@@ -1,113 +1,316 b'' | |||||
1 | #!/bin/sh |
|
1 | $ branchcache=.hg/branchheads.cache | |
|
2 | ||||
|
3 | $ hg init t | |||
|
4 | $ cd t | |||
2 |
|
5 | |||
3 | branchcache=.hg/branchheads.cache |
|
6 | $ hg branches | |
|
7 | $ echo foo > a | |||
|
8 | $ hg add a | |||
|
9 | $ hg ci -m "initial" | |||
|
10 | $ hg branch foo | |||
|
11 | marked working directory as branch foo | |||
|
12 | $ hg branch | |||
|
13 | foo | |||
|
14 | $ hg ci -m "add branch name" | |||
|
15 | $ hg branch bar | |||
|
16 | marked working directory as branch bar | |||
|
17 | $ hg ci -m "change branch name" | |||
4 |
|
18 | |||
5 | hg init t |
|
19 | Branch shadowing: | |
6 | cd t |
|
20 | ||
7 |
hg branch |
|
21 | $ hg branch default | |
|
22 | abort: a branch of the same name already exists (use 'hg update' to switch to it) | |||
|
23 | ||||
|
24 | $ hg branch -f default | |||
|
25 | marked working directory as branch default | |||
|
26 | ||||
|
27 | $ hg ci -m "clear branch name" | |||
|
28 | created new head | |||
|
29 | ||||
|
30 | There should be only one default branch head | |||
|
31 | ||||
|
32 | $ hg heads . | |||
|
33 | changeset: 3:9d567d0b51f9 | |||
|
34 | tag: tip | |||
|
35 | user: test | |||
|
36 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
37 | summary: clear branch name | |||
8 |
|
38 | |||
9 | echo foo > a |
|
39 | ||
10 | hg add a |
|
40 | $ hg co foo | |
11 | hg ci -m "initial" |
|
41 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
12 |
hg branch |
|
42 | $ hg branch | |
13 | hg branch |
|
43 | foo | |
14 | hg ci -m "add branch name" |
|
44 | $ echo bleah > a | |
15 | hg branch bar |
|
45 | $ hg ci -m "modify a branch" | |
16 | hg ci -m "change branch name" |
|
46 | ||
17 | echo % branch shadowing |
|
47 | $ hg merge default | |
18 | hg branch default |
|
48 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
19 | hg branch -f default |
|
49 | (branch merge, don't forget to commit) | |
20 | hg ci -m "clear branch name" |
|
50 | ||
|
51 | $ hg branch | |||
|
52 | foo | |||
|
53 | $ hg ci -m "merge" | |||
21 |
|
54 | |||
22 | echo % there should be only one default branch head |
|
55 | $ hg log | |
23 | hg heads . |
|
56 | changeset: 5:dc140083783b | |
|
57 | branch: foo | |||
|
58 | tag: tip | |||
|
59 | parent: 4:98d14f698afe | |||
|
60 | parent: 3:9d567d0b51f9 | |||
|
61 | user: test | |||
|
62 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
63 | summary: merge | |||
|
64 | ||||
|
65 | changeset: 4:98d14f698afe | |||
|
66 | branch: foo | |||
|
67 | parent: 1:0079f24813e2 | |||
|
68 | user: test | |||
|
69 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
70 | summary: modify a branch | |||
|
71 | ||||
|
72 | changeset: 3:9d567d0b51f9 | |||
|
73 | user: test | |||
|
74 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
75 | summary: clear branch name | |||
24 |
|
76 | |||
25 | hg co foo |
|
77 | changeset: 2:ed2bbf4e0102 | |
26 | hg branch |
|
78 | branch: bar | |
27 | echo bleah > a |
|
79 | user: test | |
28 | hg ci -m "modify a branch" |
|
80 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
81 | summary: change branch name | |||
|
82 | ||||
|
83 | changeset: 1:0079f24813e2 | |||
|
84 | branch: foo | |||
|
85 | user: test | |||
|
86 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
87 | summary: add branch name | |||
|
88 | ||||
|
89 | changeset: 0:db01e8ea3388 | |||
|
90 | user: test | |||
|
91 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
92 | summary: initial | |||
29 |
|
93 | |||
30 | hg merge default |
|
94 | $ hg branches | |
31 | hg branch |
|
95 | foo 5:dc140083783b | |
32 | hg ci -m "merge" |
|
96 | default 3:9d567d0b51f9 (inactive) | |
33 | hg log |
|
97 | bar 2:ed2bbf4e0102 (inactive) | |
34 |
|
98 | |||
35 | hg branches |
|
99 | $ hg branches -q | |
36 | hg branches -q |
|
100 | foo | |
|
101 | default | |||
|
102 | bar | |||
|
103 | ||||
|
104 | Test for invalid branch cache: | |||
|
105 | ||||
|
106 | $ hg rollback | |||
|
107 | rolling back to revision 4 (undo commit) | |||
|
108 | ||||
|
109 | $ cp $branchcache .hg/bc-invalid | |||
37 |
|
110 | |||
38 | echo % test for invalid branch cache |
|
111 | $ hg log -r foo | |
39 | hg rollback |
|
112 | changeset: 4:98d14f698afe | |
40 | cp $branchcache .hg/bc-invalid |
|
113 | branch: foo | |
41 | hg log -r foo |
|
114 | tag: tip | |
42 | cp .hg/bc-invalid $branchcache |
|
115 | parent: 1:0079f24813e2 | |
43 | hg --debug log -r foo |
|
116 | user: test | |
44 | rm $branchcache |
|
117 | date: Thu Jan 01 00:00:00 1970 +0000 | |
45 | echo corrupted > $branchcache |
|
118 | summary: modify a branch | |
46 | hg log -qr foo |
|
119 | ||
47 |
|
|
120 | $ cp .hg/bc-invalid $branchcache | |
48 |
|
121 | |||
49 | echo % push should update the branch cache |
|
122 | $ hg --debug log -r foo | |
50 | hg init ../target |
|
123 | invalidating branch cache (tip differs) | |
51 | echo % pushing just rev 0 |
|
124 | changeset: 4:98d14f698afeaff8cb612dcf215ce95e639effc3 | |
52 | hg push -qr 0 ../target |
|
125 | branch: foo | |
53 | cat ../target/$branchcache |
|
126 | tag: tip | |
54 | echo % pushing everything |
|
127 | parent: 1:0079f24813e2b73a891577c243684c5066347bc8 | |
55 | hg push -qf ../target |
|
128 | parent: -1:0000000000000000000000000000000000000000 | |
56 | cat ../target/$branchcache |
|
129 | manifest: 4:d01b250baaa05909152f7ae07d7a649deea0df9a | |
|
130 | user: test | |||
|
131 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
132 | files: a | |||
|
133 | extra: branch=foo | |||
|
134 | description: | |||
|
135 | modify a branch | |||
|
136 | ||||
|
137 | ||||
|
138 | $ rm $branchcache | |||
|
139 | $ echo corrupted > $branchcache | |||
|
140 | ||||
|
141 | $ hg log -qr foo | |||
|
142 | 4:98d14f698afe | |||
|
143 | ||||
|
144 | $ cat $branchcache | |||
|
145 | 98d14f698afeaff8cb612dcf215ce95e639effc3 4 | |||
|
146 | 9d567d0b51f9e2068b054e1948e1a927f99b5874 default | |||
|
147 | 98d14f698afeaff8cb612dcf215ce95e639effc3 foo | |||
|
148 | ed2bbf4e01029020711be82ca905283e883f0e11 bar | |||
|
149 | ||||
|
150 | Push should update the branch cache: | |||
|
151 | ||||
|
152 | $ hg init ../target | |||
|
153 | ||||
|
154 | Pushing just rev 0: | |||
|
155 | ||||
|
156 | $ hg push -qr 0 ../target | |||
57 |
|
157 | |||
58 | echo % update with no arguments: tipmost revision of the current branch |
|
158 | $ cat ../target/$branchcache | |
59 | hg up -q -C 0 |
|
159 | db01e8ea3388fd3c7c94e1436ea2bd6a53d581c5 0 | |
60 | hg up -q |
|
160 | db01e8ea3388fd3c7c94e1436ea2bd6a53d581c5 default | |
61 | hg id |
|
161 | ||
62 | hg up -q 1 |
|
162 | Pushing everything: | |
63 | hg up -q |
|
163 | ||
64 | hg id |
|
164 | $ hg push -qf ../target | |
65 | hg branch foobar |
|
165 | ||
66 | hg up |
|
166 | $ cat ../target/$branchcache | |
|
167 | 98d14f698afeaff8cb612dcf215ce95e639effc3 4 | |||
|
168 | 9d567d0b51f9e2068b054e1948e1a927f99b5874 default | |||
|
169 | 98d14f698afeaff8cb612dcf215ce95e639effc3 foo | |||
|
170 | ed2bbf4e01029020711be82ca905283e883f0e11 bar | |||
|
171 | ||||
|
172 | Update with no arguments: tipmost revision of the current branch: | |||
|
173 | ||||
|
174 | $ hg up -q -C 0 | |||
|
175 | $ hg up -q | |||
|
176 | $ hg id | |||
|
177 | 9d567d0b51f9 | |||
|
178 | ||||
|
179 | $ hg up -q 1 | |||
|
180 | $ hg up -q | |||
|
181 | $ hg id | |||
|
182 | 98d14f698afe (foo) tip | |||
|
183 | ||||
|
184 | $ hg branch foobar | |||
|
185 | marked working directory as branch foobar | |||
|
186 | ||||
|
187 | $ hg up | |||
|
188 | abort: branch foobar not found | |||
|
189 | ||||
|
190 | Fastforward merge: | |||
|
191 | ||||
|
192 | $ hg branch ff | |||
|
193 | marked working directory as branch ff | |||
67 |
|
194 | |||
68 | echo % fastforward merge |
|
195 | $ echo ff > ff | |
69 | hg branch ff |
|
196 | $ hg ci -Am'fast forward' | |
70 | echo ff > ff |
|
197 | adding ff | |
71 | hg ci -Am'fast forward' |
|
198 | ||
72 | hg up foo |
|
199 | $ hg up foo | |
73 | hg merge ff |
|
200 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
74 | hg branch |
|
201 | ||
75 | hg commit -m'Merge ff into foo' |
|
202 | $ hg merge ff | |
76 | hg parents |
|
203 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
77 | hg manifest |
|
204 | (branch merge, don't forget to commit) | |
78 |
|
205 | |||
79 | echo % test merging, add 3 default heads and one test head |
|
206 | $ hg branch | |
80 | cd .. |
|
207 | foo | |
81 | hg init merges |
|
208 | $ hg commit -m'Merge ff into foo' | |
82 | cd merges |
|
209 | $ hg parents | |
83 | echo a > a |
|
210 | changeset: 6:917eb54e1b4b | |
84 | hg ci -Ama |
|
211 | branch: foo | |
|
212 | tag: tip | |||
|
213 | parent: 4:98d14f698afe | |||
|
214 | parent: 5:6683a60370cb | |||
|
215 | user: test | |||
|
216 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
217 | summary: Merge ff into foo | |||
|
218 | ||||
|
219 | $ hg manifest | |||
|
220 | a | |||
|
221 | ff | |||
|
222 | ||||
|
223 | ||||
|
224 | Test merging, add 3 default heads and one test head: | |||
|
225 | ||||
|
226 | $ cd .. | |||
|
227 | $ hg init merges | |||
|
228 | $ cd merges | |||
|
229 | $ echo a > a | |||
|
230 | $ hg ci -Ama | |||
|
231 | adding a | |||
|
232 | ||||
|
233 | $ echo b > b | |||
|
234 | $ hg ci -Amb | |||
|
235 | adding b | |||
85 |
|
236 | |||
86 | echo b > b |
|
237 | $ hg up 0 | |
87 | hg ci -Amb |
|
238 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
|
239 | $ echo c > c | |||
|
240 | $ hg ci -Amc | |||
|
241 | adding c | |||
|
242 | created new head | |||
|
243 | ||||
|
244 | $ hg up 0 | |||
|
245 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||
|
246 | $ echo d > d | |||
|
247 | $ hg ci -Amd | |||
|
248 | adding d | |||
|
249 | created new head | |||
88 |
|
250 | |||
89 | hg up 0 |
|
251 | $ hg up 0 | |
90 | echo c > c |
|
252 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
91 | hg ci -Amc |
|
253 | $ hg branch test | |
|
254 | marked working directory as branch test | |||
|
255 | $ echo e >> e | |||
|
256 | $ hg ci -Ame | |||
|
257 | adding e | |||
92 |
|
258 | |||
93 | hg up 0 |
|
259 | $ hg log | |
94 | echo d > d |
|
260 | changeset: 4:3a1e01ed1df4 | |
95 | hg ci -Amd |
|
261 | branch: test | |
|
262 | tag: tip | |||
|
263 | parent: 0:cb9a9f314b8b | |||
|
264 | user: test | |||
|
265 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
266 | summary: e | |||
|
267 | ||||
|
268 | changeset: 3:980f7dc84c29 | |||
|
269 | parent: 0:cb9a9f314b8b | |||
|
270 | user: test | |||
|
271 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
272 | summary: d | |||
96 |
|
273 | |||
97 | hg up 0 |
|
274 | changeset: 2:d36c0562f908 | |
98 | hg branch test |
|
275 | parent: 0:cb9a9f314b8b | |
99 | echo e >> e |
|
276 | user: test | |
100 | hg ci -Ame |
|
277 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
278 | summary: c | |||
101 |
|
279 | |||
102 | hg log |
|
280 | changeset: 1:d2ae7f538514 | |
|
281 | user: test | |||
|
282 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
283 | summary: b | |||
|
284 | ||||
|
285 | changeset: 0:cb9a9f314b8b | |||
|
286 | user: test | |||
|
287 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
288 | summary: a | |||
|
289 | ||||
|
290 | Implicit merge with test branch as parent: | |||
103 |
|
291 | |||
104 | echo % implicit merge with test branch as parent |
|
292 | $ hg merge | |
105 | hg merge |
|
293 | abort: branch 'test' has one head - please merge with an explicit rev | |
106 | hg up -C default |
|
294 | (run 'hg heads' to see all heads) | |
107 | echo % implicit merge with default branch as parent |
|
295 | $ hg up -C default | |
108 | hg merge |
|
296 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
109 | echo % 3 branch heads, explicit merge required |
|
297 | ||
110 | hg merge 2 |
|
298 | Implicit merge with default branch as parent: | |
111 | hg ci -m merge |
|
299 | ||
112 | echo % 2 branch heads, implicit merge works |
|
300 | $ hg merge | |
113 | hg merge |
|
301 | abort: branch 'default' has 3 heads - please merge with an explicit rev | |
|
302 | (run 'hg heads .' to see heads) | |||
|
303 | ||||
|
304 | 3 branch heads, explicit merge required: | |||
|
305 | ||||
|
306 | $ hg merge 2 | |||
|
307 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
308 | (branch merge, don't forget to commit) | |||
|
309 | $ hg ci -m merge | |||
|
310 | ||||
|
311 | 2 branch heads, implicit merge works: | |||
|
312 | ||||
|
313 | $ hg merge | |||
|
314 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
315 | (branch merge, don't forget to commit) | |||
|
316 |
@@ -1,37 +1,69 b'' | |||||
1 | #!/bin/sh |
|
1 | $ hg init t | |
|
2 | $ cd t | |||
|
3 | ||||
|
4 | $ echo foo > a | |||
|
5 | $ hg add a | |||
|
6 | ||||
|
7 | $ hg commit -m "1" | |||
|
8 | ||||
|
9 | $ hg verify | |||
|
10 | checking changesets | |||
|
11 | checking manifests | |||
|
12 | crosschecking files in changesets and manifests | |||
|
13 | checking files | |||
|
14 | 1 files, 1 changesets, 1 total revisions | |||
|
15 | ||||
|
16 | $ chmod -r .hg/store/data/a.i | |||
|
17 | ||||
|
18 | $ hg verify || echo %%% verify failed | |||
|
19 | checking changesets | |||
|
20 | checking manifests | |||
|
21 | crosschecking files in changesets and manifests | |||
|
22 | checking files | |||
|
23 | abort: Permission denied: .* | |||
|
24 | %%% verify failed | |||
|
25 | ||||
|
26 | $ chmod +r .hg/store/data/a.i | |||
|
27 | ||||
|
28 | $ hg verify || echo %%% verify failed | |||
|
29 | checking changesets | |||
|
30 | checking manifests | |||
|
31 | crosschecking files in changesets and manifests | |||
|
32 | checking files | |||
|
33 | 1 files, 1 changesets, 1 total revisions | |||
2 |
|
34 | |||
3 | echo '% hg init t' |
|
35 | $ chmod -w .hg/store/data/a.i | |
4 | hg init t |
|
36 | ||
5 | cd t |
|
37 | $ echo barber > a | |
6 | echo foo > a |
|
38 | $ hg commit -m "2" || echo %%% commit failed | |
7 | echo '% hg add a' |
|
39 | trouble committing a! | |
8 | hg add a |
|
40 | abort: Permission denied: .* | |
9 | echo '% hg commit' |
|
41 | %%% commit failed | |
10 | hg commit -m "1" |
|
42 | ||
11 | echo '% hg verify' |
|
43 | $ chmod -w . | |
12 | hg verify |
|
44 | ||
13 | chmod -r .hg/store/data/a.i |
|
45 | $ hg diff --nodates | |
14 | echo '% hg verify' |
|
46 | diff -r 2a18120dc1c9 a | |
15 | hg verify 2>/dev/null || echo verify failed |
|
47 | --- a/a | |
16 | chmod +r .hg/store/data/a.i |
|
48 | +++ b/a | |
17 | echo '% hg verify' |
|
49 | @@ -1,1 +1,1 @@ | |
18 | hg verify 2>/dev/null || echo verify failed |
|
50 | -foo | |
19 | chmod -w .hg/store/data/a.i |
|
51 | +barber | |
20 | echo barber > a |
|
|||
21 | echo '% hg commit' |
|
|||
22 | hg commit -m "2" 2>/dev/null || echo commit failed |
|
|||
23 | chmod -w . |
|
|||
24 | echo '% hg diff' |
|
|||
25 | hg diff --nodates |
|
|||
26 | chmod +w . |
|
|||
27 |
|
52 | |||
28 | chmod +w .hg/store/data/a.i |
|
53 | $ chmod +w . | |
29 | mkdir dir |
|
54 | ||
30 | touch dir/a |
|
55 | $ chmod +w .hg/store/data/a.i | |
31 | echo '% hg status' |
|
56 | $ mkdir dir | |
32 | hg status |
|
57 | $ touch dir/a | |
33 | chmod -rx dir |
|
58 | $ hg status | |
34 | echo '% hg status' |
|
59 | M a | |
35 | hg status |
|
60 | ? dir/a | |
36 | # reenable perm to allow deletion |
|
61 | $ chmod -rx dir | |
37 | chmod +rx dir |
|
62 | $ hg status | |
|
63 | dir: Permission denied | |||
|
64 | M a | |||
|
65 | ||||
|
66 | Reenable perm to allow deletion: | |||
|
67 | ||||
|
68 | $ chmod +rx dir | |||
|
69 |
@@ -1,75 +1,136 b'' | |||||
1 | #!/bin/sh |
|
1 | $ hg init t | |
|
2 | $ cd t | |||
|
3 | $ echo 1 > foo | |||
|
4 | $ hg ci -Am1 # 0 | |||
|
5 | adding foo | |||
|
6 | $ hg branch branchA | |||
|
7 | marked working directory as branch branchA | |||
|
8 | $ echo a1 > foo | |||
|
9 | $ hg ci -ma1 # 1 | |||
2 |
|
10 | |||
3 | hg init t |
|
11 | $ cd .. | |
4 | cd t |
|
12 | $ hg init tt | |
5 | echo 1 > foo |
|
13 | $ cd tt | |
6 | hg ci -Am1 # 0 |
|
14 | $ hg pull ../t | |
7 | hg branch branchA |
|
15 | pulling from ../t | |
8 | echo a1 > foo |
|
16 | requesting all changes | |
9 | hg ci -ma1 # 1 |
|
17 | adding changesets | |
|
18 | adding manifests | |||
|
19 | adding file changes | |||
|
20 | added 2 changesets with 2 changes to 1 files | |||
|
21 | (run 'hg update' to get a working copy) | |||
|
22 | $ hg up branchA | |||
|
23 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
10 |
|
24 | |||
11 | cd .. |
|
25 | $ cd ../t | |
12 | hg init tt |
|
26 | $ echo a2 > foo | |
13 | cd tt |
|
27 | $ hg ci -ma2 # 2 | |
14 | hg pull ../t |
|
28 | ||
15 | hg up branchA |
|
29 | Create branch B: | |
16 |
|
30 | |||
17 | cd ../t |
|
31 | $ hg up 0 | |
18 | echo a2 > foo |
|
32 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
19 | hg ci -ma2 # 2 |
|
33 | $ hg branch branchB | |
20 | echo % create branch B |
|
34 | marked working directory as branch branchB | |
21 | hg up 0 |
|
35 | $ echo b1 > foo | |
22 | hg branch branchB |
|
36 | $ hg ci -mb1 # 3 | |
23 | echo b1 > foo |
|
37 | ||
24 | hg ci -mb1 # 3 |
|
38 | $ cd ../tt | |
|
39 | ||||
|
40 | A new branch is there | |||
25 |
|
41 | |||
26 | cd ../tt |
|
42 | $ hg pull -u ../t | |
27 | echo % a new branch is there |
|
43 | pulling from ../t | |
28 | hg pull -u ../t |
|
44 | searching for changes | |
|
45 | adding changesets | |||
|
46 | adding manifests | |||
|
47 | adding file changes | |||
|
48 | added 2 changesets with 2 changes to 1 files (+1 heads) | |||
|
49 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
50 | ||||
|
51 | Develop both branches: | |||
29 |
|
52 | |||
30 | echo % develop both branch |
|
53 | $ cd ../t | |
31 | cd ../t |
|
54 | $ hg up branchA | |
32 | hg up branchA |
|
55 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
33 | echo a3 > foo |
|
56 | $ echo a3 > foo | |
34 | hg ci -ma3 # 4 |
|
57 | $ hg ci -ma3 # 4 | |
35 | hg up branchB |
|
58 | $ hg up branchB | |
36 | echo b2 > foo |
|
59 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
37 | hg ci -mb2 # 5 |
|
60 | $ echo b2 > foo | |
|
61 | $ hg ci -mb2 # 5 | |||
|
62 | ||||
|
63 | $ cd ../tt | |||
|
64 | ||||
|
65 | Should succeed, no new heads: | |||
38 |
|
66 | |||
39 | cd ../tt |
|
67 | $ hg pull -u ../t | |
40 | echo % should succeed, no new heads |
|
68 | pulling from ../t | |
41 | hg pull -u ../t |
|
69 | searching for changes | |
|
70 | adding changesets | |||
|
71 | adding manifests | |||
|
72 | adding file changes | |||
|
73 | added 2 changesets with 2 changes to 1 files | |||
|
74 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
75 | ||||
|
76 | Add a head on other branch: | |||
42 |
|
77 | |||
43 | echo % add an head on other branch |
|
78 | $ cd ../t | |
44 | cd ../t |
|
79 | $ hg up branchA | |
45 | hg up branchA |
|
80 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
46 | echo a4 > foo |
|
81 | $ echo a4 > foo | |
47 | hg ci -ma4 # 6 |
|
82 | $ hg ci -ma4 # 6 | |
48 | hg up branchB |
|
83 | $ hg up branchB | |
49 | echo b3.1 > foo |
|
84 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
50 | hg ci -m b3.1 # 7 |
|
85 | $ echo b3.1 > foo | |
51 | hg up 5 |
|
86 | $ hg ci -m b3.1 # 7 | |
52 | echo b3.2 > foo |
|
87 | $ hg up 5 | |
53 | hg ci -m b3.2 # 8 |
|
88 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
89 | $ echo b3.2 > foo | |||
|
90 | $ hg ci -m b3.2 # 8 | |||
|
91 | created new head | |||
|
92 | ||||
|
93 | $ cd ../tt | |||
|
94 | ||||
|
95 | Should succeed because there is only one head on our branch: | |||
54 |
|
96 | |||
55 | cd ../tt |
|
97 | $ hg pull -u ../t | |
56 | echo % should succeed only one head on our branch |
|
98 | pulling from ../t | |
57 | hg pull -u ../t |
|
99 | searching for changes | |
|
100 | adding changesets | |||
|
101 | adding manifests | |||
|
102 | adding file changes | |||
|
103 | added 3 changesets with 3 changes to 1 files (+1 heads) | |||
|
104 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
58 |
|
105 | |||
59 | cd ../t |
|
106 | $ cd ../t | |
60 | hg up -C branchA |
|
107 | $ hg up -C branchA | |
61 | echo a5.1 > foo |
|
108 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
62 | hg ci -ma5.1 # 9 |
|
109 | $ echo a5.1 > foo | |
63 | hg up 6 |
|
110 | $ hg ci -ma5.1 # 9 | |
64 | echo a5.2 > foo |
|
111 | $ hg up 6 | |
65 | hg ci -ma5.2 # 10 |
|
112 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
66 | hg up 7 |
|
113 | $ echo a5.2 > foo | |
67 | echo b4.1 > foo |
|
114 | $ hg ci -ma5.2 # 10 | |
68 | hg ci -m b4.1 # 11 |
|
115 | created new head | |
69 | hg up -C 8 |
|
116 | $ hg up 7 | |
70 | echo b4.2 > foo |
|
117 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
71 | hg ci -m b4.2 # 12 |
|
118 | $ echo b4.1 > foo | |
|
119 | $ hg ci -m b4.1 # 11 | |||
|
120 | $ hg up -C 8 | |||
|
121 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
122 | $ echo b4.2 > foo | |||
|
123 | $ hg ci -m b4.2 # 12 | |||
72 |
|
124 | |||
73 | cd ../tt |
|
125 | $ cd ../tt | |
74 | echo % should fail new head in our branch |
|
126 | ||
75 | hg pull -u ../t |
|
127 | $ hg pull -u ../t | |
|
128 | pulling from ../t | |||
|
129 | searching for changes | |||
|
130 | adding changesets | |||
|
131 | adding manifests | |||
|
132 | adding file changes | |||
|
133 | added 4 changesets with 4 changes to 1 files (+1 heads) | |||
|
134 | not updating, since new heads added | |||
|
135 | (run 'hg heads' to see heads, 'hg merge' to merge) | |||
|
136 |
@@ -1,19 +1,30 b'' | |||||
1 | #!/bin/sh |
|
1 | $ mkdir a | |
|
2 | $ cd a | |||
|
3 | $ hg init | |||
|
4 | $ echo foo > b | |||
|
5 | $ hg add b | |||
|
6 | $ hg ci -m "b" | |||
2 |
|
7 | |||
3 | mkdir a |
|
8 | $ chmod -w .hg/store | |
4 | cd a |
|
9 | ||
5 | hg init |
|
10 | $ cd .. | |
6 | echo foo > b |
|
|||
7 | hg add b |
|
|||
8 | hg ci -m "b" |
|
|||
9 |
|
11 | |||
10 | chmod -w .hg/store |
|
12 | $ hg clone a b | |
11 |
|
13 | requesting all changes | ||
12 | cd .. |
|
14 | adding changesets | |
|
15 | adding manifests | |||
|
16 | adding file changes | |||
|
17 | added 1 changesets with 1 changes to 1 files | |||
|
18 | updating to branch default | |||
|
19 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
13 |
|
20 | |||
14 | hg clone a b |
|
21 | $ chmod +w a/.hg/store # let test clean up | |
15 |
|
22 | |||
16 | chmod +w a/.hg/store # let test clean up |
|
23 | $ cd b | |
|
24 | $ hg verify | |||
|
25 | checking changesets | |||
|
26 | checking manifests | |||
|
27 | crosschecking files in changesets and manifests | |||
|
28 | checking files | |||
|
29 | 1 files, 1 changesets, 1 total revisions | |||
17 |
|
30 | |||
18 | cd b |
|
|||
19 | hg verify |
|
@@ -1,35 +1,71 b'' | |||||
1 | #!/bin/sh |
|
1 | $ hg init repo | |
|
2 | $ cd repo | |||
|
3 | $ echo foo > foo | |||
|
4 | $ hg ci -qAm 'add foo' | |||
|
5 | $ echo >> foo | |||
|
6 | $ hg ci -m 'change foo' | |||
|
7 | $ hg up -qC 0 | |||
|
8 | $ echo bar > bar | |||
|
9 | $ hg ci -qAm 'add bar' | |||
2 |
|
10 | |||
3 | hg init repo |
|
11 | $ hg log | |
4 | cd repo |
|
12 | changeset: 2:effea6de0384 | |
5 | echo foo > foo |
|
13 | tag: tip | |
6 | hg ci -qAm 'add foo' |
|
14 | parent: 0:bbd179dfa0a7 | |
7 | echo >> foo |
|
15 | user: test | |
8 | hg ci -m 'change foo' |
|
16 | date: Thu Jan 01 00:00:00 1970 +0000 | |
9 | hg up -qC 0 |
|
17 | summary: add bar | |
10 | echo bar > bar |
|
18 | ||
11 | hg ci -qAm 'add bar' |
|
19 | changeset: 1:ed1b79f46b9a | |
12 | hg log |
|
20 | user: test | |
13 | cd .. |
|
21 | date: Thu Jan 01 00:00:00 1970 +0000 | |
14 | hg init copy |
|
22 | summary: change foo | |
15 | cd copy |
|
23 | ||
|
24 | changeset: 0:bbd179dfa0a7 | |||
|
25 | user: test | |||
|
26 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
27 | summary: add foo | |||
|
28 | ||||
|
29 | $ cd .. | |||
|
30 | $ hg init copy | |||
|
31 | $ cd copy | |||
|
32 | ||||
|
33 | Pull a missing revision: | |||
16 |
|
34 | |||
17 |
|
|
35 | $ hg pull -qr missing ../repo | |
18 | hg pull -qr missing ../repo |
|
36 | abort: unknown revision 'missing'! | |
|
37 | ||||
|
38 | Pull multiple revisions with update: | |||
19 |
|
39 | |||
20 | echo '% pull multiple revisions with update' |
|
40 | $ hg pull -qu -r 0 -r 1 ../repo | |
21 | hg pull -qu -r 0 -r 1 ../repo |
|
41 | $ hg -q parents | |
22 | hg -q parents |
|
42 | 0:bbd179dfa0a7 | |
23 | hg rollback |
|
43 | $ hg rollback | |
|
44 | rolling back to revision -1 (undo pull) | |||
|
45 | ||||
|
46 | $ hg pull -qr 0 ../repo | |||
|
47 | $ hg log | |||
|
48 | changeset: 0:bbd179dfa0a7 | |||
|
49 | tag: tip | |||
|
50 | user: test | |||
|
51 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
52 | summary: add foo | |||
24 |
|
53 | |||
25 | echo '% pull -r 0' |
|
54 | $ hg pull -qr 1 ../repo | |
26 | hg pull -qr 0 ../repo |
|
55 | $ hg log | |
27 | hg log |
|
56 | changeset: 1:ed1b79f46b9a | |
|
57 | tag: tip | |||
|
58 | user: test | |||
|
59 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
60 | summary: change foo | |||
28 |
|
61 | |||
29 | echo '% pull -r 1' |
|
62 | changeset: 0:bbd179dfa0a7 | |
30 | hg pull -qr 1 ../repo |
|
63 | user: test | |
31 | hg log |
|
64 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
65 | summary: add foo | |||
32 |
|
66 | |||
33 | # this used to abort: received changelog group is empty |
|
67 | ||
34 | echo '% pull -r 1 again' |
|
68 | This used to abort: received changelog group is empty: | |
35 | hg pull -qr 1 ../repo |
|
69 | ||
|
70 | $ hg pull -qr 1 ../repo | |||
|
71 |
@@ -1,29 +1,63 b'' | |||||
1 | #!/bin/sh |
|
1 | $ hg init t | |
2 | # |
|
2 | $ cd t | |
|
3 | $ echo 1 > foo | |||
|
4 | $ hg ci -Am m | |||
|
5 | adding foo | |||
|
6 | ||||
|
7 | $ cd .. | |||
|
8 | $ hg clone t tt | |||
|
9 | updating to branch default | |||
|
10 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
11 | $ cd tt | |||
|
12 | $ echo 1.1 > foo | |||
|
13 | $ hg ci -Am m | |||
3 |
|
14 | |||
4 | hg init t |
|
15 | $ cd ../t | |
5 | cd t |
|
16 | $ echo 1.2 > foo | |
6 | echo 1 > foo |
|
17 | $ hg ci -Am m | |
7 | hg ci -Am m |
|
18 | ||
|
19 | Should not update: | |||
8 |
|
20 | |||
9 | cd .. |
|
21 | $ hg pull -u ../tt | |
10 | hg clone t tt |
|
22 | pulling from ../tt | |
11 | cd tt |
|
23 | searching for changes | |
12 | echo 1.1 > foo |
|
24 | adding changesets | |
13 | hg ci -Am m |
|
25 | adding manifests | |
|
26 | adding file changes | |||
|
27 | added 1 changesets with 1 changes to 1 files (+1 heads) | |||
|
28 | not updating, since new heads added | |||
|
29 | (run 'hg heads' to see heads, 'hg merge' to merge) | |||
|
30 | ||||
|
31 | $ cd ../tt | |||
14 |
|
32 | |||
15 | cd ../t |
|
33 | Should not update: | |
16 | echo 1.2 > foo |
|
34 | ||
17 | hg ci -Am m |
|
35 | $ hg pull -u ../t | |
18 | echo % should fail |
|
36 | pulling from ../t | |
19 | hg pull -u ../tt |
|
37 | searching for changes | |
|
38 | adding changesets | |||
|
39 | adding manifests | |||
|
40 | adding file changes | |||
|
41 | added 1 changesets with 1 changes to 1 files (+1 heads) | |||
|
42 | not updating, since new heads added | |||
|
43 | (run 'hg heads' to see heads, 'hg merge' to merge) | |||
20 |
|
44 | |||
21 | cd ../tt |
|
45 | $ HGMERGE=true hg merge | |
22 | echo % should fail |
|
46 | merging foo | |
23 | hg pull -u ../t |
|
47 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
24 | HGMERGE=true hg merge |
|
48 | (branch merge, don't forget to commit) | |
25 | hg ci -mm |
|
49 | $ hg ci -mm | |
|
50 | ||||
|
51 | $ cd ../t | |||
|
52 | ||||
|
53 | Should work: | |||
26 |
|
54 | |||
27 | cd ../t |
|
55 | $ hg pull -u ../tt | |
28 | echo % should work |
|
56 | pulling from ../tt | |
29 | hg pull -u ../tt |
|
57 | searching for changes | |
|
58 | adding changesets | |||
|
59 | adding manifests | |||
|
60 | adding file changes | |||
|
61 | added 1 changesets with 1 changes to 1 files (-1 heads) | |||
|
62 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
63 |
@@ -1,36 +1,80 b'' | |||||
1 | #!/bin/sh |
|
1 | $ mkdir test | |
|
2 | $ cd test | |||
|
3 | ||||
|
4 | $ echo foo>foo | |||
|
5 | $ hg init | |||
|
6 | $ hg addremove | |||
|
7 | adding foo | |||
|
8 | $ hg commit -m 1 | |||
|
9 | ||||
|
10 | $ hg verify | |||
|
11 | checking changesets | |||
|
12 | checking manifests | |||
|
13 | crosschecking files in changesets and manifests | |||
|
14 | checking files | |||
|
15 | 1 files, 1 changesets, 1 total revisions | |||
2 |
|
16 | |||
3 | mkdir test |
|
17 | $ hg serve -p $HGPORT -d --pid-file=hg.pid | |
4 | cd test |
|
18 | $ cat hg.pid >> $DAEMON_PIDS | |
5 | echo foo>foo |
|
19 | $ cd .. | |
6 | hg init |
|
20 | ||
7 | hg addremove |
|
21 | $ hg clone --pull http://foo:bar@localhost:$HGPORT/ copy | sed -e "s,:$HGPORT/,:\$HGPORT/," | |
8 | hg commit -m 1 |
|
22 | requesting all changes | |
9 | hg verify |
|
23 | adding changesets | |
10 | hg serve -p $HGPORT -d --pid-file=hg.pid |
|
24 | adding manifests | |
11 | cat hg.pid >> $DAEMON_PIDS |
|
25 | adding file changes | |
12 | cd .. |
|
26 | added 1 changesets with 1 changes to 1 files | |
|
27 | updating to branch default | |||
|
28 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
29 | ||||
|
30 | $ cd copy | |||
|
31 | $ hg verify | |||
|
32 | checking changesets | |||
|
33 | checking manifests | |||
|
34 | crosschecking files in changesets and manifests | |||
|
35 | checking files | |||
|
36 | 1 files, 1 changesets, 1 total revisions | |||
13 |
|
37 | |||
14 | hg clone --pull http://foo:bar@localhost:$HGPORT/ copy | sed -e "s,:$HGPORT/,:\$HGPORT/," |
|
38 | $ hg co | |
15 | cd copy |
|
39 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
16 | hg verify |
|
40 | $ cat foo | |
17 | hg co |
|
41 | foo | |
18 | cat foo |
|
42 | ||
19 | hg manifest --debug |
|
43 | $ hg manifest --debug | |
20 | hg pull | sed -e "s,:$HGPORT/,:\$HGPORT/," |
|
44 | 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 foo | |
21 | hg rollback --dry-run --verbose | sed -e "s,:$HGPORT/,:\$HGPORT/," |
|
45 | ||
|
46 | $ hg pull | sed -e "s,:$HGPORT/,:\$HGPORT/," | |||
|
47 | pulling from http://foo:***@localhost:$HGPORT/ | |||
|
48 | searching for changes | |||
|
49 | no changes found | |||
|
50 | ||||
|
51 | $ hg rollback --dry-run --verbose | sed -e "s,:$HGPORT/,:\$HGPORT/," | |||
|
52 | rolling back to revision -1 (undo pull: http://foo:***@localhost:$HGPORT/) | |||
|
53 | ||||
|
54 | Issue 622: | |||
22 |
|
55 | |||
23 | echo % issue 622 |
|
56 | $ cd .. | |
24 | cd .. |
|
57 | $ hg init empty | |
25 | hg init empty |
|
58 | $ cd empty | |
26 | cd empty |
|
59 | $ hg pull -u ../test | |
27 |
|
|
60 | pulling from ../test | |
|
61 | requesting all changes | |||
|
62 | adding changesets | |||
|
63 | adding manifests | |||
|
64 | adding file changes | |||
|
65 | added 1 changesets with 1 changes to 1 files | |||
|
66 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
28 |
|
67 | |||
29 |
|
|
68 | Test 'file:' uri handling: | |
30 | hg pull -q file://../test-doesnt-exist 2>&1 \ |
|
69 | ||
31 | | sed 's%abort: repository.*/test-doesnt-exist%abort: repository /test-doesnt-exist%' |
|
70 | $ hg pull -q file://../test-doesnt-exist | |
32 | hg pull -q file:../test |
|
71 | abort: repository /test-doesnt-exist not found! | |
|
72 | ||||
|
73 | $ hg pull -q file:../test | |||
|
74 | ||||
33 | # It's tricky to make file:// URLs working on every platforms |
|
75 | # It's tricky to make file:// URLs working on every platforms | |
34 | # with regular shell commands. |
|
76 | # with regular shell commands. | |
35 | URL=`python -c "import os; print 'file://foobar' + ('/' + os.getcwd().replace(os.sep, '/')).replace('//', '/') + '/../test'"` |
|
77 | ||
36 | hg pull -q "$URL" |
|
78 | $ URL=`python -c "import os; print 'file://foobar' + ('/' + os.getcwd().replace(os.sep, '/')).replace('//', '/') + '/../test'"` | |
|
79 | $ hg pull -q "$URL" | |||
|
80 |
@@ -1,13 +1,31 b'' | |||||
1 | #!/bin/sh |
|
1 | $ hg init 1 | |
2 | hg init 1 |
|
2 | ||
3 | echo '[ui]' >> 1/.hg/hgrc |
|
3 | $ echo '[ui]' >> 1/.hg/hgrc | |
4 | echo 'timeout = 10' >> 1/.hg/hgrc |
|
4 | $ echo 'timeout = 10' >> 1/.hg/hgrc | |
5 | echo foo > 1/foo |
|
5 | ||
6 | hg --cwd 1 ci -A -m foo |
|
6 | $ echo foo > 1/foo | |
7 | hg clone 1 2 |
|
7 | $ hg --cwd 1 ci -A -m foo | |
8 | hg clone 2 3 |
|
8 | adding foo | |
9 | echo '[hooks]' >> 2/.hg/hgrc |
|
9 | ||
10 | echo 'changegroup.push = hg push -qf ../1' >> 2/.hg/hgrc |
|
10 | $ hg clone 1 2 | |
11 | echo bar >> 3/foo |
|
11 | updating to branch default | |
12 | hg --cwd 3 ci -m bar |
|
12 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
13 | hg --cwd 3 push ../2 |
|
13 | ||
|
14 | $ hg clone 2 3 | |||
|
15 | updating to branch default | |||
|
16 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
17 | ||||
|
18 | $ echo '[hooks]' >> 2/.hg/hgrc | |||
|
19 | $ echo 'changegroup.push = hg push -qf ../1' >> 2/.hg/hgrc | |||
|
20 | ||||
|
21 | $ echo bar >> 3/foo | |||
|
22 | $ hg --cwd 3 ci -m bar | |||
|
23 | ||||
|
24 | $ hg --cwd 3 push ../2 | |||
|
25 | pushing to ../2 | |||
|
26 | searching for changes | |||
|
27 | adding changesets | |||
|
28 | adding manifests | |||
|
29 | adding file changes | |||
|
30 | added 1 changesets with 1 changes to 1 files | |||
|
31 |
@@ -1,61 +1,230 b'' | |||||
1 | #!/bin/sh |
|
1 | $ hg init test | |
|
2 | $ cd test | |||
|
3 | ||||
|
4 | $ cat >>afile <<EOF | |||
|
5 | > 0 | |||
|
6 | > EOF | |||
|
7 | $ hg add afile | |||
|
8 | $ hg commit -m "0.0" | |||
|
9 | ||||
|
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 | |||
|
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 .. | |||
|
94 | ||||
|
95 | $ for i in 0 1 2 3 4 5 6 7 8; do | |||
|
96 | > echo | |||
|
97 | > mkdir test-"$i" | |||
|
98 | > hg --cwd test-"$i" init | |||
|
99 | > hg -R test push -r "$i" test-"$i" | |||
|
100 | > cd test-"$i" | |||
|
101 | > hg verify | |||
|
102 | > cd .. | |||
|
103 | > done | |||
2 |
|
104 | |||
3 | hg init test |
|
105 | pushing to test-0 | |
4 | cd test |
|
106 | searching for changes | |
5 | cat >>afile <<EOF |
|
107 | adding changesets | |
6 | 0 |
|
108 | adding manifests | |
7 | EOF |
|
109 | adding file changes | |
8 | hg add afile |
|
110 | added 1 changesets with 1 changes to 1 files | |
9 | hg commit -m "0.0" |
|
111 | checking changesets | |
10 | cat >>afile <<EOF |
|
112 | checking manifests | |
11 | 1 |
|
113 | crosschecking files in changesets and manifests | |
12 | EOF |
|
114 | checking files | |
13 | hg commit -m "0.1" |
|
115 | 1 files, 1 changesets, 1 total revisions | |
14 | cat >>afile <<EOF |
|
116 | ||
15 | 2 |
|
117 | pushing to test-1 | |
16 | EOF |
|
118 | searching for changes | |
17 | hg commit -m "0.2" |
|
119 | adding changesets | |
18 | cat >>afile <<EOF |
|
120 | adding manifests | |
19 | 3 |
|
121 | adding file changes | |
20 | EOF |
|
122 | added 2 changesets with 2 changes to 1 files | |
21 | hg commit -m "0.3" |
|
123 | checking changesets | |
22 | hg update -C 0 |
|
124 | checking manifests | |
23 | cat >>afile <<EOF |
|
125 | crosschecking files in changesets and manifests | |
24 | 1 |
|
126 | checking files | |
25 | EOF |
|
127 | 1 files, 2 changesets, 2 total revisions | |
26 | hg commit -m "1.1" |
|
128 | ||
27 | cat >>afile <<EOF |
|
129 | pushing to test-2 | |
28 | 2 |
|
130 | searching for changes | |
29 | EOF |
|
131 | adding changesets | |
30 | hg commit -m "1.2" |
|
132 | adding manifests | |
31 | cat >fred <<EOF |
|
133 | adding file changes | |
32 | a line |
|
134 | added 3 changesets with 3 changes to 1 files | |
33 | EOF |
|
135 | checking changesets | |
34 | cat >>afile <<EOF |
|
136 | checking manifests | |
35 | 3 |
|
137 | crosschecking files in changesets and manifests | |
36 | EOF |
|
138 | checking files | |
37 | hg add fred |
|
139 | 1 files, 3 changesets, 3 total revisions | |
38 | hg commit -m "1.3" |
|
140 | ||
39 | hg mv afile adifferentfile |
|
141 | pushing to test-3 | |
40 | hg commit -m "1.3m" |
|
142 | searching for changes | |
41 | hg update -C 3 |
|
143 | adding changesets | |
42 | hg mv afile anotherfile |
|
144 | adding manifests | |
43 | hg commit -m "0.3m" |
|
145 | adding file changes | |
44 | hg debugindex .hg/store/data/afile.i |
|
146 | added 4 changesets with 4 changes to 1 files | |
45 | hg debugindex .hg/store/data/adifferentfile.i |
|
147 | checking changesets | |
46 | hg debugindex .hg/store/data/anotherfile.i |
|
148 | checking manifests | |
47 | hg debugindex .hg/store/data/fred.i |
|
149 | crosschecking files in changesets and manifests | |
48 | hg debugindex .hg/store/00manifest.i |
|
150 | checking files | |
49 | hg verify |
|
151 | 1 files, 4 changesets, 4 total revisions | |
50 | cd .. |
|
152 | ||
51 | for i in 0 1 2 3 4 5 6 7 8; do |
|
153 | pushing to test-4 | |
52 | mkdir test-"$i" |
|
154 | searching for changes | |
53 | hg --cwd test-"$i" init |
|
155 | adding changesets | |
54 | hg -R test push -r "$i" test-"$i" |
|
156 | adding manifests | |
55 | cd test-"$i" |
|
157 | adding file changes | |
56 | hg verify |
|
158 | added 2 changesets with 2 changes to 1 files | |
57 | cd .. |
|
159 | checking changesets | |
58 | done |
|
160 | checking manifests | |
59 | cd test-8 |
|
161 | crosschecking files in changesets and manifests | |
60 | hg pull ../test-7 |
|
162 | checking files | |
61 | hg verify |
|
163 | 1 files, 2 changesets, 2 total revisions | |
|
164 | ||||
|
165 | pushing to test-5 | |||
|
166 | searching for changes | |||
|
167 | adding changesets | |||
|
168 | adding manifests | |||
|
169 | adding file changes | |||
|
170 | added 3 changesets with 3 changes to 1 files | |||
|
171 | checking changesets | |||
|
172 | checking manifests | |||
|
173 | crosschecking files in changesets and manifests | |||
|
174 | checking files | |||
|
175 | 1 files, 3 changesets, 3 total revisions | |||
|
176 | ||||
|
177 | pushing to test-6 | |||
|
178 | searching for changes | |||
|
179 | adding changesets | |||
|
180 | adding manifests | |||
|
181 | adding file changes | |||
|
182 | added 4 changesets with 5 changes to 2 files | |||
|
183 | checking changesets | |||
|
184 | checking manifests | |||
|
185 | crosschecking files in changesets and manifests | |||
|
186 | checking files | |||
|
187 | 2 files, 4 changesets, 5 total revisions | |||
|
188 | ||||
|
189 | pushing to test-7 | |||
|
190 | searching for changes | |||
|
191 | adding changesets | |||
|
192 | adding manifests | |||
|
193 | adding file changes | |||
|
194 | added 5 changesets with 6 changes to 3 files | |||
|
195 | checking changesets | |||
|
196 | checking manifests | |||
|
197 | crosschecking files in changesets and manifests | |||
|
198 | checking files | |||
|
199 | 3 files, 5 changesets, 6 total revisions | |||
|
200 | ||||
|
201 | pushing to test-8 | |||
|
202 | searching for changes | |||
|
203 | adding changesets | |||
|
204 | adding manifests | |||
|
205 | adding file changes | |||
|
206 | added 5 changesets with 5 changes to 2 files | |||
|
207 | checking changesets | |||
|
208 | checking manifests | |||
|
209 | crosschecking files in changesets and manifests | |||
|
210 | checking files | |||
|
211 | 2 files, 5 changesets, 5 total revisions | |||
|
212 | ||||
|
213 | $ cd test-8 | |||
|
214 | ||||
|
215 | $ hg pull ../test-7 | |||
|
216 | pulling from ../test-7 | |||
|
217 | searching for changes | |||
|
218 | adding changesets | |||
|
219 | adding manifests | |||
|
220 | adding file changes | |||
|
221 | added 4 changesets with 2 changes to 3 files (+1 heads) | |||
|
222 | (run 'hg heads' to see heads, 'hg merge' to merge) | |||
|
223 | ||||
|
224 | $ hg verify | |||
|
225 | checking changesets | |||
|
226 | checking manifests | |||
|
227 | crosschecking files in changesets and manifests | |||
|
228 | checking files | |||
|
229 | 4 files, 9 changesets, 7 total revisions | |||
|
230 |
@@ -1,22 +1,52 b'' | |||||
1 | #!/bin/sh |
|
1 | $ hg init test | |
|
2 | $ cd test | |||
|
3 | ||||
|
4 | $ cat > .hg/hgrc <<EOF | |||
|
5 | > [server] | |||
|
6 | > validate=1 | |||
|
7 | > EOF | |||
|
8 | ||||
|
9 | $ echo alpha > alpha | |||
|
10 | $ echo beta > beta | |||
|
11 | $ hg addr | |||
|
12 | adding alpha | |||
|
13 | adding beta | |||
|
14 | $ hg ci -m 1 | |||
|
15 | ||||
|
16 | $ cd .. | |||
|
17 | $ hg clone test test-clone | |||
|
18 | updating to branch default | |||
|
19 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
20 | ||||
|
21 | $ cd test-clone | |||
|
22 | $ cp .hg/store/data/beta.i tmp | |||
|
23 | $ echo blah >> beta | |||
|
24 | $ hg ci -m '2 (corrupt)' | |||
|
25 | $ mv tmp .hg/store/data/beta.i | |||
2 |
|
26 | |||
3 | hg init test |
|
27 | Expected to fail: | |
4 | cd test |
|
28 | ||
5 | cat > .hg/hgrc <<EOF |
|
29 | $ hg verify | |
6 | [server] |
|
30 | checking changesets | |
7 | validate=1 |
|
31 | checking manifests | |
8 | EOF |
|
32 | crosschecking files in changesets and manifests | |
9 | echo alpha > alpha |
|
33 | checking files | |
10 | echo beta > beta |
|
34 | beta@1: dddc47b3ba30 in manifests not found | |
11 | hg addr |
|
35 | 2 files, 2 changesets, 2 total revisions | |
12 | hg ci -m 1 |
|
36 | 1 integrity errors encountered! | |
|
37 | (first damaged changeset appears to be 1) | |||
13 |
|
38 | |||
14 | cd .. |
|
39 | Expected to fail: | |
15 | hg clone test test-clone |
|
|||
16 |
|
40 | |||
17 | cd test-clone |
|
41 | $ hg push | |
18 | cp .hg/store/data/beta.i tmp |
|
42 | pushing to .* | |
19 | echo blah >> beta |
|
43 | searching for changes | |
20 | hg ci -m '2 (corrupt)' |
|
44 | adding changesets | |
21 | mv tmp .hg/store/data/beta.i |
|
45 | adding manifests | |
22 | hg push 2>&1 | "$TESTDIR/filtertmp.py" |
|
46 | adding file changes | |
|
47 | transaction abort! | |||
|
48 | rollback completed | |||
|
49 | abort: missing file data for beta:dddc47b3ba30e54484720ce0f4f768a0f4b6efb9 - run hg verify | |||
|
50 | ||||
|
51 | $ true | |||
|
52 |
This diff has been collapsed as it changes many lines, (934 lines changed) Show them Hide them | |||||
@@ -1,317 +1,701 b'' | |||||
1 | #!/bin/sh |
|
1 | $ echo "[extensions]" >> $HGRCPATH | |
|
2 | $ echo "graphlog=" >> $HGRCPATH | |||
2 |
|
3 | |||
3 | echo "[extensions]" >> $HGRCPATH |
|
4 | $ mkdir a | |
4 | echo "graphlog=" >> $HGRCPATH |
|
5 | $ cd a | |
|
6 | $ hg init | |||
|
7 | $ echo foo > t1 | |||
|
8 | $ hg add t1 | |||
|
9 | $ hg commit -m "1" | |||
5 |
|
10 | |||
6 | mkdir a |
|
11 | $ cd .. | |
7 | cd a |
|
12 | $ hg clone a b | |
8 | hg init |
|
13 | updating to branch default | |
9 | echo foo > t1 |
|
14 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
10 | hg add t1 |
|
15 | ||
11 | hg commit -m "1" |
|
16 | $ cd a | |
|
17 | $ echo foo > t2 | |||
|
18 | $ hg add t2 | |||
|
19 | $ hg commit -m "2" | |||
|
20 | ||||
|
21 | $ cd ../b | |||
|
22 | $ echo foo > t3 | |||
|
23 | $ hg add t3 | |||
|
24 | $ hg commit -m "3" | |||
12 |
|
25 | |||
13 | cd .. |
|
26 | $ hg push ../a | |
14 | hg clone a b |
|
27 | pushing to ../a | |
|
28 | searching for changes | |||
|
29 | abort: push creates new remote heads on branch 'default'! | |||
|
30 | (you should pull and merge or use push -f to force) | |||
15 |
|
31 | |||
16 | cd a |
|
32 | $ hg pull ../a | |
17 | echo foo > t2 |
|
33 | pulling from ../a | |
18 | hg add t2 |
|
34 | searching for changes | |
19 | hg commit -m "2" |
|
35 | adding changesets | |
|
36 | adding manifests | |||
|
37 | adding file changes | |||
|
38 | added 1 changesets with 1 changes to 1 files (+1 heads) | |||
|
39 | (run 'hg heads' to see heads, 'hg merge' to merge) | |||
20 |
|
40 | |||
21 | cd ../b |
|
41 | $ hg push ../a | |
22 | echo foo > t3 |
|
42 | pushing to ../a | |
23 | hg add t3 |
|
43 | searching for changes | |
24 | hg commit -m "3" |
|
44 | abort: push creates new remote heads on branch 'default'! | |
|
45 | (did you forget to merge? use push -f to force) | |||
|
46 | ||||
|
47 | $ hg merge | |||
|
48 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
49 | (branch merge, don't forget to commit) | |||
25 |
|
50 | |||
26 | hg push ../a |
|
51 | $ hg commit -m "4" | |
27 |
|
|
52 | $ hg push ../a | |
28 |
|
|
53 | pushing to ../a | |
29 | hg merge |
|
54 | searching for changes | |
30 | hg commit -m "4" |
|
55 | adding changesets | |
31 | hg push ../a |
|
56 | adding manifests | |
32 | cd .. |
|
57 | adding file changes | |
|
58 | added 2 changesets with 1 changes to 1 files | |||
|
59 | ||||
|
60 | $ cd .. | |||
|
61 | ||||
|
62 | $ hg init c | |||
|
63 | $ cd c | |||
|
64 | $ for i in 0 1 2; do | |||
|
65 | > echo $i >> foo | |||
|
66 | > hg ci -Am $i | |||
|
67 | > done | |||
|
68 | adding foo | |||
|
69 | $ cd .. | |||
|
70 | ||||
|
71 | $ hg clone c d | |||
|
72 | updating to branch default | |||
|
73 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
33 |
|
74 | |||
34 | hg init c |
|
75 | $ cd d | |
35 | cd c |
|
76 | $ for i in 0 1; do | |
36 | for i in 0 1 2; do |
|
77 | > hg co -C $i | |
37 | echo $i >> foo |
|
78 | > echo d-$i >> foo | |
38 |
hg ci - |
|
79 | > hg ci -m d-$i | |
39 | done |
|
80 | > done | |
40 | cd .. |
|
81 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
82 | created new head | |||
|
83 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
84 | created new head | |||
|
85 | ||||
|
86 | $ HGMERGE=true hg merge 3 | |||
|
87 | merging foo | |||
|
88 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |||
|
89 | (branch merge, don't forget to commit) | |||
|
90 | ||||
|
91 | $ hg ci -m c-d | |||
41 |
|
92 | |||
42 | hg clone c d |
|
93 | $ hg push ../c; echo $? | |
43 | cd d |
|
94 | pushing to ../c | |
44 | for i in 0 1; do |
|
95 | searching for changes | |
45 | hg co -C $i |
|
96 | abort: push creates new remote heads on branch 'default'! | |
46 | echo d-$i >> foo |
|
97 | (did you forget to merge? use push -f to force) | |
47 | hg ci -m d-$i |
|
98 | 255 | |
48 | done |
|
|||
49 |
|
99 | |||
50 | HGMERGE=true hg merge 3 |
|
100 | $ hg push -r 2 ../c; echo $? | |
51 | hg ci -m c-d |
|
101 | pushing to ../c | |
|
102 | searching for changes | |||
|
103 | no changes found | |||
|
104 | 0 | |||
|
105 | ||||
|
106 | $ hg push -r 3 ../c; echo $? | |||
|
107 | pushing to ../c | |||
|
108 | searching for changes | |||
|
109 | abort: push creates new remote heads on branch 'default'! | |||
|
110 | (did you forget to merge? use push -f to force) | |||
|
111 | 255 | |||
52 |
|
112 | |||
53 | hg push ../c; echo $? |
|
113 | $ hg push -r 3 -r 4 ../c; echo $? | |
54 | hg push -r 2 ../c; echo $? |
|
114 | pushing to ../c | |
55 | hg push -r 3 ../c; echo $? |
|
115 | searching for changes | |
56 | hg push -r 3 -r 4 ../c; echo $? |
|
116 | abort: push creates new remote heads on branch 'default'! | |
57 | hg push -f -r 3 -r 4 ../c; echo $? |
|
117 | (did you forget to merge? use push -f to force) | |
58 | hg push -r 5 ../c; echo $? |
|
118 | 255 | |
59 | hg in ../c |
|
119 | ||
|
120 | $ hg push -f -r 3 -r 4 ../c; echo $? | |||
|
121 | pushing to ../c | |||
|
122 | searching for changes | |||
|
123 | adding changesets | |||
|
124 | adding manifests | |||
|
125 | adding file changes | |||
|
126 | added 2 changesets with 2 changes to 1 files (+2 heads) | |||
|
127 | 0 | |||
|
128 | ||||
|
129 | $ hg push -r 5 ../c; echo $? | |||
|
130 | pushing to ../c | |||
|
131 | searching for changes | |||
|
132 | adding changesets | |||
|
133 | adding manifests | |||
|
134 | adding file changes | |||
|
135 | added 1 changesets with 1 changes to 1 files (-1 heads) | |||
|
136 | 0 | |||
60 |
|
137 | |||
61 | echo % issue 450 |
|
138 | $ hg in ../c | |
62 | hg init ../e |
|
139 | comparing with ../c | |
63 | hg push -r 0 ../e ; echo $? |
|
140 | searching for changes | |
64 | hg push -r 1 ../e ; echo $? |
|
141 | no changes found | |
|
142 | ||||
|
143 | ||||
|
144 | Issue 450: | |||
65 |
|
145 | |||
66 | cd .. |
|
146 | $ hg init ../e | |
|
147 | $ hg push -r 0 ../e ; echo $? | |||
|
148 | pushing to ../e | |||
|
149 | searching for changes | |||
|
150 | adding changesets | |||
|
151 | adding manifests | |||
|
152 | adding file changes | |||
|
153 | added 1 changesets with 1 changes to 1 files | |||
|
154 | 0 | |||
|
155 | ||||
|
156 | $ hg push -r 1 ../e ; echo $? | |||
|
157 | pushing to ../e | |||
|
158 | searching for changes | |||
|
159 | adding changesets | |||
|
160 | adding manifests | |||
|
161 | adding file changes | |||
|
162 | added 1 changesets with 1 changes to 1 files | |||
|
163 | 0 | |||
|
164 | ||||
|
165 | $ cd .. | |||
|
166 | ||||
|
167 | ||||
|
168 | Issue 736: | |||
67 |
|
169 | |||
68 | echo % issue 736 |
|
170 | $ hg init f | |
69 | hg init f |
|
171 | $ cd f | |
70 | cd f |
|
172 | $ hg -q branch a | |
71 | hg -q branch a |
|
173 | $ echo 0 > foo | |
72 | echo 0 > foo |
|
174 | $ hg -q ci -Am 0 | |
73 | hg -q ci -Am 0 |
|
175 | $ echo 1 > foo | |
74 | echo 1 > foo |
|
176 | $ hg -q ci -m 1 | |
75 | hg -q ci -m 1 |
|
177 | $ hg -q up 0 | |
76 | hg -q up 0 |
|
178 | $ echo 2 > foo | |
77 | echo 2 > foo |
|
179 | $ hg -q ci -m 2 | |
78 | hg -q ci -m 2 |
|
180 | $ hg -q up 0 | |
79 | hg -q up 0 |
|
181 | $ hg -q branch b | |
80 | hg -q branch b |
|
182 | $ echo 3 > foo | |
81 | echo 3 > foo |
|
183 | $ hg -q ci -m 3 | |
82 | hg -q ci -m 3 |
|
184 | $ cd .. | |
83 | cd .. |
|
185 | ||
|
186 | $ hg -q clone f g | |||
|
187 | $ cd g | |||
|
188 | ||||
|
189 | Push on existing branch and new branch: | |||
84 |
|
190 | |||
85 | hg -q clone f g |
|
191 | $ hg -q up 1 | |
86 | cd g |
|
192 | $ echo 4 > foo | |
|
193 | $ hg -q ci -m 4 | |||
|
194 | $ hg -q up 0 | |||
|
195 | $ echo 5 > foo | |||
|
196 | $ hg -q branch c | |||
|
197 | $ hg -q ci -m 5 | |||
|
198 | ||||
|
199 | $ hg push ../f; echo $? | |||
|
200 | pushing to ../f | |||
|
201 | searching for changes | |||
|
202 | abort: push creates new remote branches: c! | |||
|
203 | (use 'hg push --new-branch' to create new remote branches) | |||
|
204 | 255 | |||
87 |
|
205 | |||
88 | echo % push on existing branch and new branch |
|
206 | $ hg push -r 4 -r 5 ../f; echo $? | |
89 | hg -q up 1 |
|
207 | pushing to ../f | |
90 | echo 4 > foo |
|
208 | searching for changes | |
91 | hg -q ci -m 4 |
|
209 | abort: push creates new remote branches: c! | |
92 | hg -q up 0 |
|
210 | (use 'hg push --new-branch' to create new remote branches) | |
93 | echo 5 > foo |
|
211 | 255 | |
94 | hg -q branch c |
|
212 | ||
95 | hg -q ci -m 5 |
|
213 | ||
96 | hg push ../f; echo $? |
|
214 | Multiple new branches: | |
97 | hg push -r 4 -r 5 ../f; echo $? |
|
|||
98 |
|
215 | |||
99 | echo % multiple new branches |
|
216 | $ hg -q branch d | |
100 | hg -q branch d |
|
217 | $ echo 6 > foo | |
101 | echo 6 > foo |
|
218 | $ hg -q ci -m 6 | |
102 | hg -q ci -m 6 |
|
219 | ||
103 | hg push ../f; echo $? |
|
220 | $ hg push ../f; echo $? | |
104 | hg push -r 4 -r 6 ../f; echo $? |
|
221 | pushing to ../f | |
105 | cd ../g |
|
222 | searching for changes | |
|
223 | abort: push creates new remote branches: c, d! | |||
|
224 | (use 'hg push --new-branch' to create new remote branches) | |||
|
225 | 255 | |||
106 |
|
226 | |||
107 | echo % fail on multiple head push |
|
227 | $ hg push -r 4 -r 6 ../f; echo $? | |
108 | hg -q up 1 |
|
228 | pushing to ../f | |
109 | echo 7 > foo |
|
229 | searching for changes | |
110 | hg -q ci -m 7 |
|
230 | abort: push creates new remote branches: c, d! | |
111 | hg push -r 4 -r 7 ../f; echo $? |
|
231 | (use 'hg push --new-branch' to create new remote branches) | |
|
232 | 255 | |||
|
233 | ||||
|
234 | $ cd ../g | |||
|
235 | ||||
|
236 | ||||
|
237 | Fail on multiple head push: | |||
|
238 | ||||
|
239 | $ hg -q up 1 | |||
|
240 | $ echo 7 > foo | |||
|
241 | $ hg -q ci -m 7 | |||
|
242 | ||||
|
243 | $ hg push -r 4 -r 7 ../f; echo $? | |||
|
244 | pushing to ../f | |||
|
245 | searching for changes | |||
|
246 | abort: push creates new remote heads on branch 'a'! | |||
|
247 | (did you forget to merge? use push -f to force) | |||
|
248 | 255 | |||
|
249 | ||||
|
250 | Push replacement head on existing branches: | |||
|
251 | ||||
|
252 | $ hg -q up 3 | |||
|
253 | $ echo 8 > foo | |||
|
254 | $ hg -q ci -m 8 | |||
112 |
|
255 | |||
113 | echo % push replacement head on existing branches |
|
256 | $ hg push -r 7 -r 8 ../f; echo $? | |
114 | hg -q up 3 |
|
257 | pushing to ../f | |
115 | echo 8 > foo |
|
258 | searching for changes | |
116 | hg -q ci -m 8 |
|
259 | adding changesets | |
117 | hg push -r 7 -r 8 ../f; echo $? |
|
260 | adding manifests | |
|
261 | adding file changes | |||
|
262 | added 2 changesets with 2 changes to 1 files | |||
|
263 | 0 | |||
|
264 | ||||
|
265 | ||||
|
266 | Merge of branch a to other branch b followed by unrelated push | |||
|
267 | on branch a: | |||
|
268 | ||||
|
269 | $ hg -q up 7 | |||
|
270 | $ HGMERGE=true hg -q merge 8 | |||
|
271 | $ hg -q ci -m 9 | |||
|
272 | $ hg -q up 8 | |||
|
273 | $ echo 10 > foo | |||
|
274 | $ hg -q ci -m 10 | |||
|
275 | ||||
|
276 | $ hg push -r 9 ../f; echo $? | |||
|
277 | pushing to ../f | |||
|
278 | searching for changes | |||
|
279 | adding changesets | |||
|
280 | adding manifests | |||
|
281 | adding file changes | |||
|
282 | added 1 changesets with 1 changes to 1 files (-1 heads) | |||
|
283 | 0 | |||
118 |
|
284 | |||
119 | echo % merge of branch a to other branch b followed by unrelated push on branch a |
|
285 | $ hg push -r 10 ../f; echo $? | |
120 | hg -q up 7 |
|
286 | pushing to ../f | |
121 | HGMERGE=true hg -q merge 8 |
|
287 | searching for changes | |
122 | hg -q ci -m 9 |
|
288 | adding changesets | |
123 | hg -q up 8 |
|
289 | adding manifests | |
124 | echo 10 > foo |
|
290 | adding file changes | |
125 | hg -q ci -m 10 |
|
291 | added 1 changesets with 1 changes to 1 files (+1 heads) | |
126 | hg push -r 9 ../f; echo $? |
|
292 | 0 | |
127 | hg push -r 10 ../f; echo $? |
|
293 | ||
|
294 | ||||
|
295 | Cheating the counting algorithm: | |||
|
296 | ||||
|
297 | $ hg -q up 9 | |||
|
298 | $ HGMERGE=true hg -q merge 2 | |||
|
299 | $ hg -q ci -m 11 | |||
|
300 | $ hg -q up 1 | |||
|
301 | $ echo 12 > foo | |||
|
302 | $ hg -q ci -m 12 | |||
|
303 | ||||
|
304 | $ hg push -r 11 -r 12 ../f; echo $? | |||
|
305 | pushing to ../f | |||
|
306 | searching for changes | |||
|
307 | adding changesets | |||
|
308 | adding manifests | |||
|
309 | adding file changes | |||
|
310 | added 2 changesets with 2 changes to 1 files | |||
|
311 | 0 | |||
|
312 | ||||
128 |
|
313 | |||
129 | echo % cheating the counting algorithm |
|
314 | Failed push of new named branch: | |
130 | hg -q up 9 |
|
315 | ||
131 | HGMERGE=true hg -q merge 2 |
|
316 | $ echo 12 > foo | |
132 |
hg -q ci -m 1 |
|
317 | $ hg -q ci -m 12a | |
133 | hg -q up 1 |
|
318 | $ hg -q up 11 | |
134 |
echo 1 |
|
319 | $ echo 13 > foo | |
135 | hg -q ci -m 12 |
|
320 | $ hg -q branch e | |
136 | hg push -r 11 -r 12 ../f; echo $? |
|
321 | $ hg -q ci -m 13d | |
137 |
|
322 | |||
138 | echo % failed push of new named branch |
|
323 | $ hg push -r 12 -r 13 ../f; echo $? | |
139 | echo 12 > foo |
|
324 | pushing to ../f | |
140 | hg -q ci -m 12a |
|
325 | searching for changes | |
141 | hg -q up 11 |
|
326 | abort: push creates new remote branches: e! | |
142 | echo 13 > foo |
|
327 | (use 'hg push --new-branch' to create new remote branches) | |
143 | hg -q branch e |
|
328 | 255 | |
144 | hg -q ci -m 13d |
|
329 | ||
145 | hg push -r 12 -r 13 ../f; echo $? |
|
330 | ||
|
331 | Using --new-branch to push new named branch: | |||
146 |
|
332 | |||
147 | echo % using --new-branch to push new named branch |
|
333 | $ hg push --new-branch -r 12 -r 13 ../f; echo $? | |
148 | hg push --new-branch -r 12 -r 13 ../f; echo $? |
|
334 | pushing to ../f | |
|
335 | searching for changes | |||
|
336 | adding changesets | |||
|
337 | adding manifests | |||
|
338 | adding file changes | |||
|
339 | added 1 changesets with 1 changes to 1 files | |||
|
340 | 0 | |||
|
341 | ||||
149 |
|
342 | |||
150 |
|
|
343 | Checking prepush logic does not allow silently pushing | |
151 | cd .. |
|
344 | multiple new heads: | |
152 | hg init h |
|
345 | ||
153 | echo init > h/init |
|
346 | $ cd .. | |
154 | hg -R h ci -Am init |
|
347 | $ hg init h | |
155 | echo a > h/a |
|
348 | $ echo init > h/init | |
156 |
hg -R h ci -Am |
|
349 | $ hg -R h ci -Am init | |
157 | hg clone h i |
|
350 | adding init | |
158 | hg -R h up 0 |
|
351 | $ echo a > h/a | |
159 | echo b > h/b |
|
352 | $ hg -R h ci -Am a | |
160 | hg -R h ci -Am b |
|
353 | adding a | |
161 | hg -R i up 0 |
|
354 | $ hg clone h i | |
162 | echo c > i/c |
|
355 | updating to branch default | |
163 | hg -R i ci -Am c |
|
356 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
164 | hg -R i push h |
|
357 | $ hg -R h up 0 | |
165 | echo |
|
358 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
|
359 | $ echo b > h/b | |||
|
360 | $ hg -R h ci -Am b | |||
|
361 | adding b | |||
|
362 | created new head | |||
|
363 | $ hg -R i up 0 | |||
|
364 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||
|
365 | $ echo c > i/c | |||
|
366 | $ hg -R i ci -Am c | |||
|
367 | adding c | |||
|
368 | created new head | |||
166 |
|
369 | |||
167 | echo % check prepush logic with merged branches |
|
370 | $ hg -R i push h | |
168 | hg init j |
|
371 | pushing to h | |
169 | hg -R j branch a |
|
372 | searching for changes | |
170 | echo init > j/foo |
|
373 | abort: push creates new remote heads on branch 'default'! | |
171 | hg -R j ci -Am init |
|
374 | (you should pull and merge or use push -f to force) | |
172 | hg clone j k |
|
375 | ||
173 | echo a1 > j/foo |
|
376 | ||
174 | hg -R j ci -m a1 |
|
377 | Check prepush logic with merged branches: | |
175 | hg -R k branch b |
|
378 | ||
176 | echo b > k/foo |
|
379 | $ hg init j | |
177 | hg -R k ci -m b |
|
380 | $ hg -R j branch a | |
178 | hg -R k up 0 |
|
381 | marked working directory as branch a | |
179 | hg -R k merge b |
|
382 | $ echo init > j/foo | |
180 |
hg -R |
|
383 | $ hg -R j ci -Am init | |
181 | hg -R k push -r a j |
|
384 | adding foo | |
182 | echo |
|
385 | $ hg clone j k | |
|
386 | updating to branch a | |||
|
387 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
388 | $ echo a1 > j/foo | |||
|
389 | $ hg -R j ci -m a1 | |||
|
390 | $ hg -R k branch b | |||
|
391 | marked working directory as branch b | |||
|
392 | $ echo b > k/foo | |||
|
393 | $ hg -R k ci -m b | |||
|
394 | $ hg -R k up 0 | |||
|
395 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
396 | ||||
|
397 | $ hg -R k merge b | |||
|
398 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
399 | (branch merge, don't forget to commit) | |||
|
400 | ||||
|
401 | $ hg -R k ci -m merge | |||
183 |
|
402 | |||
184 | echo % prepush -r should not allow you to sneak in new heads |
|
403 | $ hg -R k push -r a j | |
185 | hg init l |
|
404 | pushing to j | |
186 | cd l |
|
405 | searching for changes | |
187 | echo a >> foo |
|
406 | abort: push creates new remote branches: b! | |
188 | hg -q add foo |
|
407 | (use 'hg push --new-branch' to create new remote branches) | |
189 | hg -q branch a |
|
408 | ||
190 | hg -q ci -ma |
|
409 | ||
191 | hg -q up null |
|
410 | Prepush -r should not allow you to sneak in new heads: | |
192 | echo a >> foo |
|
|||
193 | hg -q add foo |
|
|||
194 | hg -q branch b |
|
|||
195 | hg -q ci -mb |
|
|||
196 | cd .. |
|
|||
197 | hg -q clone l m -u a |
|
|||
198 | cd m |
|
|||
199 | hg -q merge b |
|
|||
200 | hg -q ci -mmb |
|
|||
201 | hg -q up 0 |
|
|||
202 | echo a >> foo |
|
|||
203 | hg -q ci -ma2 |
|
|||
204 | hg -q up 2 |
|
|||
205 | echo a >> foo |
|
|||
206 | hg -q branch -f b |
|
|||
207 | hg -q ci -mb2 |
|
|||
208 | hg -q merge 3 |
|
|||
209 | hg -q ci -mma |
|
|||
210 | hg push ../l -b b |
|
|||
211 | cd .. |
|
|||
212 |
|
411 | |||
213 | echo % check prepush with new branch head on former topo non-head |
|
412 | $ hg init l | |
214 | hg init n |
|
413 | $ cd l | |
215 | cd n |
|
414 | $ echo a >> foo | |
216 | hg branch A |
|
415 | $ hg -q add foo | |
217 | echo a >a |
|
416 | $ hg -q branch a | |
218 |
hg ci - |
|
417 | $ hg -q ci -ma | |
219 | hg branch B |
|
418 | $ hg -q up null | |
220 | echo b >b |
|
419 | $ echo a >> foo | |
221 | hg ci -Amb |
|
420 | $ hg -q add foo | |
|
421 | $ hg -q branch b | |||
|
422 | $ hg -q ci -mb | |||
|
423 | $ cd .. | |||
|
424 | $ hg -q clone l m -u a | |||
|
425 | $ cd m | |||
|
426 | $ hg -q merge b | |||
|
427 | $ hg -q ci -mmb | |||
|
428 | $ hg -q up 0 | |||
|
429 | $ echo a >> foo | |||
|
430 | $ hg -q ci -ma2 | |||
|
431 | $ hg -q up 2 | |||
|
432 | $ echo a >> foo | |||
|
433 | $ hg -q branch -f b | |||
|
434 | $ hg -q ci -mb2 | |||
|
435 | $ hg -q merge 3 | |||
|
436 | $ hg -q ci -mma | |||
|
437 | ||||
|
438 | $ hg push ../l -b b | |||
|
439 | pushing to ../l | |||
|
440 | searching for changes | |||
|
441 | abort: push creates new remote heads on branch 'a'! | |||
|
442 | (did you forget to merge? use push -f to force) | |||
|
443 | ||||
|
444 | $ cd .. | |||
|
445 | ||||
|
446 | ||||
|
447 | Check prepush with new branch head on former topo non-head: | |||
|
448 | ||||
|
449 | $ hg init n | |||
|
450 | $ cd n | |||
|
451 | $ hg branch A | |||
|
452 | marked working directory as branch A | |||
|
453 | $ echo a >a | |||
|
454 | $ hg ci -Ama | |||
|
455 | adding a | |||
|
456 | $ hg branch B | |||
|
457 | marked working directory as branch B | |||
|
458 | $ echo b >b | |||
|
459 | $ hg ci -Amb | |||
|
460 | adding b | |||
|
461 | ||||
222 | # b is now branch head of B, and a topological head |
|
462 | # b is now branch head of B, and a topological head | |
223 | # a is now branch head of A, but not a topological head |
|
463 | # a is now branch head of A, but not a topological head | |
224 | hg clone . inner |
|
464 | ||
225 | cd inner |
|
465 | $ hg clone . inner | |
226 | hg up B |
|
466 | updating to branch B | |
227 | echo b1 >b1 |
|
467 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
228 | hg ci -Amb1 |
|
468 | $ cd inner | |
|
469 | $ hg up B | |||
|
470 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
471 | $ echo b1 >b1 | |||
|
472 | $ hg ci -Amb1 | |||
|
473 | adding b1 | |||
|
474 | ||||
229 | # in the clone b1 is now the head of B |
|
475 | # in the clone b1 is now the head of B | |
230 | cd .. |
|
476 | ||
231 | hg up 0 |
|
477 | $ cd .. | |
232 | echo a2 >a2 |
|
478 | $ hg up 0 | |
233 | hg ci -Ama2 |
|
479 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
|
480 | $ echo a2 >a2 | |||
|
481 | $ hg ci -Ama2 | |||
|
482 | adding a2 | |||
|
483 | ||||
234 | # a2 is now the new branch head of A, and a new topological head |
|
484 | # a2 is now the new branch head of A, and a new topological head | |
235 | # it replaces a former inner branch head, so it should at most warn about A, not B |
|
485 | # it replaces a former inner branch head, so it should at most warn about A, not B | |
236 | echo %% glog of local |
|
486 | ||
237 | hg glog --template "{rev}: {branches} {desc}\n" |
|
487 | glog of local: | |
238 | echo %% glog of remote |
|
488 | ||
239 |
hg glog |
|
489 | $ hg glog --template "{rev}: {branches} {desc}\n" | |
240 | echo %% outgoing |
|
490 | @ 2: A a2 | |
241 | hg out inner --template "{rev}: {branches} {desc}\n" |
|
491 | | | |
242 | hg push inner |
|
492 | | o 1: B b | |
243 | cd .. |
|
493 | |/ | |
|
494 | o 0: A a | |||
|
495 | ||||
|
496 | glog of remote: | |||
|
497 | ||||
|
498 | $ hg glog -R inner --template "{rev}: {branches} {desc}\n" | |||
|
499 | @ 2: B b1 | |||
|
500 | | | |||
|
501 | o 1: B b | |||
|
502 | | | |||
|
503 | o 0: A a | |||
|
504 | ||||
|
505 | outgoing: | |||
|
506 | ||||
|
507 | $ hg out inner --template "{rev}: {branches} {desc}\n" | |||
|
508 | comparing with inner | |||
|
509 | searching for changes | |||
|
510 | 2: A a2 | |||
|
511 | ||||
|
512 | $ hg push inner | |||
|
513 | pushing to inner | |||
|
514 | searching for changes | |||
|
515 | adding changesets | |||
|
516 | adding manifests | |||
|
517 | adding file changes | |||
|
518 | added 1 changesets with 1 changes to 1 files (+1 heads) | |||
|
519 | ||||
|
520 | $ cd .. | |||
|
521 | ||||
|
522 | ||||
|
523 | Check prepush with new branch head on former topo head: | |||
244 |
|
524 | |||
245 | echo % check prepush with new branch head on former topo head |
|
525 | $ hg init o | |
246 | hg init o |
|
526 | $ cd o | |
247 | cd o |
|
527 | $ hg branch A | |
248 | hg branch A |
|
528 | marked working directory as branch A | |
249 | echo a >a |
|
529 | $ echo a >a | |
250 | hg ci -Ama |
|
530 | $ hg ci -Ama | |
251 | hg branch B |
|
531 | adding a | |
252 | echo b >b |
|
532 | $ hg branch B | |
253 | hg ci -Amb |
|
533 | marked working directory as branch B | |
|
534 | $ echo b >b | |||
|
535 | $ hg ci -Amb | |||
|
536 | adding b | |||
|
537 | ||||
254 | # b is now branch head of B, and a topological head |
|
538 | # b is now branch head of B, and a topological head | |
255 | hg up 0 |
|
539 | ||
256 | echo a1 >a1 |
|
540 | $ hg up 0 | |
257 | hg ci -Ama1 |
|
541 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
|
542 | $ echo a1 >a1 | |||
|
543 | $ hg ci -Ama1 | |||
|
544 | adding a1 | |||
|
545 | ||||
258 | # a1 is now branch head of A, and a topological head |
|
546 | # a1 is now branch head of A, and a topological head | |
259 | hg clone . inner |
|
547 | ||
260 | cd inner |
|
548 | $ hg clone . inner | |
261 | hg up B |
|
549 | updating to branch A | |
262 | echo b1 >b1 |
|
550 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
263 | hg ci -Amb1 |
|
551 | $ cd inner | |
|
552 | $ hg up B | |||
|
553 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||
|
554 | $ echo b1 >b1 | |||
|
555 | $ hg ci -Amb1 | |||
|
556 | adding b1 | |||
|
557 | ||||
264 | # in the clone b1 is now the head of B |
|
558 | # in the clone b1 is now the head of B | |
265 | cd .. |
|
559 | ||
266 | echo a2 >a2 |
|
560 | $ cd .. | |
267 | hg ci -Ama2 |
|
561 | $ echo a2 >a2 | |
|
562 | $ hg ci -Ama2 | |||
|
563 | adding a2 | |||
|
564 | ||||
268 | # a2 is now the new branch head of A, and a topological head |
|
565 | # a2 is now the new branch head of A, and a topological head | |
269 | # it replaces a former topological and branch head, so this should not warn |
|
566 | # it replaces a former topological and branch head, so this should not warn | |
270 | echo %% glog of local |
|
567 | ||
271 | hg glog --template "{rev}: {branches} {desc}\n" |
|
568 | glog of local: | |
272 | echo %% glog of remote |
|
569 | ||
273 |
hg glog |
|
570 | $ hg glog --template "{rev}: {branches} {desc}\n" | |
274 | echo %% outgoing |
|
571 | @ 3: A a2 | |
275 | hg out inner --template "{rev}: {branches} {desc}\n" |
|
572 | | | |
276 | hg push inner |
|
573 | o 2: A a1 | |
277 | cd .. |
|
574 | | | |
|
575 | | o 1: B b | |||
|
576 | |/ | |||
|
577 | o 0: A a | |||
|
578 | ||||
|
579 | glog of remote: | |||
|
580 | ||||
|
581 | $ hg glog -R inner --template "{rev}: {branches} {desc}\n" | |||
|
582 | @ 3: B b1 | |||
|
583 | | | |||
|
584 | | o 2: A a1 | |||
|
585 | | | | |||
|
586 | o | 1: B b | |||
|
587 | |/ | |||
|
588 | o 0: A a | |||
|
589 | ||||
|
590 | outgoing: | |||
|
591 | ||||
|
592 | $ hg out inner --template "{rev}: {branches} {desc}\n" | |||
|
593 | comparing with inner | |||
|
594 | searching for changes | |||
|
595 | 3: A a2 | |||
|
596 | ||||
|
597 | $ hg push inner | |||
|
598 | pushing to inner | |||
|
599 | searching for changes | |||
|
600 | adding changesets | |||
|
601 | adding manifests | |||
|
602 | adding file changes | |||
|
603 | added 1 changesets with 1 changes to 1 files | |||
|
604 | ||||
|
605 | $ cd .. | |||
|
606 | ||||
|
607 | ||||
|
608 | Check prepush with new branch head and new child of former branch head | |||
|
609 | but child is on different branch: | |||
|
610 | ||||
|
611 | $ hg init p | |||
|
612 | $ cd p | |||
|
613 | $ hg branch A | |||
|
614 | marked working directory as branch A | |||
|
615 | $ echo a0 >a | |||
|
616 | $ hg ci -Ama0 | |||
|
617 | adding a | |||
|
618 | $ echo a1 >a | |||
|
619 | $ hg ci -ma1 | |||
|
620 | $ hg up null | |||
|
621 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||
|
622 | $ hg branch B | |||
|
623 | marked working directory as branch B | |||
|
624 | $ echo b0 >b | |||
|
625 | $ hg ci -Amb0 | |||
|
626 | adding b | |||
|
627 | $ echo b1 >b | |||
|
628 | $ hg ci -mb1 | |||
|
629 | ||||
|
630 | $ hg clone . inner | |||
|
631 | updating to branch B | |||
|
632 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
278 |
|
633 | |||
279 | echo % check prepush with new branch head and new child of former branch head |
|
634 | $ hg up A | |
280 | echo % but child is on different branch |
|
635 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
281 | hg init p |
|
636 | $ hg branch -f B | |
282 | cd p |
|
637 | marked working directory as branch B | |
283 | hg branch A |
|
638 | $ echo a3 >a | |
284 | echo a0 >a |
|
639 | $ hg ci -ma3 | |
285 | hg ci -Ama0 |
|
640 | created new head | |
286 | echo a1 >a |
|
641 | $ hg up 3 | |
287 | hg ci -ma1 |
|
642 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
288 | hg up null |
|
643 | $ hg branch -f A | |
289 | hg branch B |
|
644 | marked working directory as branch A | |
290 |
echo b |
|
645 | $ echo b3 >b | |
291 |
hg ci - |
|
646 | $ hg ci -mb3 | |
292 | echo b1 >b |
|
647 | created new head | |
293 | hg ci -mb1 |
|
|||
294 |
|
648 | |||
295 | hg clone . inner |
|
649 | glog of local: | |
|
650 | ||||
|
651 | $ hg glog --template "{rev}: {branches} {desc}\n" | |||
|
652 | @ 5: A b3 | |||
|
653 | | | |||
|
654 | | o 4: B a3 | |||
|
655 | | | | |||
|
656 | o | 3: B b1 | |||
|
657 | | | | |||
|
658 | o | 2: B b0 | |||
|
659 | / | |||
|
660 | o 1: A a1 | |||
|
661 | | | |||
|
662 | o 0: A a0 | |||
|
663 | ||||
|
664 | glog of remote: | |||
296 |
|
665 | |||
297 | hg up A |
|
666 | $ hg glog -R inner --template "{rev}: {branches} {desc}\n" | |
298 | hg branch -f B |
|
667 | @ 3: B b1 | |
299 | echo a3 >a |
|
668 | | | |
300 | hg ci -ma3 |
|
669 | o 2: B b0 | |
301 | hg up 3 |
|
670 | ||
302 | hg branch -f A |
|
671 | o 1: A a1 | |
303 | echo b3 >b |
|
672 | | | |
304 | hg ci -mb3 |
|
673 | o 0: A a0 | |
|
674 | ||||
|
675 | outgoing: | |||
|
676 | ||||
|
677 | $ hg out inner --template "{rev}: {branches} {desc}\n" | |||
|
678 | comparing with inner | |||
|
679 | searching for changes | |||
|
680 | 4: B a3 | |||
|
681 | 5: A b3 | |||
305 |
|
682 | |||
306 | echo %% glog of local |
|
683 | $ hg push inner | |
307 | hg glog --template "{rev}: {branches} {desc}\n" |
|
684 | pushing to inner | |
308 | echo %% glog of remote |
|
685 | searching for changes | |
309 | hg glog -R inner --template "{rev}: {branches} {desc}\n" |
|
686 | abort: push creates new remote heads on branch 'A'! | |
310 | echo %% outgoing |
|
687 | (did you forget to merge? use push -f to force) | |
311 | hg out inner --template "{rev}: {branches} {desc}\n" |
|
|||
312 | hg push inner |
|
|||
313 | hg push inner -r4 -r5 |
|
|||
314 | hg in inner |
|
|||
315 | cd .. |
|
|||
316 |
|
688 | |||
317 | exit 0 |
|
689 | $ hg push inner -r4 -r5 | |
|
690 | pushing to inner | |||
|
691 | searching for changes | |||
|
692 | abort: push creates new remote heads on branch 'A'! | |||
|
693 | (did you forget to merge? use push -f to force) | |||
|
694 | ||||
|
695 | $ hg in inner | |||
|
696 | comparing with inner | |||
|
697 | searching for changes | |||
|
698 | no changes found | |||
|
699 | ||||
|
700 | $ cd .. | |||
|
701 |
@@ -1,68 +1,120 b'' | |||||
1 | #!/bin/sh |
|
|||
2 |
|
||||
3 | # Test issue 746: renaming files brought by the |
|
1 | # Test issue 746: renaming files brought by the | |
4 | # second parent of a merge was broken. |
|
2 | # second parent of a merge was broken. | |
5 |
|
3 | |||
6 |
|
|
4 | Create source repository: | |
7 | hg init t |
|
5 | ||
8 | cd t |
|
6 | $ hg init t | |
9 | echo a > a |
|
7 | $ cd t | |
10 | hg ci -Am a |
|
8 | $ echo a > a | |
11 | cd .. |
|
9 | $ hg ci -Am a | |
|
10 | adding a | |||
|
11 | $ cd .. | |||
|
12 | ||||
|
13 | Fork source repository: | |||
12 |
|
14 | |||
13 | echo % fork source repository |
|
15 | $ hg clone t t2 | |
14 | hg clone t t2 |
|
16 | updating to branch default | |
15 | cd t2 |
|
17 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
16 | echo b > b |
|
18 | $ cd t2 | |
17 | hg ci -Am b |
|
19 | $ echo b > b | |
|
20 | $ hg ci -Am b | |||
|
21 | adding b | |||
|
22 | ||||
|
23 | Update source repository: | |||
|
24 | ||||
|
25 | $ cd ../t | |||
|
26 | $ echo a >> a | |||
|
27 | $ hg ci -m a2 | |||
|
28 | ||||
|
29 | Merge repositories: | |||
18 |
|
30 | |||
19 | echo % update source repository |
|
31 | $ hg pull ../t2 | |
20 | cd ../t |
|
32 | pulling from ../t2 | |
21 | echo a >> a |
|
33 | searching for changes | |
22 | hg ci -m a2 |
|
34 | adding changesets | |
|
35 | adding manifests | |||
|
36 | adding file changes | |||
|
37 | added 1 changesets with 1 changes to 1 files (+1 heads) | |||
|
38 | (run 'hg heads' to see heads, 'hg merge' to merge) | |||
|
39 | ||||
|
40 | $ hg merge | |||
|
41 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
42 | (branch merge, don't forget to commit) | |||
23 |
|
43 | |||
24 | echo % merge repositories |
|
44 | $ hg st | |
25 | hg pull ../t2 |
|
45 | M b | |
26 | hg merge |
|
46 | ||
27 | hg st |
|
47 | Rename b as c: | |
28 |
|
48 | |||
29 | echo % rename b as c |
|
49 | $ hg mv b c | |
30 | hg mv b c |
|
50 | $ hg st | |
31 | hg st |
|
51 | A c | |
32 | echo % rename back c as b |
|
52 | R b | |
33 | hg mv c b |
|
53 | ||
34 | hg st |
|
54 | Rename back c as b: | |
35 | cd .. |
|
55 | ||
|
56 | $ hg mv c b | |||
|
57 | $ hg st | |||
|
58 | M b | |||
|
59 | ||||
|
60 | $ cd .. | |||
36 |
|
61 | |||
37 | # Test issue 1476: renaming a first parent file into |
|
62 | # Test issue 1476: renaming a first parent file into | |
38 | # another first parent file while none of them belong to |
|
63 | # another first parent file while none of them belong to | |
39 | # the second parent was broken |
|
64 | # the second parent was broken | |
40 | echo % test issue 1476 |
|
65 | ||
41 | hg init repo1476 |
|
66 | $ hg init repo1476 | |
42 | cd repo1476 |
|
67 | $ cd repo1476 | |
43 | echo a > a |
|
68 | $ echo a > a | |
44 | hg ci -Am adda |
|
69 | $ hg ci -Am adda | |
45 | echo b1 > b1 |
|
70 | adding a | |
46 |
echo b |
|
71 | $ echo b1 > b1 | |
47 | hg ci -Am changea |
|
72 | $ echo b2 > b2 | |
48 | hg up -C 0 |
|
73 | $ hg ci -Am changea | |
49 | echo c1 > c1 |
|
74 | adding b1 | |
50 | echo c2 > c2 |
|
75 | adding b2 | |
51 | hg ci -Am addcandd |
|
76 | $ hg up -C 0 | |
52 | echo % merge heads |
|
77 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
53 | hg merge |
|
78 | $ echo c1 > c1 | |
54 | hg mv -Af c1 c2 |
|
79 | $ echo c2 > c2 | |
55 | echo % commit issue 1476 |
|
80 | $ hg ci -Am addcandd | |
56 | hg ci -m merge |
|
81 | adding c1 | |
57 | hg log -r tip -C -v | grep copies |
|
82 | adding c2 | |
58 | hg rollback |
|
83 | created new head | |
59 | hg up -C . |
|
84 | ||
60 | echo % merge heads again |
|
85 | Merge heads: | |
61 | hg merge |
|
86 | ||
62 | hg mv -Af b1 b2 |
|
87 | $ hg merge | |
63 | echo % commit issue 1476 with a rename on the other side |
|
88 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
64 | hg ci -m merge |
|
89 | (branch merge, don't forget to commit) | |
65 | hg log -r tip -C -v | grep copies |
|
90 | ||
|
91 | $ hg mv -Af c1 c2 | |||
66 |
|
92 | |||
|
93 | Commit issue 1476: | |||
67 |
|
94 | |||
|
95 | $ hg ci -m merge | |||
68 |
|
96 | |||
|
97 | $ hg log -r tip -C -v | grep copies | |||
|
98 | copies: c2 (c1) | |||
|
99 | ||||
|
100 | $ hg rollback | |||
|
101 | rolling back to revision 2 (undo commit) | |||
|
102 | ||||
|
103 | $ hg up -C . | |||
|
104 | 2 files updated, 0 files merged, 2 files removed, 0 files unresolved | |||
|
105 | ||||
|
106 | Merge heads again: | |||
|
107 | ||||
|
108 | $ hg merge | |||
|
109 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
110 | (branch merge, don't forget to commit) | |||
|
111 | ||||
|
112 | $ hg mv -Af b1 b2 | |||
|
113 | ||||
|
114 | Commit issue 1476 with a rename on the other side: | |||
|
115 | ||||
|
116 | $ hg ci -m merge | |||
|
117 | ||||
|
118 | $ hg log -r tip -C -v | grep copies | |||
|
119 | copies: b2 (b1) | |||
|
120 |
@@ -1,24 +1,54 b'' | |||||
1 | #!/bin/sh |
|
1 | $ set -e | |
2 |
|
2 | |||
3 | set -e |
|
3 | $ mkdir test | |
|
4 | $ cd test | |||
|
5 | $ echo foo>foo | |||
|
6 | $ hg init | |||
|
7 | $ hg addremove | |||
|
8 | adding foo | |||
|
9 | $ hg commit -m "1" | |||
4 |
|
10 | |||
5 | mkdir test |
|
11 | $ hg verify | |
6 | cd test |
|
12 | checking changesets | |
7 | echo foo>foo |
|
13 | checking manifests | |
8 | hg init |
|
14 | crosschecking files in changesets and manifests | |
9 | hg addremove |
|
15 | checking files | |
10 | hg commit -m "1" |
|
16 | 1 files, 1 changesets, 1 total revisions | |
11 | hg verify |
|
17 | ||
|
18 | $ hg clone . ../branch | |||
|
19 | updating to branch default | |||
|
20 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
21 | $ cd ../branch | |||
|
22 | $ hg co | |||
|
23 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
24 | $ echo bar>>foo | |||
|
25 | $ hg commit -m "2" | |||
12 |
|
26 | |||
13 | hg clone . ../branch |
|
27 | $ cd ../test | |
14 | cd ../branch |
|
28 | ||
15 | hg co |
|
29 | $ hg pull ../branch | |
16 | echo bar>>foo |
|
30 | pulling from ../branch | |
17 | hg commit -m "2" |
|
31 | searching for changes | |
|
32 | adding changesets | |||
|
33 | adding manifests | |||
|
34 | adding file changes | |||
|
35 | added 1 changesets with 1 changes to 1 files | |||
|
36 | (run 'hg update' to get a working copy) | |||
18 |
|
37 | |||
19 | cd ../test |
|
38 | $ hg verify | |
20 | hg pull ../branch |
|
39 | checking changesets | |
21 | hg verify |
|
40 | checking manifests | |
22 | hg co |
|
41 | crosschecking files in changesets and manifests | |
23 | cat foo |
|
42 | checking files | |
24 | hg manifest --debug |
|
43 | 1 files, 2 changesets, 2 total revisions | |
|
44 | ||||
|
45 | $ hg co | |||
|
46 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
47 | ||||
|
48 | $ cat foo | |||
|
49 | foo | |||
|
50 | bar | |||
|
51 | ||||
|
52 | $ hg manifest --debug | |||
|
53 | 6f4310b00b9a147241b071a60c28a650827fb03d 644 foo | |||
|
54 |
@@ -1,20 +1,43 b'' | |||||
1 | #!/bin/sh |
|
1 | $ mkdir a | |
|
2 | $ cd a | |||
|
3 | $ hg init | |||
|
4 | $ echo 123 > a | |||
|
5 | $ hg add a | |||
|
6 | $ hg commit -m "a" -u a | |||
2 |
|
7 | |||
3 | mkdir a |
|
8 | $ cd .. | |
4 | cd a |
|
9 | $ mkdir b | |
5 | hg init |
|
10 | $ cd b | |
6 | echo 123 > a |
|
11 | $ hg init | |
7 | hg add a |
|
12 | $ echo 321 > b | |
8 | hg commit -m "a" -u a |
|
13 | $ hg add b | |
|
14 | $ hg commit -m "b" -u b | |||
|
15 | ||||
|
16 | $ hg pull ../a | |||
|
17 | pulling from ../a | |||
|
18 | searching for changes | |||
|
19 | abort: repository is unrelated | |||
9 |
|
20 | |||
10 | cd .. |
|
21 | $ hg pull -f ../a | |
11 | mkdir b |
|
22 | pulling from ../a | |
12 | cd b |
|
23 | searching for changes | |
13 | hg init |
|
24 | warning: repository is unrelated | |
14 | echo 321 > b |
|
25 | adding changesets | |
15 | hg add b |
|
26 | adding manifests | |
16 | hg commit -m "b" -u b |
|
27 | adding file changes | |
|
28 | added 1 changesets with 1 changes to 1 files (+1 heads) | |||
|
29 | (run 'hg heads' to see heads, 'hg merge' to merge) | |||
17 |
|
30 | |||
18 | hg pull ../a |
|
31 | $ hg heads | |
19 | hg pull -f ../a |
|
32 | changeset: 1:9a79c33a9db3 | |
20 | hg heads |
|
33 | tag: tip | |
|
34 | parent: -1:000000000000 | |||
|
35 | user: a | |||
|
36 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
37 | summary: a | |||
|
38 | ||||
|
39 | changeset: 0:01f8062b2de5 | |||
|
40 | user: b | |||
|
41 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
42 | summary: b | |||
|
43 |
@@ -1,5 +1,3 b'' | |||||
1 | #!/bin/sh |
|
|||
2 |
|
||||
3 | # Construct the following history tree: |
|
1 | # Construct the following history tree: | |
4 | # |
|
2 | # | |
5 | # @ 5:e1bb631146ca b1 |
|
3 | # @ 5:e1bb631146ca b1 | |
@@ -14,68 +12,119 b'' | |||||
14 | # |/ |
|
12 | # |/ | |
15 | # o 0:b608b9236435 |
|
13 | # o 0:b608b9236435 | |
16 |
|
14 | |||
17 | hg init |
|
15 | $ hg init | |
18 | echo foo > foo |
|
16 | $ echo foo > foo | |
19 | echo zero > a |
|
17 | $ echo zero > a | |
20 | hg ci -qAm0 |
|
18 | $ hg ci -qAm0 | |
21 | echo one > a ; hg ci -m1 |
|
19 | $ echo one > a ; hg ci -m1 | |
22 | echo two > a ; hg ci -m2 |
|
20 | $ echo two > a ; hg ci -m2 | |
23 | hg up -q 1 |
|
21 | $ hg up -q 1 | |
24 | echo three > a ; hg ci -qm3 |
|
22 | $ echo three > a ; hg ci -qm3 | |
25 | hg up -q 0 |
|
23 | $ hg up -q 0 | |
26 | hg branch -q b1 |
|
24 | $ hg branch -q b1 | |
27 | echo four > a ; hg ci -qm4 |
|
25 | $ echo four > a ; hg ci -qm4 | |
28 | echo five > a ; hg ci -qm5 |
|
26 | $ echo five > a ; hg ci -qm5 | |
29 |
|
27 | |||
30 |
|
|
28 | Initial repo state: | |
31 | echo |
|
|||
32 | hg --config 'extensions.graphlog=' \ |
|
|||
33 | glog --template '{rev}:{node|short} {parents} {branches}\n' |
|
|||
34 |
|
||||
35 | # Test helper functions. |
|
|||
36 |
|
29 | |||
37 | revtest () { |
|
30 | $ hg --config 'extensions.graphlog=' \ | |
38 | msg=$1 |
|
31 | > glog --template '{rev}:{node|short} {parents} {branches}\n' | |
39 | dirtyflag=$2 # 'clean' or 'dirty' |
|
32 | @ 5:e1bb631146ca b1 | |
40 | startrev=$3 |
|
33 | | | |
41 | targetrev=$4 |
|
34 | o 4:a4fdb3b883c4 0:b608b9236435 b1 | |
42 | opt=$5 |
|
35 | | | |
43 | echo % revtest $msg $startrev $targetrev |
|
36 | | o 3:4b57d2520816 1:44592833ba9f | |
44 | hg up -qC $startrev |
|
37 | | | | |
45 | test $dirtyflag = dirty && echo dirty > foo |
|
38 | | | o 2:063f31070f65 | |
46 | hg up $opt $targetrev |
|
39 | | |/ | |
47 | hg parent --template 'parent={rev}\n' |
|
40 | | o 1:44592833ba9f | |
48 | hg stat |
|
41 | |/ | |
49 | } |
|
42 | o 0:b608b9236435 | |
|
43 | ||||
|
44 | ||||
|
45 | Test helper functions: | |||
50 |
|
46 | |||
51 |
|
|
47 | $ revtest () { | |
52 | msg=$1 |
|
48 | > msg=$1 | |
53 | dirtyflag=$2 # 'clean' or 'dirty' |
|
49 | > dirtyflag=$2 # 'clean' or 'dirty' | |
54 | startrev=$3 |
|
50 | > startrev=$3 | |
55 | opt=$4 |
|
51 | > targetrev=$4 | |
56 | echo % norevtest $msg $startrev |
|
52 | > opt=$5 | |
57 | hg up -qC $startrev |
|
53 | > hg up -qC $startrev | |
58 | test $dirtyflag = dirty && echo dirty > foo |
|
54 | > test $dirtyflag = dirty && echo dirty > foo | |
59 | hg up $opt |
|
55 | > hg up $opt $targetrev | |
60 | hg parent --template 'parent={rev}\n' |
|
56 | > hg parent --template 'parent={rev}\n' | |
61 | hg stat |
|
57 | > hg stat | |
62 | } |
|
58 | > } | |
|
59 | ||||
|
60 | $ norevtest () { | |||
|
61 | > msg=$1 | |||
|
62 | > dirtyflag=$2 # 'clean' or 'dirty' | |||
|
63 | > startrev=$3 | |||
|
64 | > opt=$4 | |||
|
65 | > hg up -qC $startrev | |||
|
66 | > test $dirtyflag = dirty && echo dirty > foo | |||
|
67 | > hg up $opt | |||
|
68 | > hg parent --template 'parent={rev}\n' | |||
|
69 | > hg stat | |||
|
70 | > } | |||
63 |
|
71 | |||
64 | # Test cases are documented in a table in the update function of merge.py. |
|
72 | # Test cases are documented in a table in the update function of merge.py. | |
65 | # Cases are run as shown in that table, row by row. |
|
73 | # Cases are run as shown in that table, row by row. | |
66 |
|
74 | |||
67 | norevtest 'none clean linear' clean 4 |
|
75 | $ norevtest 'none clean linear' clean 4 | |
68 | norevtest 'none clean same' clean 2 |
|
76 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
77 | parent=5 | |||
|
78 | ||||
|
79 | $ norevtest 'none clean same' clean 2 | |||
|
80 | abort: crosses branches (use 'hg merge' or use 'hg update -c') | |||
|
81 | parent=2 | |||
|
82 | ||||
|
83 | ||||
|
84 | $ revtest 'none clean linear' clean 1 2 | |||
|
85 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
86 | parent=2 | |||
69 |
|
87 | |||
70 |
revtest 'none clean |
|
88 | $ revtest 'none clean same' clean 2 3 | |
71 | revtest 'none clean same' clean 2 3 |
|
89 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
72 | revtest 'none clean cross' clean 3 4 |
|
90 | parent=3 | |
|
91 | ||||
|
92 | $ revtest 'none clean cross' clean 3 4 | |||
|
93 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
94 | parent=4 | |||
|
95 | ||||
|
96 | ||||
|
97 | $ revtest 'none dirty linear' dirty 1 2 | |||
|
98 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
99 | parent=2 | |||
|
100 | M foo | |||
73 |
|
101 | |||
74 |
revtest 'none dirty |
|
102 | $ revtest 'none dirty same' dirty 2 3 | |
75 | revtest 'none dirty same' dirty 2 3 |
|
103 | abort: crosses branches (use 'hg merge' to merge or use 'hg update -C' to discard changes) | |
76 | revtest 'none dirty cross' dirty 3 4 |
|
104 | parent=2 | |
|
105 | M foo | |||
|
106 | ||||
|
107 | $ revtest 'none dirty cross' dirty 3 4 | |||
|
108 | abort: crosses branches (use 'hg merge' to merge or use 'hg update -C' to discard changes) | |||
|
109 | parent=3 | |||
|
110 | M foo | |||
|
111 | ||||
|
112 | ||||
|
113 | $ revtest '-C dirty linear' dirty 1 2 -C | |||
|
114 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
115 | parent=2 | |||
77 |
|
116 | |||
78 |
revtest '- |
|
117 | $ revtest '-c dirty linear' dirty 1 2 -c | |
79 | revtest '-c dirty linear' dirty 1 2 -c |
|
118 | abort: uncommitted local changes | |
80 | norevtest '-c clean same' clean 2 -c |
|
119 | parent=1 | |
81 | revtest '-cC dirty linear' dirty 1 2 -cC |
|
120 | M foo | |
|
121 | ||||
|
122 | $ norevtest '-c clean same' clean 2 -c | |||
|
123 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
124 | parent=3 | |||
|
125 | ||||
|
126 | $ revtest '-cC dirty linear' dirty 1 2 -cC | |||
|
127 | abort: cannot specify both -c/--check and -C/--clean | |||
|
128 | parent=1 | |||
|
129 | M foo | |||
|
130 |
@@ -1,24 +1,31 b'' | |||||
1 | #!/bin/sh |
|
1 | $ rm -rf a | |
2 |
|
2 | $ hg init a | ||
3 | rm -rf a |
|
3 | $ cd a | |
4 | hg init a |
|
|||
5 | cd a |
|
|||
6 |
|
4 | |||
7 | echo foo > foo |
|
5 | $ echo foo > foo | |
8 | hg ci -qAm0 |
|
6 | $ hg ci -qAm0 | |
9 | chmod +x foo |
|
7 | $ chmod +x foo | |
10 | hg ci -m1 |
|
8 | $ hg ci -m1 | |
11 | hg co -q 0 |
|
9 | $ hg co -q 0 | |
12 | echo dirty > foo |
|
10 | $ echo dirty > foo | |
13 | hg up -c |
|
11 | $ hg up -c | |
14 | hg up -q |
|
12 | abort: uncommitted local changes | |
15 | cat foo |
|
13 | $ hg up -q | |
16 | hg st -A |
|
14 | $ cat foo | |
|
15 | dirty | |||
|
16 | $ hg st -A | |||
|
17 | M foo | |||
17 |
|
18 | |||
18 |
|
|
19 | Validate update of standalone execute bit change: | |
19 | hg up -C 0 |
|
20 | ||
20 | chmod -x foo |
|
21 | $ hg up -C 0 | |
21 | hg ci -m removeexec |
|
22 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
22 | hg up -C 0 |
|
23 | $ chmod -x foo | |
23 | hg up |
|
24 | $ hg ci -m removeexec | |
24 | hg st |
|
25 | nothing changed | |
|
26 | $ hg up -C 0 | |||
|
27 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
28 | $ hg up | |||
|
29 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
30 | $ hg st | |||
|
31 |
@@ -1,34 +1,85 b'' | |||||
1 | #!/bin/sh |
|
1 | $ hg init | |
|
2 | ||||
|
3 | $ touch a | |||
|
4 | $ hg add a | |||
|
5 | $ hg commit -m "Added a" | |||
2 |
|
6 | |||
3 | hg init |
|
7 | $ touch main | |
4 | touch a |
|
8 | $ hg add main | |
5 | hg add a |
|
9 | $ hg commit -m "Added main" | |
6 | hg commit -m "Added a" |
|
10 | $ hg checkout 0 | |
|
11 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||
|
12 | ||||
|
13 | 'main' should be gone: | |||
|
14 | ||||
|
15 | $ ls | |||
|
16 | a | |||
7 |
|
17 | |||
8 | touch main |
|
18 | $ touch side1 | |
9 | hg add main |
|
19 | $ hg add side1 | |
10 |
hg commit -m "Added |
|
20 | $ hg commit -m "Added side1" | |
11 | hg checkout 0 |
|
21 | created new head | |
|
22 | $ touch side2 | |||
|
23 | $ hg add side2 | |||
|
24 | $ hg commit -m "Added side2" | |||
12 |
|
25 | |||
13 | echo Main should be gone |
|
26 | $ hg log | |
14 | ls |
|
27 | changeset: 3:91ebc10ed028 | |
|
28 | tag: tip | |||
|
29 | user: test | |||
|
30 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
31 | summary: Added side2 | |||
|
32 | ||||
|
33 | changeset: 2:b932d7dbb1e1 | |||
|
34 | parent: 0:c2eda428b523 | |||
|
35 | user: test | |||
|
36 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
37 | summary: Added side1 | |||
|
38 | ||||
|
39 | changeset: 1:71a760306caf | |||
|
40 | user: test | |||
|
41 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
42 | summary: Added main | |||
15 |
|
43 | |||
16 | touch side1 |
|
44 | changeset: 0:c2eda428b523 | |
17 | hg add side1 |
|
45 | user: test | |
18 | hg commit -m "Added side1" |
|
46 | date: Thu Jan 01 00:00:00 1970 +0000 | |
19 | touch side2 |
|
47 | summary: Added a | |
20 | hg add side2 |
|
48 | ||
21 | hg commit -m "Added side2" |
|
|||
22 |
|
49 | |||
23 | hg log |
|
50 | $ hg heads | |
|
51 | changeset: 3:91ebc10ed028 | |||
|
52 | tag: tip | |||
|
53 | user: test | |||
|
54 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
55 | summary: Added side2 | |||
|
56 | ||||
|
57 | changeset: 1:71a760306caf | |||
|
58 | user: test | |||
|
59 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
60 | summary: Added main | |||
24 |
|
61 | |||
25 | echo Should have two heads, side2 and main |
|
62 | $ ls | |
26 | hg heads |
|
63 | a | |
|
64 | side1 | |||
|
65 | side2 | |||
27 |
|
66 | |||
28 | echo Should show "a side1 side2" |
|
67 | $ hg update --debug -C 1 | |
29 | ls |
|
68 | resolving manifests | |
|
69 | overwrite True partial False | |||
|
70 | ancestor 91ebc10ed028+ local 91ebc10ed028+ remote 71a760306caf | |||
|
71 | side2: other deleted -> r | |||
|
72 | side1: other deleted -> r | |||
|
73 | main: remote created -> g | |||
|
74 | updating: side1 1/3 files (33.33%) | |||
|
75 | removing side1 | |||
|
76 | updating: side2 2/3 files (66.67%) | |||
|
77 | removing side2 | |||
|
78 | updating: main 3/3 files (100.00%) | |||
|
79 | getting main | |||
|
80 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved | |||
30 |
|
81 | |||
31 | hg update --debug -C 1 |
|
82 | $ ls | |
32 | echo Should only show "a main" |
|
83 | a | |
33 | ls |
|
84 | main | |
34 |
|
85 |
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 |
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 |
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 |
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 |
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 |
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