Show More
@@ -1,66 +1,82 | |||||
1 | #!/bin/sh |
|
1 | #!/bin/sh | |
2 |
|
2 | |||
|
3 | # some implementations of cp can't create hardlinks | |||
|
4 | cat > cp.py <<EOF | |||
|
5 | from mercurial import util | |||
|
6 | import sys | |||
|
7 | util.copyfiles(sys.argv[1], sys.argv[2], hardlink=True) | |||
|
8 | EOF | |||
|
9 | ||||
|
10 | # test hardlinking outside hg | |||
|
11 | mkdir x | |||
|
12 | echo foo > x/a | |||
|
13 | ||||
|
14 | python cp.py x y | |||
|
15 | echo bar >> y/a | |||
|
16 | echo % no diff if hardlink | |||
|
17 | diff x/a y/a | |||
|
18 | ||||
3 | # test mq hardlinking |
|
19 | # test mq hardlinking | |
4 | echo "[extensions]" >> $HGRCPATH |
|
20 | echo "[extensions]" >> $HGRCPATH | |
5 | echo "mq=" >> $HGRCPATH |
|
21 | echo "mq=" >> $HGRCPATH | |
6 |
|
22 | |||
7 | echo % init |
|
23 | echo % init | |
8 | hg init a |
|
24 | hg init a | |
9 | cd a |
|
25 | cd a | |
10 |
|
26 | |||
11 | hg qimport -n foo - << EOF |
|
27 | hg qimport -n foo - << EOF | |
12 | # HG changeset patch |
|
28 | # HG changeset patch | |
13 | # Date 1 0 |
|
29 | # Date 1 0 | |
14 | diff -r 2588a8b53d66 a |
|
30 | diff -r 2588a8b53d66 a | |
15 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
31 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
16 | +++ b/a Wed Jul 23 15:54:29 2008 +0200 |
|
32 | +++ b/a Wed Jul 23 15:54:29 2008 +0200 | |
17 | @@ -0,0 +1,1 @@ |
|
33 | @@ -0,0 +1,1 @@ | |
18 | +a |
|
34 | +a | |
19 | EOF |
|
35 | EOF | |
20 |
|
36 | |||
21 | hg qpush |
|
37 | hg qpush | |
22 |
|
38 | |||
23 | cd .. |
|
39 | cd .. | |
24 | cp -al a b |
|
40 | python cp.py a b | |
25 | cd b |
|
41 | cd b | |
26 |
|
42 | |||
27 | hg qimport -n bar - << EOF |
|
43 | hg qimport -n bar - << EOF | |
28 | # HG changeset patch |
|
44 | # HG changeset patch | |
29 | # Date 2 0 |
|
45 | # Date 2 0 | |
30 | diff -r 2588a8b53d66 a |
|
46 | diff -r 2588a8b53d66 a | |
31 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
47 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
32 | +++ b/b Wed Jul 23 15:54:29 2008 +0200 |
|
48 | +++ b/b Wed Jul 23 15:54:29 2008 +0200 | |
33 | @@ -0,0 +1,1 @@ |
|
49 | @@ -0,0 +1,1 @@ | |
34 | +b |
|
50 | +b | |
35 | EOF |
|
51 | EOF | |
36 |
|
52 | |||
37 | hg qpush |
|
53 | hg qpush | |
38 |
|
54 | |||
39 | cat .hg/patches/status |
|
55 | cat .hg/patches/status | |
40 | echo % |
|
56 | echo % | |
41 | cat .hg/patches/series |
|
57 | cat .hg/patches/series | |
42 | echo %%% |
|
58 | echo %%% | |
43 | cat ../a/.hg/patches/status |
|
59 | cat ../a/.hg/patches/status | |
44 | echo % |
|
60 | echo % | |
45 | cat ../a/.hg/patches/series |
|
61 | cat ../a/.hg/patches/series | |
46 |
|
62 | |||
47 | # test tags hardlinking |
|
63 | # test tags hardlinking | |
48 | hg qdel -r qbase:qtip |
|
64 | hg qdel -r qbase:qtip | |
49 |
|
65 | |||
50 | hg tag -l lfoo |
|
66 | hg tag -l lfoo | |
51 | hg tag foo |
|
67 | hg tag foo | |
52 |
|
68 | |||
53 | cd .. |
|
69 | cd .. | |
54 | cp -al b c |
|
70 | python cp.py b c | |
55 | cd c |
|
71 | cd c | |
56 |
|
72 | |||
57 | hg tag -l -r 0 lbar |
|
73 | hg tag -l -r 0 lbar | |
58 | hg tag -r 0 bar |
|
74 | hg tag -r 0 bar | |
59 | echo %%% |
|
75 | echo %%% | |
60 | cat .hgtags |
|
76 | cat .hgtags | |
61 | echo % |
|
77 | echo % | |
62 | cat .hg/localtags |
|
78 | cat .hg/localtags | |
63 | echo %%% |
|
79 | echo %%% | |
64 | cat ../b/.hgtags |
|
80 | cat ../b/.hgtags | |
65 | echo % |
|
81 | echo % | |
66 | cat ../b/.hg/localtags |
|
82 | cat ../b/.hg/localtags |
@@ -1,26 +1,27 | |||||
|
1 | % no diff if hardlink | |||
1 | % init |
|
2 | % init | |
2 | adding foo to series file |
|
3 | adding foo to series file | |
3 | applying foo |
|
4 | applying foo | |
4 | Now at: foo |
|
5 | Now at: foo | |
5 | adding bar to series file |
|
6 | adding bar to series file | |
6 | applying bar |
|
7 | applying bar | |
7 | Now at: bar |
|
8 | Now at: bar | |
8 | 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo |
|
9 | 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo | |
9 | 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c:bar |
|
10 | 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c:bar | |
10 | % |
|
11 | % | |
11 | foo |
|
12 | foo | |
12 | bar |
|
13 | bar | |
13 | %%% |
|
14 | %%% | |
14 | 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo |
|
15 | 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo | |
15 | % |
|
16 | % | |
16 | foo |
|
17 | foo | |
17 | %%% |
|
18 | %%% | |
18 | 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo |
|
19 | 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo | |
19 | 430ed4828a74fa4047bc816a25500f7472ab4bfe bar |
|
20 | 430ed4828a74fa4047bc816a25500f7472ab4bfe bar | |
20 | % |
|
21 | % | |
21 | 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo |
|
22 | 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo | |
22 | 430ed4828a74fa4047bc816a25500f7472ab4bfe lbar |
|
23 | 430ed4828a74fa4047bc816a25500f7472ab4bfe lbar | |
23 | %%% |
|
24 | %%% | |
24 | 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo |
|
25 | 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo | |
25 | % |
|
26 | % | |
26 | 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo |
|
27 | 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo |
General Comments 0
You need to be logged in to leave comments.
Login now