##// END OF EJS Templates
test-relink: remove unnecessary ui.username setting
Martin Geisler -
r13655:c0a700f4 default
parent child Browse files
Show More
@@ -1,88 +1,84 b''
1 $ echo "[extensions]" >> $HGRCPATH
1 $ echo "[extensions]" >> $HGRCPATH
2 $ echo "relink=" >> $HGRCPATH
2 $ echo "relink=" >> $HGRCPATH
3
3
4 $ fix_path() {
4 $ fix_path() {
5 > tr '\\' /
5 > tr '\\' /
6 > }
6 > }
7
7
8 $ cat > arelinked.py <<EOF
8 $ cat > arelinked.py <<EOF
9 > import sys, os
9 > import sys, os
10 > from mercurial import util
10 > from mercurial import util
11 > path1, path2 = sys.argv[1:3]
11 > path1, path2 = sys.argv[1:3]
12 > if util.samefile(path1, path2):
12 > if util.samefile(path1, path2):
13 > print '%s == %s' % (path1, path2)
13 > print '%s == %s' % (path1, path2)
14 > else:
14 > else:
15 > print '%s != %s' % (path1, path2)
15 > print '%s != %s' % (path1, path2)
16 > EOF
16 > EOF
17
17
18
18
19 create source repository
19 create source repository
20
20
21 $ hg init repo
21 $ hg init repo
22 $ cd repo
22 $ cd repo
23 $ echo '[ui]' > .hg/hgrc
24 $ echo 'username= A. Foo <a.foo@bar.com>' >> .hg/hgrc
25 $ echo a > a
23 $ echo a > a
26 $ echo b > b
24 $ echo b > b
27 $ hg ci -Am addfile
25 $ hg ci -Am addfile
28 adding a
26 adding a
29 adding b
27 adding b
30 $ echo a >> a
28 $ echo a >> a
31 $ echo a >> b
29 $ echo a >> b
32 $ hg ci -Am changefiles
30 $ hg ci -Am changefiles
33
31
34 Test files are read in binary mode
32 Test files are read in binary mode
35
33
36 $ python -c "file('.hg/store/data/dummy.i', 'wb').write('a\r\nb\n')"
34 $ python -c "file('.hg/store/data/dummy.i', 'wb').write('a\r\nb\n')"
37 $ cd ..
35 $ cd ..
38
36
39
37
40 clone and pull to break links
38 clone and pull to break links
41
39
42 $ hg clone --pull -r0 repo clone
40 $ hg clone --pull -r0 repo clone
43 adding changesets
41 adding changesets
44 adding manifests
42 adding manifests
45 adding file changes
43 adding file changes
46 added 1 changesets with 2 changes to 2 files
44 added 1 changesets with 2 changes to 2 files
47 updating to branch default
45 updating to branch default
48 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
46 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
49 $ cd clone
47 $ cd clone
50 $ echo '[ui]' >> .hg/hgrc
51 $ echo 'username= A. Baz <a.baz@bar.com>' >> .hg/hgrc
52 $ hg pull -q
48 $ hg pull -q
53 $ echo b >> b
49 $ echo b >> b
54 $ hg ci -m changeb
50 $ hg ci -m changeb
55 created new head
51 created new head
56 $ python -c "file('.hg/store/data/dummy.i', 'wb').write('a\nb\r\n')"
52 $ python -c "file('.hg/store/data/dummy.i', 'wb').write('a\nb\r\n')"
57
53
58
54
59 relink
55 relink
60
56
61 $ hg relink --debug | fix_path
57 $ hg relink --debug | fix_path
62 relinking $TESTTMP/repo/.hg/store to $TESTTMP/clone/.hg/store
58 relinking $TESTTMP/repo/.hg/store to $TESTTMP/clone/.hg/store
63 tip has 2 files, estimated total number of files: 3
59 tip has 2 files, estimated total number of files: 3
64 collecting: 00changelog.i 1/3 files (33.33%)
60 collecting: 00changelog.i 1/3 files (33.33%)
65 collecting: 00manifest.i 2/3 files (66.67%)
61 collecting: 00manifest.i 2/3 files (66.67%)
66 collecting: a.i 3/3 files (100.00%)
62 collecting: a.i 3/3 files (100.00%)
67 collecting: b.i 4/3 files (133.33%)
63 collecting: b.i 4/3 files (133.33%)
68 collecting: dummy.i 5/3 files (166.67%)
64 collecting: dummy.i 5/3 files (166.67%)
69 collected 5 candidate storage files
65 collected 5 candidate storage files
70 not linkable: 00changelog.i
66 not linkable: 00changelog.i
71 not linkable: 00manifest.i
67 not linkable: 00manifest.i
72 pruning: data/a.i 3/5 files (60.00%)
68 pruning: data/a.i 3/5 files (60.00%)
73 not linkable: data/b.i
69 not linkable: data/b.i
74 pruning: data/dummy.i 5/5 files (100.00%)
70 pruning: data/dummy.i 5/5 files (100.00%)
75 pruned down to 2 probably relinkable files
71 pruned down to 2 probably relinkable files
76 relinking: data/a.i 1/2 files (50.00%)
72 relinking: data/a.i 1/2 files (50.00%)
77 not linkable: data/dummy.i
73 not linkable: data/dummy.i
78 relinked 1 files (136 bytes reclaimed)
74 relinked 1 files (136 bytes reclaimed)
79 $ cd ..
75 $ cd ..
80
76
81
77
82 check hardlinks
78 check hardlinks
83
79
84 $ python arelinked.py repo/.hg/store/data/a.i clone/.hg/store/data/a.i
80 $ python arelinked.py repo/.hg/store/data/a.i clone/.hg/store/data/a.i
85 repo/.hg/store/data/a.i == clone/.hg/store/data/a.i
81 repo/.hg/store/data/a.i == clone/.hg/store/data/a.i
86 $ python arelinked.py repo/.hg/store/data/b.i clone/.hg/store/data/b.i
82 $ python arelinked.py repo/.hg/store/data/b.i clone/.hg/store/data/b.i
87 repo/.hg/store/data/b.i != clone/.hg/store/data/b.i
83 repo/.hg/store/data/b.i != clone/.hg/store/data/b.i
88
84
General Comments 0
You need to be logged in to leave comments. Login now