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