Show More
@@ -433,7 +433,7 b' def update(repo, node, branchmerge, forc' | |||
|
433 | 433 | the parent rev to the target rev (linear, on the same named |
|
434 | 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 | 438 | -c -C dirty rev | linear same cross |
|
439 | 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 | |
|
4 | cd t | |
|
5 | hg init | |
|
6 | echo a > a | |
|
7 | hg add a | |
|
8 | hg commit -m test | |
|
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 | |
|
9 | > hg co -qC 0 | |
|
10 | > echo b > a | |
|
11 | > hg st | |
|
12 | > done | |
|
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 | |
|
4 | cd t | |
|
5 | hg init | |
|
6 | echo "added file1" > file1 | |
|
7 | echo "added file2" > file2 | |
|
8 | hg add file1 file2 | |
|
9 | hg commit -m "added file1 and file2" | |
|
10 | echo "changed file1" >> file1 | |
|
11 | hg commit -m "changed file1" | |
|
12 | hg -q log | |
|
13 | hg id | |
|
14 | hg update -C 0 | |
|
15 | hg id | |
|
16 | echo "changed file1" >> file1 | |
|
17 | hg id | |
|
18 | hg revert --all | |
|
19 | hg diff | |
|
20 | hg status | |
|
21 | hg id | |
|
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 | |
|
33 | $ hg update | |
|
34 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
35 | $ hg diff | |
|
36 | $ hg status | |
|
37 | ? file1.orig | |
|
38 | $ hg id | |
|
39 | 08a16e8e4408 tip | |
|
40 | ||
|
41 | $ hg update -C 0 | |
|
42 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
43 | $ echo "changed file1" >> file1 | |
|
44 | ||
|
45 | $ hg update | |
|
46 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
47 | $ hg diff | |
|
48 | $ hg status | |
|
49 | ? file1.orig | |
|
50 | $ hg id | |
|
51 | 08a16e8e4408 tip | |
|
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 | |
|
4 | cd t | |
|
5 | hg init | |
|
6 | echo "added file1" > file1 | |
|
7 | echo "another line of text" >> file1 | |
|
8 | echo "added file2" > file2 | |
|
9 | hg add file1 file2 | |
|
10 | hg commit -m "added file1 and file2" | |
|
11 | echo "changed file1" >> file1 | |
|
12 | hg commit -m "changed file1" | |
|
13 | hg -q log | |
|
14 | hg id | |
|
15 | hg update -C 0 | |
|
16 | hg id | |
|
17 | echo "changed file1" >> file1 | |
|
18 | hg id | |
|
19 | hg revert --no-backup --all | |
|
20 | hg diff | |
|
21 | hg status | |
|
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 | $ hg update | |
|
46 | merging file1 | |
|
47 | warning: conflicts during merge. | |
|
48 | merging file1 failed! | |
|
49 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
|
50 | use 'hg resolve' to retry unresolved file merges | |
|
51 | ||
|
52 | $ hg diff --nodates | |
|
53 | diff -r dfab7f3c2efb file1 | |
|
54 | --- a/file1 | |
|
55 | +++ b/file1 | |
|
56 | @@ -1,3 +1,7 @@ | |
|
57 | added file1 | |
|
58 | another line of text | |
|
59 | +<<<<<<< local | |
|
60 | +changed file1 different | |
|
61 | +======= | |
|
62 | changed file1 | |
|
63 | +>>>>>>> other | |
|
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 | |
|
4 | echo a > a | |
|
5 | hg ci -Amadd # 0 | |
|
3 | $ echo a > a | |
|
4 | $ hg ci -Amadd | |
|
5 | adding a | |
|
6 | ||
|
7 | $ chmod +x a | |
|
8 | $ hg ci -mexecutable | |
|
6 | 9 | |
|
7 | chmod +x a | |
|
8 | hg ci -mexecutable # 1 | |
|
10 | $ hg up 0 | |
|
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 | |
|
11 | rm a | |
|
12 | ln -s symlink a | |
|
13 | hg ci -msymlink # 2 | |
|
14 | hg merge --debug | |
|
17 | $ hg merge --debug | |
|
18 | searching for copies back to rev 1 | |
|
19 | resolving manifests | |
|
20 | overwrite None partial False | |
|
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 | |
|
19 | echo a is a symlink | |
|
20 | $TESTDIR/readlink.py a | |
|
21 | elif [ -x a ]; then | |
|
22 | echo a is executable | |
|
23 | else | |
|
24 | echo "a has no flags (default for conflicts)" | |
|
25 | fi | |
|
32 | $ if [ -h a ]; then | |
|
33 | > echo a is a symlink | |
|
34 | > $TESTDIR/readlink.py a | |
|
35 | > elif [ -x a ]; then | |
|
36 | > echo a is executable | |
|
37 | > else | |
|
38 | > echo "a has no flags (default for conflicts)" | |
|
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 | |
|
28 | hg merge --debug | |
|
29 | ||
|
30 | echo % symlink is other parent, executable is local | |
|
45 | $ hg merge --debug | |
|
46 | searching for copies back to rev 1 | |
|
47 | resolving manifests | |
|
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 | |
|
33 | echo a is a symlink | |
|
34 | $TESTDIR/readlink.py a | |
|
35 |
|
|
|
36 |
echo a is |
|
|
37 | else | |
|
38 | echo "a has no flags (default for conflicts)" | |
|
39 | fi | |
|
58 | ||
|
59 | Symlink is other parent, executable is local: | |
|
60 | ||
|
61 | $ if [ -h a ]; then | |
|
62 | > echo a is a symlink | |
|
63 | > $TESTDIR/readlink.py a | |
|
64 | > elif [ -x a ]; then | |
|
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 | |
|
4 | cd a | |
|
5 | hg init b | |
|
6 | echo x > b/x | |
|
8 | $ hg add b | |
|
9 | $ hg st | |
|
10 | ||
|
11 | Should fail: | |
|
7 | 12 | |
|
8 | echo '# should print nothing' | |
|
9 | hg add b | |
|
10 | hg st | |
|
13 | $ hg st b/x | |
|
14 | abort: path 'b/x' is inside repo 'b' | |
|
15 | $ hg add b/x | |
|
16 | abort: path 'b/x' is inside repo 'b' | |
|
11 | 17 | |
|
12 |
|
|
|
13 | hg st b/x | |
|
14 | hg add b/x | |
|
18 | Should fail: | |
|
15 | 19 | |
|
16 | echo '# should fail' | |
|
17 | hg add b b/x | |
|
18 | hg st | |
|
20 | $ hg add b b/x | |
|
21 | abort: path 'b/x' is inside repo 'b' | |
|
22 | $ hg st | |
|
23 | ||
|
24 | Should arguably print nothing: | |
|
25 | ||
|
26 | $ hg st b | |
|
19 | 27 | |
|
20 | echo '# should arguably print nothing' | |
|
21 | hg st b | |
|
28 | $ echo a > a | |
|
29 | $ hg ci -Ama a | |
|
30 | ||
|
31 | Should fail: | |
|
22 | 32 | |
|
23 | echo a > a | |
|
24 | hg ci -Ama a | |
|
33 | $ hg mv a b | |
|
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 | |
|
6 | cd t | |
|
7 |
hg branch |
|
|
19 | Branch shadowing: | |
|
20 | ||
|
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 | |
|
10 | hg add a | |
|
11 | hg ci -m "initial" | |
|
12 |
hg branch |
|
|
13 | hg branch | |
|
14 | hg ci -m "add branch name" | |
|
15 | hg branch bar | |
|
16 | hg ci -m "change branch name" | |
|
17 | echo % branch shadowing | |
|
18 | hg branch default | |
|
19 | hg branch -f default | |
|
20 | hg ci -m "clear branch name" | |
|
39 | ||
|
40 | $ hg co foo | |
|
41 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
42 | $ hg branch | |
|
43 | foo | |
|
44 | $ echo bleah > a | |
|
45 | $ hg ci -m "modify a branch" | |
|
46 | ||
|
47 | $ hg merge default | |
|
48 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
49 | (branch merge, don't forget to commit) | |
|
50 | ||
|
51 | $ hg branch | |
|
52 | foo | |
|
53 | $ hg ci -m "merge" | |
|
21 | 54 | |
|
22 | echo % there should be only one default branch head | |
|
23 | hg heads . | |
|
55 | $ hg log | |
|
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 | |
|
26 | hg branch | |
|
27 | echo bleah > a | |
|
28 | hg ci -m "modify a branch" | |
|
77 | changeset: 2:ed2bbf4e0102 | |
|
78 | branch: bar | |
|
79 | user: test | |
|
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 | |
|
31 | hg branch | |
|
32 | hg ci -m "merge" | |
|
33 | hg log | |
|
94 | $ hg branches | |
|
95 | foo 5:dc140083783b | |
|
96 | default 3:9d567d0b51f9 (inactive) | |
|
97 | bar 2:ed2bbf4e0102 (inactive) | |
|
34 | 98 | |
|
35 | hg branches | |
|
36 | hg branches -q | |
|
99 | $ 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 | |
|
39 | hg rollback | |
|
40 | cp $branchcache .hg/bc-invalid | |
|
41 | hg log -r foo | |
|
42 | cp .hg/bc-invalid $branchcache | |
|
43 | hg --debug log -r foo | |
|
44 | rm $branchcache | |
|
45 | echo corrupted > $branchcache | |
|
46 | hg log -qr foo | |
|
47 |
|
|
|
111 | $ hg log -r foo | |
|
112 | changeset: 4:98d14f698afe | |
|
113 | branch: foo | |
|
114 | tag: tip | |
|
115 | parent: 1:0079f24813e2 | |
|
116 | user: test | |
|
117 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
118 | summary: modify a branch | |
|
119 | ||
|
120 | $ cp .hg/bc-invalid $branchcache | |
|
48 | 121 | |
|
49 | echo % push should update the branch cache | |
|
50 | hg init ../target | |
|
51 | echo % pushing just rev 0 | |
|
52 | hg push -qr 0 ../target | |
|
53 | cat ../target/$branchcache | |
|
54 | echo % pushing everything | |
|
55 | hg push -qf ../target | |
|
56 | cat ../target/$branchcache | |
|
122 | $ hg --debug log -r foo | |
|
123 | invalidating branch cache (tip differs) | |
|
124 | changeset: 4:98d14f698afeaff8cb612dcf215ce95e639effc3 | |
|
125 | branch: foo | |
|
126 | tag: tip | |
|
127 | parent: 1:0079f24813e2b73a891577c243684c5066347bc8 | |
|
128 | parent: -1:0000000000000000000000000000000000000000 | |
|
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 | |
|
59 | hg up -q -C 0 | |
|
60 | hg up -q | |
|
61 | hg id | |
|
62 | hg up -q 1 | |
|
63 | hg up -q | |
|
64 | hg id | |
|
65 | hg branch foobar | |
|
66 | hg up | |
|
158 | $ cat ../target/$branchcache | |
|
159 | db01e8ea3388fd3c7c94e1436ea2bd6a53d581c5 0 | |
|
160 | db01e8ea3388fd3c7c94e1436ea2bd6a53d581c5 default | |
|
161 | ||
|
162 | Pushing everything: | |
|
163 | ||
|
164 | $ hg push -qf ../target | |
|
165 | ||
|
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 | |
|
69 | hg branch ff | |
|
70 | echo ff > ff | |
|
71 | hg ci -Am'fast forward' | |
|
72 | hg up foo | |
|
73 | hg merge ff | |
|
74 | hg branch | |
|
75 | hg commit -m'Merge ff into foo' | |
|
76 | hg parents | |
|
77 | hg manifest | |
|
195 | $ echo ff > ff | |
|
196 | $ hg ci -Am'fast forward' | |
|
197 | adding ff | |
|
198 | ||
|
199 | $ hg up foo | |
|
200 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
|
201 | ||
|
202 | $ hg merge ff | |
|
203 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
204 | (branch merge, don't forget to commit) | |
|
78 | 205 | |
|
79 | echo % test merging, add 3 default heads and one test head | |
|
80 | cd .. | |
|
81 | hg init merges | |
|
82 | cd merges | |
|
83 | echo a > a | |
|
84 | hg ci -Ama | |
|
206 | $ hg branch | |
|
207 | foo | |
|
208 | $ hg commit -m'Merge ff into foo' | |
|
209 | $ hg parents | |
|
210 | changeset: 6:917eb54e1b4b | |
|
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 | |
|
87 | hg ci -Amb | |
|
237 | $ hg up 0 | |
|
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 | |
|
90 | echo c > c | |
|
91 | hg ci -Amc | |
|
251 | $ hg up 0 | |
|
252 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
|
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 | |
|
94 | echo d > d | |
|
95 | hg ci -Amd | |
|
259 | $ hg log | |
|
260 | changeset: 4:3a1e01ed1df4 | |
|
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 | |
|
98 | hg branch test | |
|
99 | echo e >> e | |
|
100 | hg ci -Ame | |
|
274 | changeset: 2:d36c0562f908 | |
|
275 | parent: 0:cb9a9f314b8b | |
|
276 | user: test | |
|
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 | |
|
105 | hg merge | |
|
106 | hg up -C default | |
|
107 | echo % implicit merge with default branch as parent | |
|
108 | hg merge | |
|
109 | echo % 3 branch heads, explicit merge required | |
|
110 | hg merge 2 | |
|
111 | hg ci -m merge | |
|
112 | echo % 2 branch heads, implicit merge works | |
|
113 | hg merge | |
|
292 | $ hg merge | |
|
293 | abort: branch 'test' has one head - please merge with an explicit rev | |
|
294 | (run 'hg heads' to see all heads) | |
|
295 | $ hg up -C default | |
|
296 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
|
297 | ||
|
298 | Implicit merge with default branch as parent: | |
|
299 | ||
|
300 | $ 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' | |
|
4 | hg init t | |
|
5 | cd t | |
|
6 | echo foo > a | |
|
7 | echo '% hg add a' | |
|
8 | hg add a | |
|
9 | echo '% hg commit' | |
|
10 | hg commit -m "1" | |
|
11 | echo '% hg verify' | |
|
12 | hg verify | |
|
13 | chmod -r .hg/store/data/a.i | |
|
14 | echo '% hg verify' | |
|
15 | hg verify 2>/dev/null || echo verify failed | |
|
16 | chmod +r .hg/store/data/a.i | |
|
17 | echo '% hg verify' | |
|
18 | hg verify 2>/dev/null || echo verify failed | |
|
19 | chmod -w .hg/store/data/a.i | |
|
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 . | |
|
35 | $ chmod -w .hg/store/data/a.i | |
|
36 | ||
|
37 | $ echo barber > a | |
|
38 | $ hg commit -m "2" || echo %%% commit failed | |
|
39 | trouble committing a! | |
|
40 | abort: Permission denied: .* | |
|
41 | %%% commit failed | |
|
42 | ||
|
43 | $ chmod -w . | |
|
44 | ||
|
45 | $ hg diff --nodates | |
|
46 | diff -r 2a18120dc1c9 a | |
|
47 | --- a/a | |
|
48 | +++ b/a | |
|
49 | @@ -1,1 +1,1 @@ | |
|
50 | -foo | |
|
51 | +barber | |
|
27 | 52 | |
|
28 | chmod +w .hg/store/data/a.i | |
|
29 | mkdir dir | |
|
30 | touch dir/a | |
|
31 | echo '% hg status' | |
|
32 | hg status | |
|
33 | chmod -rx dir | |
|
34 | echo '% hg status' | |
|
35 | hg status | |
|
36 | # reenable perm to allow deletion | |
|
37 | chmod +rx dir | |
|
53 | $ chmod +w . | |
|
54 | ||
|
55 | $ chmod +w .hg/store/data/a.i | |
|
56 | $ mkdir dir | |
|
57 | $ touch dir/a | |
|
58 | $ hg status | |
|
59 | M a | |
|
60 | ? dir/a | |
|
61 | $ 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 | |
|
4 | cd t | |
|
5 | echo 1 > foo | |
|
6 | hg ci -Am1 # 0 | |
|
7 | hg branch branchA | |
|
8 | echo a1 > foo | |
|
9 | hg ci -ma1 # 1 | |
|
11 | $ cd .. | |
|
12 | $ hg init tt | |
|
13 | $ cd tt | |
|
14 | $ hg pull ../t | |
|
15 | pulling from ../t | |
|
16 | requesting all changes | |
|
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 .. | |
|
12 | hg init tt | |
|
13 | cd tt | |
|
14 | hg pull ../t | |
|
15 | hg up branchA | |
|
25 | $ cd ../t | |
|
26 | $ echo a2 > foo | |
|
27 | $ hg ci -ma2 # 2 | |
|
28 | ||
|
29 | Create branch B: | |
|
16 | 30 | |
|
17 | cd ../t | |
|
18 | echo a2 > foo | |
|
19 | hg ci -ma2 # 2 | |
|
20 | echo % create branch B | |
|
21 | hg up 0 | |
|
22 | hg branch branchB | |
|
23 | echo b1 > foo | |
|
24 | hg ci -mb1 # 3 | |
|
31 | $ hg up 0 | |
|
32 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
33 | $ hg branch branchB | |
|
34 | marked working directory as branch branchB | |
|
35 | $ echo b1 > foo | |
|
36 | $ hg ci -mb1 # 3 | |
|
37 | ||
|
38 | $ cd ../tt | |
|
39 | ||
|
40 | A new branch is there | |
|
25 | 41 | |
|
26 | cd ../tt | |
|
27 | echo % a new branch is there | |
|
28 | hg pull -u ../t | |
|
42 | $ hg pull -u ../t | |
|
43 | pulling from ../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 | |
|
31 | cd ../t | |
|
32 | hg up branchA | |
|
33 | echo a3 > foo | |
|
34 | hg ci -ma3 # 4 | |
|
35 | hg up branchB | |
|
36 | echo b2 > foo | |
|
37 | hg ci -mb2 # 5 | |
|
53 | $ cd ../t | |
|
54 | $ hg up branchA | |
|
55 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
56 | $ echo a3 > foo | |
|
57 | $ hg ci -ma3 # 4 | |
|
58 | $ hg up branchB | |
|
59 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
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 | |
|
40 | echo % should succeed, no new heads | |
|
41 | hg pull -u ../t | |
|
67 | $ hg pull -u ../t | |
|
68 | pulling from ../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 | |
|
44 | cd ../t | |
|
45 | hg up branchA | |
|
46 | echo a4 > foo | |
|
47 | hg ci -ma4 # 6 | |
|
48 | hg up branchB | |
|
49 | echo b3.1 > foo | |
|
50 | hg ci -m b3.1 # 7 | |
|
51 | hg up 5 | |
|
52 | echo b3.2 > foo | |
|
53 | hg ci -m b3.2 # 8 | |
|
78 | $ cd ../t | |
|
79 | $ hg up branchA | |
|
80 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
81 | $ echo a4 > foo | |
|
82 | $ hg ci -ma4 # 6 | |
|
83 | $ hg up branchB | |
|
84 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
85 | $ echo b3.1 > foo | |
|
86 | $ hg ci -m b3.1 # 7 | |
|
87 | $ hg up 5 | |
|
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 | |
|
56 | echo % should succeed only one head on our branch | |
|
57 | hg pull -u ../t | |
|
97 | $ hg pull -u ../t | |
|
98 | pulling from ../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 | |
|
60 | hg up -C branchA | |
|
61 | echo a5.1 > foo | |
|
62 | hg ci -ma5.1 # 9 | |
|
63 | hg up 6 | |
|
64 | echo a5.2 > foo | |
|
65 | hg ci -ma5.2 # 10 | |
|
66 | hg up 7 | |
|
67 | echo b4.1 > foo | |
|
68 | hg ci -m b4.1 # 11 | |
|
69 | hg up -C 8 | |
|
70 | echo b4.2 > foo | |
|
71 | hg ci -m b4.2 # 12 | |
|
106 | $ cd ../t | |
|
107 | $ hg up -C branchA | |
|
108 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
109 | $ echo a5.1 > foo | |
|
110 | $ hg ci -ma5.1 # 9 | |
|
111 | $ hg up 6 | |
|
112 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
113 | $ echo a5.2 > foo | |
|
114 | $ hg ci -ma5.2 # 10 | |
|
115 | created new head | |
|
116 | $ hg up 7 | |
|
117 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
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 | |
|
74 | echo % should fail new head in our branch | |
|
75 | hg pull -u ../t | |
|
125 | $ cd ../tt | |
|
126 | ||
|
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 | |
|
4 | cd a | |
|
5 | hg init | |
|
6 | echo foo > b | |
|
7 | hg add b | |
|
8 | hg ci -m "b" | |
|
8 | $ chmod -w .hg/store | |
|
9 | ||
|
10 | $ cd .. | |
|
9 | 11 | |
|
10 | chmod -w .hg/store | |
|
11 | ||
|
12 | cd .. | |
|
12 | $ hg clone a b | |
|
13 | requesting all changes | |
|
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 | |
|
4 | cd repo | |
|
5 | echo foo > foo | |
|
6 | hg ci -qAm 'add foo' | |
|
7 | echo >> foo | |
|
8 | hg ci -m 'change foo' | |
|
9 | hg up -qC 0 | |
|
10 | echo bar > bar | |
|
11 | hg ci -qAm 'add bar' | |
|
12 | hg log | |
|
13 | cd .. | |
|
14 | hg init copy | |
|
15 | cd copy | |
|
11 | $ hg log | |
|
12 | changeset: 2:effea6de0384 | |
|
13 | tag: tip | |
|
14 | parent: 0:bbd179dfa0a7 | |
|
15 | user: test | |
|
16 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
17 | summary: add bar | |
|
18 | ||
|
19 | changeset: 1:ed1b79f46b9a | |
|
20 | user: test | |
|
21 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
22 | summary: change foo | |
|
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 |
|
|
|
18 | hg pull -qr missing ../repo | |
|
35 | $ 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' | |
|
21 | hg pull -qu -r 0 -r 1 ../repo | |
|
22 | hg -q parents | |
|
23 | hg rollback | |
|
40 | $ hg pull -qu -r 0 -r 1 ../repo | |
|
41 | $ hg -q parents | |
|
42 | 0:bbd179dfa0a7 | |
|
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' | |
|
26 | hg pull -qr 0 ../repo | |
|
27 | hg log | |
|
54 | $ hg pull -qr 1 ../repo | |
|
55 | $ 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' | |
|
30 | hg pull -qr 1 ../repo | |
|
31 | hg log | |
|
62 | changeset: 0:bbd179dfa0a7 | |
|
63 | user: test | |
|
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 | |
|
34 | echo '% pull -r 1 again' | |
|
35 | hg pull -qr 1 ../repo | |
|
67 | ||
|
68 | This used to abort: received changelog group is empty: | |
|
69 | ||
|
70 | $ hg pull -qr 1 ../repo | |
|
71 |
@@ -1,29 +1,63 b'' | |||
|
1 | #!/bin/sh | |
|
2 | # | |
|
1 | $ hg init t | |
|
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 | |
|
5 | cd t | |
|
6 | echo 1 > foo | |
|
7 | hg ci -Am m | |
|
15 | $ cd ../t | |
|
16 | $ echo 1.2 > foo | |
|
17 | $ hg ci -Am m | |
|
18 | ||
|
19 | Should not update: | |
|
8 | 20 | |
|
9 | cd .. | |
|
10 | hg clone t tt | |
|
11 | cd tt | |
|
12 | echo 1.1 > foo | |
|
13 | hg ci -Am m | |
|
21 | $ hg pull -u ../tt | |
|
22 | pulling from ../tt | |
|
23 | searching for changes | |
|
24 | adding changesets | |
|
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 | |
|
16 | echo 1.2 > foo | |
|
17 | hg ci -Am m | |
|
18 | echo % should fail | |
|
19 | hg pull -u ../tt | |
|
33 | Should not update: | |
|
34 | ||
|
35 | $ hg pull -u ../t | |
|
36 | pulling from ../t | |
|
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 | |
|
22 | echo % should fail | |
|
23 | hg pull -u ../t | |
|
24 | HGMERGE=true hg merge | |
|
25 | hg ci -mm | |
|
45 | $ HGMERGE=true hg merge | |
|
46 | merging foo | |
|
47 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
|
48 | (branch merge, don't forget to commit) | |
|
49 | $ hg ci -mm | |
|
50 | ||
|
51 | $ cd ../t | |
|
52 | ||
|
53 | Should work: | |
|
26 | 54 | |
|
27 | cd ../t | |
|
28 | echo % should work | |
|
29 | hg pull -u ../tt | |
|
55 | $ hg pull -u ../tt | |
|
56 | pulling from ../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 | |
|
4 | cd test | |
|
5 | echo foo>foo | |
|
6 | hg init | |
|
7 | hg addremove | |
|
8 | hg commit -m 1 | |
|
9 | hg verify | |
|
10 | hg serve -p $HGPORT -d --pid-file=hg.pid | |
|
11 | cat hg.pid >> $DAEMON_PIDS | |
|
12 | cd .. | |
|
17 | $ hg serve -p $HGPORT -d --pid-file=hg.pid | |
|
18 | $ cat hg.pid >> $DAEMON_PIDS | |
|
19 | $ cd .. | |
|
20 | ||
|
21 | $ hg clone --pull http://foo:bar@localhost:$HGPORT/ copy | sed -e "s,:$HGPORT/,:\$HGPORT/," | |
|
22 | requesting all changes | |
|
23 | adding changesets | |
|
24 | adding manifests | |
|
25 | adding file changes | |
|
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/," | |
|
15 | cd copy | |
|
16 | hg verify | |
|
17 | hg co | |
|
18 | cat foo | |
|
19 | hg manifest --debug | |
|
20 | hg pull | sed -e "s,:$HGPORT/,:\$HGPORT/," | |
|
21 | hg rollback --dry-run --verbose | sed -e "s,:$HGPORT/,:\$HGPORT/," | |
|
38 | $ hg co | |
|
39 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
40 | $ cat foo | |
|
41 | foo | |
|
42 | ||
|
43 | $ hg manifest --debug | |
|
44 | 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 foo | |
|
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 | |
|
24 | cd .. | |
|
25 | hg init empty | |
|
26 | cd empty | |
|
27 |
|
|
|
56 | $ cd .. | |
|
57 | $ hg init empty | |
|
58 | $ cd empty | |
|
59 | $ hg pull -u ../test | |
|
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 |
|
|
|
30 | hg pull -q file://../test-doesnt-exist 2>&1 \ | |
|
31 | | sed 's%abort: repository.*/test-doesnt-exist%abort: repository /test-doesnt-exist%' | |
|
32 | hg pull -q file:../test | |
|
68 | Test 'file:' uri handling: | |
|
69 | ||
|
70 | $ hg pull -q file://../test-doesnt-exist | |
|
71 | abort: repository /test-doesnt-exist not found! | |
|
72 | ||
|
73 | $ hg pull -q file:../test | |
|
74 | ||
|
33 | 75 | # It's tricky to make file:// URLs working on every platforms |
|
34 | 76 | # with regular shell commands. |
|
35 | URL=`python -c "import os; print 'file://foobar' + ('/' + os.getcwd().replace(os.sep, '/')).replace('//', '/') + '/../test'"` | |
|
36 | hg pull -q "$URL" | |
|
77 | ||
|
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 | |
|
2 | hg init 1 | |
|
3 | echo '[ui]' >> 1/.hg/hgrc | |
|
4 | echo 'timeout = 10' >> 1/.hg/hgrc | |
|
5 | echo foo > 1/foo | |
|
6 | hg --cwd 1 ci -A -m foo | |
|
7 | hg clone 1 2 | |
|
8 | hg clone 2 3 | |
|
9 | echo '[hooks]' >> 2/.hg/hgrc | |
|
10 | echo 'changegroup.push = hg push -qf ../1' >> 2/.hg/hgrc | |
|
11 | echo bar >> 3/foo | |
|
12 | hg --cwd 3 ci -m bar | |
|
13 | hg --cwd 3 push ../2 | |
|
1 | $ hg init 1 | |
|
2 | ||
|
3 | $ echo '[ui]' >> 1/.hg/hgrc | |
|
4 | $ echo 'timeout = 10' >> 1/.hg/hgrc | |
|
5 | ||
|
6 | $ echo foo > 1/foo | |
|
7 | $ hg --cwd 1 ci -A -m foo | |
|
8 | adding foo | |
|
9 | ||
|
10 | $ hg clone 1 2 | |
|
11 | updating to branch default | |
|
12 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
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 | |
|
4 | cd test | |
|
5 | cat >>afile <<EOF | |
|
6 | 0 | |
|
7 | EOF | |
|
8 | hg add afile | |
|
9 | hg commit -m "0.0" | |
|
10 | cat >>afile <<EOF | |
|
11 | 1 | |
|
12 | EOF | |
|
13 | hg commit -m "0.1" | |
|
14 | cat >>afile <<EOF | |
|
15 | 2 | |
|
16 | EOF | |
|
17 | hg commit -m "0.2" | |
|
18 | cat >>afile <<EOF | |
|
19 | 3 | |
|
20 | EOF | |
|
21 | hg commit -m "0.3" | |
|
22 | hg update -C 0 | |
|
23 | cat >>afile <<EOF | |
|
24 | 1 | |
|
25 | EOF | |
|
26 | hg commit -m "1.1" | |
|
27 | cat >>afile <<EOF | |
|
28 | 2 | |
|
29 | EOF | |
|
30 | hg commit -m "1.2" | |
|
31 | cat >fred <<EOF | |
|
32 | a line | |
|
33 | EOF | |
|
34 | cat >>afile <<EOF | |
|
35 | 3 | |
|
36 | EOF | |
|
37 | hg add fred | |
|
38 | hg commit -m "1.3" | |
|
39 | hg mv afile adifferentfile | |
|
40 | hg commit -m "1.3m" | |
|
41 | hg update -C 3 | |
|
42 | hg mv afile anotherfile | |
|
43 | hg commit -m "0.3m" | |
|
44 | hg debugindex .hg/store/data/afile.i | |
|
45 | hg debugindex .hg/store/data/adifferentfile.i | |
|
46 | hg debugindex .hg/store/data/anotherfile.i | |
|
47 | hg debugindex .hg/store/data/fred.i | |
|
48 | hg debugindex .hg/store/00manifest.i | |
|
49 | hg verify | |
|
50 | cd .. | |
|
51 | for i in 0 1 2 3 4 5 6 7 8; do | |
|
52 | mkdir test-"$i" | |
|
53 | hg --cwd test-"$i" init | |
|
54 | hg -R test push -r "$i" test-"$i" | |
|
55 | cd test-"$i" | |
|
56 | hg verify | |
|
57 | cd .. | |
|
58 | done | |
|
59 | cd test-8 | |
|
60 | hg pull ../test-7 | |
|
61 | hg verify | |
|
105 | pushing to test-0 | |
|
106 | searching for changes | |
|
107 | adding changesets | |
|
108 | adding manifests | |
|
109 | adding file changes | |
|
110 | added 1 changesets with 1 changes to 1 files | |
|
111 | checking changesets | |
|
112 | checking manifests | |
|
113 | crosschecking files in changesets and manifests | |
|
114 | checking files | |
|
115 | 1 files, 1 changesets, 1 total revisions | |
|
116 | ||
|
117 | pushing to test-1 | |
|
118 | searching for changes | |
|
119 | adding changesets | |
|
120 | adding manifests | |
|
121 | adding file changes | |
|
122 | added 2 changesets with 2 changes to 1 files | |
|
123 | checking changesets | |
|
124 | checking manifests | |
|
125 | crosschecking files in changesets and manifests | |
|
126 | checking files | |
|
127 | 1 files, 2 changesets, 2 total revisions | |
|
128 | ||
|
129 | pushing to test-2 | |
|
130 | searching for changes | |
|
131 | adding changesets | |
|
132 | adding manifests | |
|
133 | adding file changes | |
|
134 | added 3 changesets with 3 changes to 1 files | |
|
135 | checking changesets | |
|
136 | checking manifests | |
|
137 | crosschecking files in changesets and manifests | |
|
138 | checking files | |
|
139 | 1 files, 3 changesets, 3 total revisions | |
|
140 | ||
|
141 | pushing to test-3 | |
|
142 | searching for changes | |
|
143 | adding changesets | |
|
144 | adding manifests | |
|
145 | adding file changes | |
|
146 | added 4 changesets with 4 changes to 1 files | |
|
147 | checking changesets | |
|
148 | checking manifests | |
|
149 | crosschecking files in changesets and manifests | |
|
150 | checking files | |
|
151 | 1 files, 4 changesets, 4 total revisions | |
|
152 | ||
|
153 | pushing to test-4 | |
|
154 | searching for changes | |
|
155 | adding changesets | |
|
156 | adding manifests | |
|
157 | adding file changes | |
|
158 | added 2 changesets with 2 changes to 1 files | |
|
159 | checking changesets | |
|
160 | checking manifests | |
|
161 | crosschecking files in changesets and manifests | |
|
162 | checking files | |
|
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 | |
|
4 | cd test | |
|
5 | cat > .hg/hgrc <<EOF | |
|
6 | [server] | |
|
7 | validate=1 | |
|
8 | EOF | |
|
9 | echo alpha > alpha | |
|
10 | echo beta > beta | |
|
11 | hg addr | |
|
12 | hg ci -m 1 | |
|
27 | Expected to fail: | |
|
28 | ||
|
29 | $ hg verify | |
|
30 | checking changesets | |
|
31 | checking manifests | |
|
32 | crosschecking files in changesets and manifests | |
|
33 | checking files | |
|
34 | beta@1: dddc47b3ba30 in manifests not found | |
|
35 | 2 files, 2 changesets, 2 total revisions | |
|
36 | 1 integrity errors encountered! | |
|
37 | (first damaged changeset appears to be 1) | |
|
13 | 38 | |
|
14 | cd .. | |
|
15 | hg clone test test-clone | |
|
39 | Expected to fail: | |
|
16 | 40 | |
|
17 | cd test-clone | |
|
18 | cp .hg/store/data/beta.i tmp | |
|
19 | echo blah >> beta | |
|
20 | hg ci -m '2 (corrupt)' | |
|
21 | mv tmp .hg/store/data/beta.i | |
|
22 | hg push 2>&1 | "$TESTDIR/filtertmp.py" | |
|
41 | $ hg push | |
|
42 | pushing to .* | |
|
43 | searching for changes | |
|
44 | adding changesets | |
|
45 | adding manifests | |
|
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 | echo "graphlog=" >> $HGRCPATH | |
|
4 | $ mkdir a | |
|
5 | $ cd a | |
|
6 | $ hg init | |
|
7 | $ echo foo > t1 | |
|
8 | $ hg add t1 | |
|
9 | $ hg commit -m "1" | |
|
5 | 10 | |
|
6 | mkdir a | |
|
7 | cd a | |
|
8 | hg init | |
|
9 | echo foo > t1 | |
|
10 | hg add t1 | |
|
11 | hg commit -m "1" | |
|
11 | $ cd .. | |
|
12 | $ hg clone a b | |
|
13 | updating to branch default | |
|
14 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
15 | ||
|
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 .. | |
|
14 | hg clone a b | |
|
26 | $ hg push ../a | |
|
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 | |
|
17 | echo foo > t2 | |
|
18 | hg add t2 | |
|
19 | hg commit -m "2" | |
|
32 | $ hg pull ../a | |
|
33 | pulling from ../a | |
|
34 | searching for changes | |
|
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 | |
|
22 | echo foo > t3 | |
|
23 | hg add t3 | |
|
24 | hg commit -m "3" | |
|
41 | $ hg push ../a | |
|
42 | pushing to ../a | |
|
43 | searching for changes | |
|
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 | |
|
27 |
|
|
|
28 |
|
|
|
29 | hg merge | |
|
30 | hg commit -m "4" | |
|
31 | hg push ../a | |
|
32 | cd .. | |
|
51 | $ hg commit -m "4" | |
|
52 | $ hg push ../a | |
|
53 | pushing to ../a | |
|
54 | searching for changes | |
|
55 | adding changesets | |
|
56 | adding manifests | |
|
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 | |
|
35 | cd c | |
|
36 | for i in 0 1 2; do | |
|
37 | echo $i >> foo | |
|
38 |
hg ci - |
|
|
39 | done | |
|
40 | cd .. | |
|
75 | $ cd d | |
|
76 | $ for i in 0 1; do | |
|
77 | > hg co -C $i | |
|
78 | > echo d-$i >> foo | |
|
79 | > hg ci -m d-$i | |
|
80 | > done | |
|
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 | |
|
43 | cd d | |
|
44 | for i in 0 1; do | |
|
45 | hg co -C $i | |
|
46 | echo d-$i >> foo | |
|
47 | hg ci -m d-$i | |
|
48 | done | |
|
93 | $ hg push ../c; echo $? | |
|
94 | pushing to ../c | |
|
95 | searching for changes | |
|
96 | abort: push creates new remote heads on branch 'default'! | |
|
97 | (did you forget to merge? use push -f to force) | |
|
98 | 255 | |
|
49 | 99 | |
|
50 | HGMERGE=true hg merge 3 | |
|
51 | hg ci -m c-d | |
|
100 | $ hg push -r 2 ../c; echo $? | |
|
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 $? | |
|
54 | hg push -r 2 ../c; echo $? | |
|
55 | hg push -r 3 ../c; echo $? | |
|
56 | hg push -r 3 -r 4 ../c; echo $? | |
|
57 | hg push -f -r 3 -r 4 ../c; echo $? | |
|
58 | hg push -r 5 ../c; echo $? | |
|
59 | hg in ../c | |
|
113 | $ hg push -r 3 -r 4 ../c; echo $? | |
|
114 | pushing to ../c | |
|
115 | searching for changes | |
|
116 | abort: push creates new remote heads on branch 'default'! | |
|
117 | (did you forget to merge? use push -f to force) | |
|
118 | 255 | |
|
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 | |
|
62 | hg init ../e | |
|
63 | hg push -r 0 ../e ; echo $? | |
|
64 | hg push -r 1 ../e ; echo $? | |
|
138 | $ hg in ../c | |
|
139 | comparing with ../c | |
|
140 | searching for changes | |
|
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 | |
|
69 | hg init f | |
|
70 | cd f | |
|
71 | hg -q branch a | |
|
72 | echo 0 > foo | |
|
73 | hg -q ci -Am 0 | |
|
74 | echo 1 > foo | |
|
75 | hg -q ci -m 1 | |
|
76 | hg -q up 0 | |
|
77 | echo 2 > foo | |
|
78 | hg -q ci -m 2 | |
|
79 | hg -q up 0 | |
|
80 | hg -q branch b | |
|
81 | echo 3 > foo | |
|
82 | hg -q ci -m 3 | |
|
83 | cd .. | |
|
170 | $ hg init f | |
|
171 | $ cd f | |
|
172 | $ hg -q branch a | |
|
173 | $ echo 0 > foo | |
|
174 | $ hg -q ci -Am 0 | |
|
175 | $ echo 1 > foo | |
|
176 | $ hg -q ci -m 1 | |
|
177 | $ hg -q up 0 | |
|
178 | $ echo 2 > foo | |
|
179 | $ hg -q ci -m 2 | |
|
180 | $ hg -q up 0 | |
|
181 | $ hg -q branch b | |
|
182 | $ echo 3 > foo | |
|
183 | $ hg -q ci -m 3 | |
|
184 | $ 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 | |
|
86 | cd g | |
|
191 | $ hg -q up 1 | |
|
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 | |
|
89 | hg -q up 1 | |
|
90 | echo 4 > foo | |
|
91 | hg -q ci -m 4 | |
|
92 | hg -q up 0 | |
|
93 | echo 5 > foo | |
|
94 | hg -q branch c | |
|
95 | hg -q ci -m 5 | |
|
96 | hg push ../f; echo $? | |
|
97 | hg push -r 4 -r 5 ../f; echo $? | |
|
206 | $ hg push -r 4 -r 5 ../f; echo $? | |
|
207 | pushing to ../f | |
|
208 | searching for changes | |
|
209 | abort: push creates new remote branches: c! | |
|
210 | (use 'hg push --new-branch' to create new remote branches) | |
|
211 | 255 | |
|
212 | ||
|
213 | ||
|
214 | Multiple new branches: | |
|
98 | 215 | |
|
99 | echo % multiple new branches | |
|
100 | hg -q branch d | |
|
101 | echo 6 > foo | |
|
102 | hg -q ci -m 6 | |
|
103 | hg push ../f; echo $? | |
|
104 | hg push -r 4 -r 6 ../f; echo $? | |
|
105 | cd ../g | |
|
216 | $ hg -q branch d | |
|
217 | $ echo 6 > foo | |
|
218 | $ hg -q ci -m 6 | |
|
219 | ||
|
220 | $ hg push ../f; echo $? | |
|
221 | pushing to ../f | |
|
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 | |
|
108 | hg -q up 1 | |
|
109 | echo 7 > foo | |
|
110 | hg -q ci -m 7 | |
|
111 | hg push -r 4 -r 7 ../f; echo $? | |
|
227 | $ hg push -r 4 -r 6 ../f; echo $? | |
|
228 | pushing to ../f | |
|
229 | searching for changes | |
|
230 | abort: push creates new remote branches: c, d! | |
|
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 | |
|
114 | hg -q up 3 | |
|
115 | echo 8 > foo | |
|
116 | hg -q ci -m 8 | |
|
117 | hg push -r 7 -r 8 ../f; echo $? | |
|
256 | $ hg push -r 7 -r 8 ../f; echo $? | |
|
257 | pushing to ../f | |
|
258 | searching for changes | |
|
259 | adding changesets | |
|
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 | |
|
120 | hg -q up 7 | |
|
121 | HGMERGE=true hg -q merge 8 | |
|
122 | hg -q ci -m 9 | |
|
123 | hg -q up 8 | |
|
124 | echo 10 > foo | |
|
125 | hg -q ci -m 10 | |
|
126 | hg push -r 9 ../f; echo $? | |
|
127 | hg push -r 10 ../f; echo $? | |
|
285 | $ hg push -r 10 ../f; echo $? | |
|
286 | pushing to ../f | |
|
287 | searching for changes | |
|
288 | adding changesets | |
|
289 | adding manifests | |
|
290 | adding file changes | |
|
291 | added 1 changesets with 1 changes to 1 files (+1 heads) | |
|
292 | 0 | |
|
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 | |
|
130 | hg -q up 9 | |
|
131 | HGMERGE=true hg -q merge 2 | |
|
132 |
hg -q ci -m 1 |
|
|
133 | hg -q up 1 | |
|
134 |
echo 1 |
|
|
135 | hg -q ci -m 12 | |
|
136 | hg push -r 11 -r 12 ../f; echo $? | |
|
314 | Failed push of new named branch: | |
|
315 | ||
|
316 | $ echo 12 > foo | |
|
317 | $ hg -q ci -m 12a | |
|
318 | $ hg -q up 11 | |
|
319 | $ echo 13 > foo | |
|
320 | $ hg -q branch e | |
|
321 | $ hg -q ci -m 13d | |
|
137 | 322 | |
|
138 | echo % failed push of new named branch | |
|
139 | echo 12 > foo | |
|
140 | hg -q ci -m 12a | |
|
141 | hg -q up 11 | |
|
142 | echo 13 > foo | |
|
143 | hg -q branch e | |
|
144 | hg -q ci -m 13d | |
|
145 | hg push -r 12 -r 13 ../f; echo $? | |
|
323 | $ hg push -r 12 -r 13 ../f; echo $? | |
|
324 | pushing to ../f | |
|
325 | searching for changes | |
|
326 | abort: push creates new remote branches: e! | |
|
327 | (use 'hg push --new-branch' to create new remote branches) | |
|
328 | 255 | |
|
329 | ||
|
330 | ||
|
331 | Using --new-branch to push new named branch: | |
|
146 | 332 | |
|
147 | echo % using --new-branch to push new named branch | |
|
148 | hg push --new-branch -r 12 -r 13 ../f; echo $? | |
|
333 | $ 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 |
|
|
|
151 | cd .. | |
|
152 | hg init h | |
|
153 | echo init > h/init | |
|
154 | hg -R h ci -Am init | |
|
155 | echo a > h/a | |
|
156 |
hg -R h ci -Am |
|
|
157 | hg clone h i | |
|
158 | hg -R h up 0 | |
|
159 | echo b > h/b | |
|
160 | hg -R h ci -Am b | |
|
161 | hg -R i up 0 | |
|
162 | echo c > i/c | |
|
163 | hg -R i ci -Am c | |
|
164 | hg -R i push h | |
|
165 | echo | |
|
343 | Checking prepush logic does not allow silently pushing | |
|
344 | multiple new heads: | |
|
345 | ||
|
346 | $ cd .. | |
|
347 | $ hg init h | |
|
348 | $ echo init > h/init | |
|
349 | $ hg -R h ci -Am init | |
|
350 | adding init | |
|
351 | $ echo a > h/a | |
|
352 | $ hg -R h ci -Am a | |
|
353 | adding a | |
|
354 | $ hg clone h i | |
|
355 | updating to branch default | |
|
356 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
357 | $ hg -R h up 0 | |
|
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 | |
|
168 | hg init j | |
|
169 | hg -R j branch a | |
|
170 | echo init > j/foo | |
|
171 | hg -R j ci -Am init | |
|
172 | hg clone j k | |
|
173 | echo a1 > j/foo | |
|
174 | hg -R j ci -m a1 | |
|
175 | hg -R k branch b | |
|
176 | echo b > k/foo | |
|
177 | hg -R k ci -m b | |
|
178 | hg -R k up 0 | |
|
179 | hg -R k merge b | |
|
180 |
hg -R |
|
|
181 | hg -R k push -r a j | |
|
182 | echo | |
|
370 | $ hg -R i push h | |
|
371 | pushing to h | |
|
372 | searching for changes | |
|
373 | abort: push creates new remote heads on branch 'default'! | |
|
374 | (you should pull and merge or use push -f to force) | |
|
375 | ||
|
376 | ||
|
377 | Check prepush logic with merged branches: | |
|
378 | ||
|
379 | $ hg init j | |
|
380 | $ hg -R j branch a | |
|
381 | marked working directory as branch a | |
|
382 | $ echo init > j/foo | |
|
383 | $ hg -R j ci -Am init | |
|
384 | adding foo | |
|
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 | |
|
185 | hg init l | |
|
186 | cd l | |
|
187 | echo a >> foo | |
|
188 | hg -q add foo | |
|
189 | hg -q branch a | |
|
190 | hg -q ci -ma | |
|
191 | hg -q up null | |
|
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 .. | |
|
403 | $ hg -R k push -r a j | |
|
404 | pushing to j | |
|
405 | searching for changes | |
|
406 | abort: push creates new remote branches: b! | |
|
407 | (use 'hg push --new-branch' to create new remote branches) | |
|
408 | ||
|
409 | ||
|
410 | Prepush -r should not allow you to sneak in new heads: | |
|
212 | 411 | |
|
213 | echo % check prepush with new branch head on former topo non-head | |
|
214 | hg init n | |
|
215 | cd n | |
|
216 | hg branch A | |
|
217 | echo a >a | |
|
218 |
hg ci - |
|
|
219 | hg branch B | |
|
220 | echo b >b | |
|
221 | hg ci -Amb | |
|
412 | $ hg init l | |
|
413 | $ cd l | |
|
414 | $ echo a >> foo | |
|
415 | $ hg -q add foo | |
|
416 | $ hg -q branch a | |
|
417 | $ hg -q ci -ma | |
|
418 | $ hg -q up null | |
|
419 | $ echo a >> foo | |
|
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 | 462 | # b is now branch head of B, and a topological head |
|
223 | 463 | # a is now branch head of A, but not a topological head |
|
224 | hg clone . inner | |
|
225 | cd inner | |
|
226 | hg up B | |
|
227 | echo b1 >b1 | |
|
228 | hg ci -Amb1 | |
|
464 | ||
|
465 | $ hg clone . inner | |
|
466 | updating to branch B | |
|
467 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
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 | 475 | # in the clone b1 is now the head of B |
|
230 | cd .. | |
|
231 | hg up 0 | |
|
232 | echo a2 >a2 | |
|
233 | hg ci -Ama2 | |
|
476 | ||
|
477 | $ cd .. | |
|
478 | $ hg up 0 | |
|
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 | 484 | # a2 is now the new branch head of A, and a new topological head |
|
235 | 485 | # it replaces a former inner branch head, so it should at most warn about A, not B |
|
236 | echo %% glog of local | |
|
237 | hg glog --template "{rev}: {branches} {desc}\n" | |
|
238 | echo %% glog of remote | |
|
239 |
hg glog |
|
|
240 | echo %% outgoing | |
|
241 | hg out inner --template "{rev}: {branches} {desc}\n" | |
|
242 | hg push inner | |
|
243 | cd .. | |
|
486 | ||
|
487 | glog of local: | |
|
488 | ||
|
489 | $ hg glog --template "{rev}: {branches} {desc}\n" | |
|
490 | @ 2: A a2 | |
|
491 | | | |
|
492 | | o 1: B b | |
|
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 | |
|
246 | hg init o | |
|
247 | cd o | |
|
248 | hg branch A | |
|
249 | echo a >a | |
|
250 | hg ci -Ama | |
|
251 | hg branch B | |
|
252 | echo b >b | |
|
253 | hg ci -Amb | |
|
525 | $ hg init o | |
|
526 | $ cd o | |
|
527 | $ hg branch A | |
|
528 | marked working directory as branch A | |
|
529 | $ echo a >a | |
|
530 | $ hg ci -Ama | |
|
531 | adding a | |
|
532 | $ hg branch B | |
|
533 | marked working directory as branch B | |
|
534 | $ echo b >b | |
|
535 | $ hg ci -Amb | |
|
536 | adding b | |
|
537 | ||
|
254 | 538 | # b is now branch head of B, and a topological head |
|
255 | hg up 0 | |
|
256 | echo a1 >a1 | |
|
257 | hg ci -Ama1 | |
|
539 | ||
|
540 | $ hg up 0 | |
|
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 | 546 | # a1 is now branch head of A, and a topological head |
|
259 | hg clone . inner | |
|
260 | cd inner | |
|
261 | hg up B | |
|
262 | echo b1 >b1 | |
|
263 | hg ci -Amb1 | |
|
547 | ||
|
548 | $ hg clone . inner | |
|
549 | updating to branch A | |
|
550 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
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 | 558 | # in the clone b1 is now the head of B |
|
265 | cd .. | |
|
266 | echo a2 >a2 | |
|
267 | hg ci -Ama2 | |
|
559 | ||
|
560 | $ cd .. | |
|
561 | $ echo a2 >a2 | |
|
562 | $ hg ci -Ama2 | |
|
563 | adding a2 | |
|
564 | ||
|
268 | 565 | # a2 is now the new branch head of A, and a topological head |
|
269 | 566 | # it replaces a former topological and branch head, so this should not warn |
|
270 | echo %% glog of local | |
|
271 | hg glog --template "{rev}: {branches} {desc}\n" | |
|
272 | echo %% glog of remote | |
|
273 |
hg glog |
|
|
274 | echo %% outgoing | |
|
275 | hg out inner --template "{rev}: {branches} {desc}\n" | |
|
276 | hg push inner | |
|
277 | cd .. | |
|
567 | ||
|
568 | glog of local: | |
|
569 | ||
|
570 | $ hg glog --template "{rev}: {branches} {desc}\n" | |
|
571 | @ 3: A a2 | |
|
572 | | | |
|
573 | o 2: A a1 | |
|
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 | |
|
280 | echo % but child is on different branch | |
|
281 | hg init p | |
|
282 | cd p | |
|
283 | hg branch A | |
|
284 | echo a0 >a | |
|
285 | hg ci -Ama0 | |
|
286 | echo a1 >a | |
|
287 | hg ci -ma1 | |
|
288 | hg up null | |
|
289 | hg branch B | |
|
290 |
echo b |
|
|
291 |
hg ci - |
|
|
292 | echo b1 >b | |
|
293 | hg ci -mb1 | |
|
634 | $ hg up A | |
|
635 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
|
636 | $ hg branch -f B | |
|
637 | marked working directory as branch B | |
|
638 | $ echo a3 >a | |
|
639 | $ hg ci -ma3 | |
|
640 | created new head | |
|
641 | $ hg up 3 | |
|
642 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
|
643 | $ hg branch -f A | |
|
644 | marked working directory as branch A | |
|
645 | $ echo b3 >b | |
|
646 | $ hg ci -mb3 | |
|
647 | created new head | |
|
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 | |
|
298 | hg branch -f B | |
|
299 | echo a3 >a | |
|
300 | hg ci -ma3 | |
|
301 | hg up 3 | |
|
302 | hg branch -f A | |
|
303 | echo b3 >b | |
|
304 | hg ci -mb3 | |
|
666 | $ hg glog -R inner --template "{rev}: {branches} {desc}\n" | |
|
667 | @ 3: B b1 | |
|
668 | | | |
|
669 | o 2: B b0 | |
|
670 | ||
|
671 | o 1: A a1 | |
|
672 | | | |
|
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 | |
|
307 | hg glog --template "{rev}: {branches} {desc}\n" | |
|
308 | echo %% glog of remote | |
|
309 | hg glog -R inner --template "{rev}: {branches} {desc}\n" | |
|
310 | echo %% outgoing | |
|
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 .. | |
|
683 | $ hg push inner | |
|
684 | pushing to inner | |
|
685 | searching for changes | |
|
686 | abort: push creates new remote heads on branch 'A'! | |
|
687 | (did you forget to merge? use push -f to force) | |
|
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 | 1 | # Test issue 746: renaming files brought by the |
|
4 | 2 | # second parent of a merge was broken. |
|
5 | 3 | |
|
6 |
|
|
|
7 | hg init t | |
|
8 | cd t | |
|
9 | echo a > a | |
|
10 | hg ci -Am a | |
|
11 | cd .. | |
|
4 | Create source repository: | |
|
5 | ||
|
6 | $ hg init t | |
|
7 | $ cd t | |
|
8 | $ echo a > a | |
|
9 | $ hg ci -Am a | |
|
10 | adding a | |
|
11 | $ cd .. | |
|
12 | ||
|
13 | Fork source repository: | |
|
12 | 14 | |
|
13 | echo % fork source repository | |
|
14 | hg clone t t2 | |
|
15 | cd t2 | |
|
16 | echo b > b | |
|
17 | hg ci -Am b | |
|
15 | $ hg clone t t2 | |
|
16 | updating to branch default | |
|
17 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
18 | $ cd t2 | |
|
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 | |
|
20 | cd ../t | |
|
21 | echo a >> a | |
|
22 | hg ci -m a2 | |
|
31 | $ hg pull ../t2 | |
|
32 | pulling from ../t2 | |
|
33 | searching for changes | |
|
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 | |
|
25 | hg pull ../t2 | |
|
26 | hg merge | |
|
27 | hg st | |
|
44 | $ hg st | |
|
45 | M b | |
|
46 | ||
|
47 | Rename b as c: | |
|
28 | 48 | |
|
29 | echo % rename b as c | |
|
30 | hg mv b c | |
|
31 | hg st | |
|
32 | echo % rename back c as b | |
|
33 | hg mv c b | |
|
34 | hg st | |
|
35 | cd .. | |
|
49 | $ hg mv b c | |
|
50 | $ hg st | |
|
51 | A c | |
|
52 | R b | |
|
53 | ||
|
54 | Rename back c as b: | |
|
55 | ||
|
56 | $ hg mv c b | |
|
57 | $ hg st | |
|
58 | M b | |
|
59 | ||
|
60 | $ cd .. | |
|
36 | 61 | |
|
37 | 62 | # Test issue 1476: renaming a first parent file into |
|
38 | 63 | # another first parent file while none of them belong to |
|
39 | 64 | # the second parent was broken |
|
40 | echo % test issue 1476 | |
|
41 | hg init repo1476 | |
|
42 | cd repo1476 | |
|
43 | echo a > a | |
|
44 | hg ci -Am adda | |
|
45 | echo b1 > b1 | |
|
46 |
echo b |
|
|
47 | hg ci -Am changea | |
|
48 | hg up -C 0 | |
|
49 | echo c1 > c1 | |
|
50 | echo c2 > c2 | |
|
51 | hg ci -Am addcandd | |
|
52 | echo % merge heads | |
|
53 | hg merge | |
|
54 | hg mv -Af c1 c2 | |
|
55 | echo % commit issue 1476 | |
|
56 | hg ci -m merge | |
|
57 | hg log -r tip -C -v | grep copies | |
|
58 | hg rollback | |
|
59 | hg up -C . | |
|
60 | echo % merge heads again | |
|
61 | hg merge | |
|
62 | hg mv -Af b1 b2 | |
|
63 | echo % commit issue 1476 with a rename on the other side | |
|
64 | hg ci -m merge | |
|
65 | hg log -r tip -C -v | grep copies | |
|
65 | ||
|
66 | $ hg init repo1476 | |
|
67 | $ cd repo1476 | |
|
68 | $ echo a > a | |
|
69 | $ hg ci -Am adda | |
|
70 | adding a | |
|
71 | $ echo b1 > b1 | |
|
72 | $ echo b2 > b2 | |
|
73 | $ hg ci -Am changea | |
|
74 | adding b1 | |
|
75 | adding b2 | |
|
76 | $ hg up -C 0 | |
|
77 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
|
78 | $ echo c1 > c1 | |
|
79 | $ echo c2 > c2 | |
|
80 | $ hg ci -Am addcandd | |
|
81 | adding c1 | |
|
82 | adding c2 | |
|
83 | created new head | |
|
84 | ||
|
85 | Merge heads: | |
|
86 | ||
|
87 | $ hg merge | |
|
88 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
89 | (branch merge, don't forget to commit) | |
|
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 | |
|
6 | cd test | |
|
7 | echo foo>foo | |
|
8 | hg init | |
|
9 | hg addremove | |
|
10 | hg commit -m "1" | |
|
11 | hg verify | |
|
11 | $ hg verify | |
|
12 | checking changesets | |
|
13 | checking manifests | |
|
14 | crosschecking files in changesets and manifests | |
|
15 | checking files | |
|
16 | 1 files, 1 changesets, 1 total revisions | |
|
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 | |
|
14 | cd ../branch | |
|
15 | hg co | |
|
16 | echo bar>>foo | |
|
17 | hg commit -m "2" | |
|
27 | $ cd ../test | |
|
28 | ||
|
29 | $ hg pull ../branch | |
|
30 | pulling from ../branch | |
|
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 | |
|
20 | hg pull ../branch | |
|
21 | hg verify | |
|
22 | hg co | |
|
23 | cat foo | |
|
24 | hg manifest --debug | |
|
38 | $ hg verify | |
|
39 | checking changesets | |
|
40 | checking manifests | |
|
41 | crosschecking files in changesets and manifests | |
|
42 | checking files | |
|
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 | |
|
4 | cd a | |
|
5 | hg init | |
|
6 | echo 123 > a | |
|
7 | hg add a | |
|
8 | hg commit -m "a" -u a | |
|
8 | $ cd .. | |
|
9 | $ mkdir b | |
|
10 | $ cd b | |
|
11 | $ hg init | |
|
12 | $ echo 321 > b | |
|
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 .. | |
|
11 | mkdir b | |
|
12 | cd b | |
|
13 | hg init | |
|
14 | echo 321 > b | |
|
15 | hg add b | |
|
16 | hg commit -m "b" -u b | |
|
21 | $ hg pull -f ../a | |
|
22 | pulling from ../a | |
|
23 | searching for changes | |
|
24 | warning: repository is unrelated | |
|
25 | adding changesets | |
|
26 | adding manifests | |
|
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 | |
|
19 | hg pull -f ../a | |
|
20 | hg heads | |
|
31 | $ hg heads | |
|
32 | changeset: 1:9a79c33a9db3 | |
|
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 | 1 | # Construct the following history tree: |
|
4 | 2 | # |
|
5 | 3 | # @ 5:e1bb631146ca b1 |
@@ -14,68 +12,119 b'' | |||
|
14 | 12 | # |/ |
|
15 | 13 | # o 0:b608b9236435 |
|
16 | 14 | |
|
17 | hg init | |
|
18 | echo foo > foo | |
|
19 | echo zero > a | |
|
20 | hg ci -qAm0 | |
|
21 | echo one > a ; hg ci -m1 | |
|
22 | echo two > a ; hg ci -m2 | |
|
23 | hg up -q 1 | |
|
24 | echo three > a ; hg ci -qm3 | |
|
25 | hg up -q 0 | |
|
26 | hg branch -q b1 | |
|
27 | echo four > a ; hg ci -qm4 | |
|
28 | echo five > a ; hg ci -qm5 | |
|
15 | $ hg init | |
|
16 | $ echo foo > foo | |
|
17 | $ echo zero > a | |
|
18 | $ hg ci -qAm0 | |
|
19 | $ echo one > a ; hg ci -m1 | |
|
20 | $ echo two > a ; hg ci -m2 | |
|
21 | $ hg up -q 1 | |
|
22 | $ echo three > a ; hg ci -qm3 | |
|
23 | $ hg up -q 0 | |
|
24 | $ hg branch -q b1 | |
|
25 | $ echo four > a ; hg ci -qm4 | |
|
26 | $ echo five > a ; hg ci -qm5 | |
|
29 | 27 | |
|
30 |
|
|
|
31 | echo | |
|
32 | hg --config 'extensions.graphlog=' \ | |
|
33 | glog --template '{rev}:{node|short} {parents} {branches}\n' | |
|
34 | ||
|
35 | # Test helper functions. | |
|
28 | Initial repo state: | |
|
36 | 29 | |
|
37 | revtest () { | |
|
38 | msg=$1 | |
|
39 | dirtyflag=$2 # 'clean' or 'dirty' | |
|
40 | startrev=$3 | |
|
41 | targetrev=$4 | |
|
42 | opt=$5 | |
|
43 | echo % revtest $msg $startrev $targetrev | |
|
44 | hg up -qC $startrev | |
|
45 | test $dirtyflag = dirty && echo dirty > foo | |
|
46 | hg up $opt $targetrev | |
|
47 | hg parent --template 'parent={rev}\n' | |
|
48 | hg stat | |
|
49 | } | |
|
30 | $ hg --config 'extensions.graphlog=' \ | |
|
31 | > glog --template '{rev}:{node|short} {parents} {branches}\n' | |
|
32 | @ 5:e1bb631146ca b1 | |
|
33 | | | |
|
34 | o 4:a4fdb3b883c4 0:b608b9236435 b1 | |
|
35 | | | |
|
36 | | o 3:4b57d2520816 1:44592833ba9f | |
|
37 | | | | |
|
38 | | | o 2:063f31070f65 | |
|
39 | | |/ | |
|
40 | | o 1:44592833ba9f | |
|
41 | |/ | |
|
42 | o 0:b608b9236435 | |
|
43 | ||
|
44 | ||
|
45 | Test helper functions: | |
|
50 | 46 | |
|
51 |
|
|
|
52 | msg=$1 | |
|
53 | dirtyflag=$2 # 'clean' or 'dirty' | |
|
54 | startrev=$3 | |
|
55 | opt=$4 | |
|
56 | echo % norevtest $msg $startrev | |
|
57 | hg up -qC $startrev | |
|
58 | test $dirtyflag = dirty && echo dirty > foo | |
|
59 | hg up $opt | |
|
60 | hg parent --template 'parent={rev}\n' | |
|
61 | hg stat | |
|
62 | } | |
|
47 | $ revtest () { | |
|
48 | > msg=$1 | |
|
49 | > dirtyflag=$2 # 'clean' or 'dirty' | |
|
50 | > startrev=$3 | |
|
51 | > targetrev=$4 | |
|
52 | > opt=$5 | |
|
53 | > hg up -qC $startrev | |
|
54 | > test $dirtyflag = dirty && echo dirty > foo | |
|
55 | > hg up $opt $targetrev | |
|
56 | > hg parent --template 'parent={rev}\n' | |
|
57 | > hg stat | |
|
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 | 72 | # Test cases are documented in a table in the update function of merge.py. |
|
65 | 73 | # Cases are run as shown in that table, row by row. |
|
66 | 74 | |
|
67 | norevtest 'none clean linear' clean 4 | |
|
68 | norevtest 'none clean same' clean 2 | |
|
75 | $ norevtest 'none clean linear' clean 4 | |
|
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 |
|
|
71 | revtest 'none clean same' clean 2 3 | |
|
72 | revtest 'none clean cross' clean 3 4 | |
|
88 | $ revtest 'none clean same' clean 2 3 | |
|
89 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
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 |
|
|
75 | revtest 'none dirty same' dirty 2 3 | |
|
76 | revtest 'none dirty cross' dirty 3 4 | |
|
102 | $ revtest 'none dirty same' dirty 2 3 | |
|
103 | abort: crosses branches (use 'hg merge' to merge or use 'hg update -C' to discard changes) | |
|
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 '- |
|
|
79 | revtest '-c dirty linear' dirty 1 2 -c | |
|
80 | norevtest '-c clean same' clean 2 -c | |
|
81 | revtest '-cC dirty linear' dirty 1 2 -cC | |
|
117 | $ revtest '-c dirty linear' dirty 1 2 -c | |
|
118 | abort: uncommitted local changes | |
|
119 | parent=1 | |
|
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 | |
|
2 | ||
|
3 | rm -rf a | |
|
4 | hg init a | |
|
5 | cd a | |
|
1 | $ rm -rf a | |
|
2 | $ hg init a | |
|
3 | $ cd a | |
|
6 | 4 | |
|
7 | echo foo > foo | |
|
8 | hg ci -qAm0 | |
|
9 | chmod +x foo | |
|
10 | hg ci -m1 | |
|
11 | hg co -q 0 | |
|
12 | echo dirty > foo | |
|
13 | hg up -c | |
|
14 | hg up -q | |
|
15 | cat foo | |
|
16 | hg st -A | |
|
5 | $ echo foo > foo | |
|
6 | $ hg ci -qAm0 | |
|
7 | $ chmod +x foo | |
|
8 | $ hg ci -m1 | |
|
9 | $ hg co -q 0 | |
|
10 | $ echo dirty > foo | |
|
11 | $ hg up -c | |
|
12 | abort: uncommitted local changes | |
|
13 | $ hg up -q | |
|
14 | $ cat foo | |
|
15 | dirty | |
|
16 | $ hg st -A | |
|
17 | M foo | |
|
17 | 18 | |
|
18 |
|
|
|
19 | hg up -C 0 | |
|
20 | chmod -x foo | |
|
21 | hg ci -m removeexec | |
|
22 | hg up -C 0 | |
|
23 | hg up | |
|
24 | hg st | |
|
19 | Validate update of standalone execute bit change: | |
|
20 | ||
|
21 | $ hg up -C 0 | |
|
22 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
23 | $ chmod -x foo | |
|
24 | $ hg ci -m removeexec | |
|
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 | |
|
4 | touch a | |
|
5 | hg add a | |
|
6 | hg commit -m "Added a" | |
|
7 | $ touch main | |
|
8 | $ hg add main | |
|
9 | $ hg commit -m "Added main" | |
|
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 | |
|
9 | hg add main | |
|
10 |
hg commit -m "Added |
|
|
11 | hg checkout 0 | |
|
18 | $ touch side1 | |
|
19 | $ hg add side1 | |
|
20 | $ hg commit -m "Added side1" | |
|
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 | |
|
14 | ls | |
|
26 | $ hg log | |
|
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 | |
|
17 | hg add side1 | |
|
18 | hg commit -m "Added side1" | |
|
19 | touch side2 | |
|
20 | hg add side2 | |
|
21 | hg commit -m "Added side2" | |
|
44 | changeset: 0:c2eda428b523 | |
|
45 | user: test | |
|
46 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
47 | summary: Added a | |
|
48 | ||
|
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 | |
|
26 | hg heads | |
|
62 | $ ls | |
|
63 | a | |
|
64 | side1 | |
|
65 | side2 | |
|
27 | 66 | |
|
28 | echo Should show "a side1 side2" | |
|
29 | ls | |
|
67 | $ hg update --debug -C 1 | |
|
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 | |
|
32 | echo Should only show "a main" | |
|
33 | ls | |
|
82 | $ ls | |
|
83 | a | |
|
84 | main | |
|
34 | 85 |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now