##// END OF EJS Templates
Test update to branch tip
Brendan Cully -
r4175:fc12ac37 default
parent child Browse files
Show More
@@ -1,65 +1,73 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 hg init t
3 hg init t
4 cd t
4 cd t
5 hg branches
5 hg branches
6
6
7 echo foo > a
7 echo foo > a
8 hg add a
8 hg add a
9 hg ci -m "initial" -d "1000000 0"
9 hg ci -m "initial" -d "1000000 0"
10 hg branch foo
10 hg branch foo
11 hg branch
11 hg branch
12 hg ci -m "add branch name" -d "1000000 0"
12 hg ci -m "add branch name" -d "1000000 0"
13 hg branch bar
13 hg branch bar
14 hg ci -m "change branch name" -d "1000000 0"
14 hg ci -m "change branch name" -d "1000000 0"
15 hg branch ""
15 hg branch ""
16 hg ci -m "clear branch name" -d "1000000 0"
16 hg ci -m "clear branch name" -d "1000000 0"
17
17
18 hg co foo
18 hg co foo
19 hg branch
19 hg branch
20 echo bleah > a
20 echo bleah > a
21 hg ci -m "modify a branch" -d "1000000 0"
21 hg ci -m "modify a branch" -d "1000000 0"
22
22
23 hg merge
23 hg merge
24 hg branch
24 hg branch
25 hg ci -m "merge" -d "1000000 0"
25 hg ci -m "merge" -d "1000000 0"
26 hg log
26 hg log
27
27
28 hg branches
28 hg branches
29 hg branches -q
29 hg branches -q
30
30
31 echo % test for invalid branch cache
31 echo % test for invalid branch cache
32 hg rollback
32 hg rollback
33 cp .hg/branches.cache .hg/bc-invalid
33 cp .hg/branches.cache .hg/bc-invalid
34 hg log -r foo
34 hg log -r foo
35 cp .hg/bc-invalid .hg/branches.cache
35 cp .hg/bc-invalid .hg/branches.cache
36 hg --debug log -r foo
36 hg --debug log -r foo
37 rm .hg/branches.cache
37 rm .hg/branches.cache
38 echo corrupted > .hg/branches.cache
38 echo corrupted > .hg/branches.cache
39 hg log -qr foo
39 hg log -qr foo
40 cat .hg/branches.cache
40 cat .hg/branches.cache
41
41
42 echo % test for different branch cache features
42 echo % test for different branch cache features
43 echo '4909a3732169c0c20011c4f4b8fdff4e3d89b23f 4' > .hg/branches.cache
43 echo '4909a3732169c0c20011c4f4b8fdff4e3d89b23f 4' > .hg/branches.cache
44 hg branches --debug
44 hg branches --debug
45 echo ' features: unnamed dummy foo bar' > .hg/branches.cache
45 echo ' features: unnamed dummy foo bar' > .hg/branches.cache
46 hg branches --debug
46 hg branches --debug
47 echo ' features: dummy' > .hg/branches.cache
47 echo ' features: dummy' > .hg/branches.cache
48 hg branches --debug
48 hg branches --debug
49
49
50 echo % test old hg reading branch cache with feature list
50 echo % test old hg reading branch cache with feature list
51 python << EOF
51 python << EOF
52 import binascii
52 import binascii
53 f = file('.hg/branches.cache')
53 f = file('.hg/branches.cache')
54 lines = f.read().split('\n')
54 lines = f.read().split('\n')
55 f.close()
55 f.close()
56 firstline = lines[0]
56 firstline = lines[0]
57 last, lrev = lines.pop(0).rstrip().split(" ", 1)
57 last, lrev = lines.pop(0).rstrip().split(" ", 1)
58 try:
58 try:
59 last, lrev = binascii.unhexlify(last), int(lrev)
59 last, lrev = binascii.unhexlify(last), int(lrev)
60 except ValueError, inst:
60 except ValueError, inst:
61 if str(inst) == "invalid literal for int():%s" % firstline:
61 if str(inst) == "invalid literal for int():%s" % firstline:
62 print "ValueError raised correctly, good."
62 print "ValueError raised correctly, good."
63 else:
63 else:
64 print "ValueError: %s" % inst
64 print "ValueError: %s" % inst
65 EOF
65 EOF
66
67 echo % update with no arguments: tipmost revision of the current branch
68 hg up -q -C 0
69 hg up -q
70 hg id
71 hg up -q 1
72 hg up -q
73 hg id
@@ -1,96 +1,99 b''
1 foo
1 foo
2 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
2 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
3 foo
3 foo
4 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
4 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
5 (branch merge, don't forget to commit)
5 (branch merge, don't forget to commit)
6 foo
6 foo
7 changeset: 5:5f8fb06e083e
7 changeset: 5:5f8fb06e083e
8 branch: foo
8 branch: foo
9 tag: tip
9 tag: tip
10 parent: 4:4909a3732169
10 parent: 4:4909a3732169
11 parent: 3:bf1bc2f45e83
11 parent: 3:bf1bc2f45e83
12 user: test
12 user: test
13 date: Mon Jan 12 13:46:40 1970 +0000
13 date: Mon Jan 12 13:46:40 1970 +0000
14 summary: merge
14 summary: merge
15
15
16 changeset: 4:4909a3732169
16 changeset: 4:4909a3732169
17 branch: foo
17 branch: foo
18 parent: 1:b699b1cec9c2
18 parent: 1:b699b1cec9c2
19 user: test
19 user: test
20 date: Mon Jan 12 13:46:40 1970 +0000
20 date: Mon Jan 12 13:46:40 1970 +0000
21 summary: modify a branch
21 summary: modify a branch
22
22
23 changeset: 3:bf1bc2f45e83
23 changeset: 3:bf1bc2f45e83
24 user: test
24 user: test
25 date: Mon Jan 12 13:46:40 1970 +0000
25 date: Mon Jan 12 13:46:40 1970 +0000
26 summary: clear branch name
26 summary: clear branch name
27
27
28 changeset: 2:67ec16bde7f1
28 changeset: 2:67ec16bde7f1
29 branch: bar
29 branch: bar
30 user: test
30 user: test
31 date: Mon Jan 12 13:46:40 1970 +0000
31 date: Mon Jan 12 13:46:40 1970 +0000
32 summary: change branch name
32 summary: change branch name
33
33
34 changeset: 1:b699b1cec9c2
34 changeset: 1:b699b1cec9c2
35 branch: foo
35 branch: foo
36 user: test
36 user: test
37 date: Mon Jan 12 13:46:40 1970 +0000
37 date: Mon Jan 12 13:46:40 1970 +0000
38 summary: add branch name
38 summary: add branch name
39
39
40 changeset: 0:be8523e69bf8
40 changeset: 0:be8523e69bf8
41 user: test
41 user: test
42 date: Mon Jan 12 13:46:40 1970 +0000
42 date: Mon Jan 12 13:46:40 1970 +0000
43 summary: initial
43 summary: initial
44
44
45 foo 5:5f8fb06e083e
45 foo 5:5f8fb06e083e
46 3:bf1bc2f45e83
46 3:bf1bc2f45e83
47 bar 2:67ec16bde7f1
47 bar 2:67ec16bde7f1
48 foo
48 foo
49
49
50 bar
50 bar
51 % test for invalid branch cache
51 % test for invalid branch cache
52 rolling back last transaction
52 rolling back last transaction
53 changeset: 4:4909a3732169
53 changeset: 4:4909a3732169
54 branch: foo
54 branch: foo
55 tag: tip
55 tag: tip
56 parent: 1:b699b1cec9c2
56 parent: 1:b699b1cec9c2
57 user: test
57 user: test
58 date: Mon Jan 12 13:46:40 1970 +0000
58 date: Mon Jan 12 13:46:40 1970 +0000
59 summary: modify a branch
59 summary: modify a branch
60
60
61 Invalid branch cache: unknown tip
61 Invalid branch cache: unknown tip
62 changeset: 4:4909a3732169c0c20011c4f4b8fdff4e3d89b23f
62 changeset: 4:4909a3732169c0c20011c4f4b8fdff4e3d89b23f
63 branch: foo
63 branch: foo
64 tag: tip
64 tag: tip
65 parent: 1:b699b1cec9c2966b3700de4fef0dc123cd754c31
65 parent: 1:b699b1cec9c2966b3700de4fef0dc123cd754c31
66 parent: -1:0000000000000000000000000000000000000000
66 parent: -1:0000000000000000000000000000000000000000
67 manifest: 4:d01b250baaa05909152f7ae07d7a649deea0df9a
67 manifest: 4:d01b250baaa05909152f7ae07d7a649deea0df9a
68 user: test
68 user: test
69 date: Mon Jan 12 13:46:40 1970 +0000
69 date: Mon Jan 12 13:46:40 1970 +0000
70 files: a
70 files: a
71 extra: branch=foo
71 extra: branch=foo
72 description:
72 description:
73 modify a branch
73 modify a branch
74
74
75
75
76 4:4909a3732169
76 4:4909a3732169
77 features: unnamed
77 features: unnamed
78 4909a3732169c0c20011c4f4b8fdff4e3d89b23f 4
78 4909a3732169c0c20011c4f4b8fdff4e3d89b23f 4
79 bf1bc2f45e834c75404d0ddab57d53beab56e2f8
79 bf1bc2f45e834c75404d0ddab57d53beab56e2f8
80 4909a3732169c0c20011c4f4b8fdff4e3d89b23f foo
80 4909a3732169c0c20011c4f4b8fdff4e3d89b23f foo
81 67ec16bde7f1575d523313b9bca000f6a6f12dca bar
81 67ec16bde7f1575d523313b9bca000f6a6f12dca bar
82 % test for different branch cache features
82 % test for different branch cache features
83 branch cache: no features specified
83 branch cache: no features specified
84 foo 4:4909a3732169c0c20011c4f4b8fdff4e3d89b23f
84 foo 4:4909a3732169c0c20011c4f4b8fdff4e3d89b23f
85 3:bf1bc2f45e834c75404d0ddab57d53beab56e2f8
85 3:bf1bc2f45e834c75404d0ddab57d53beab56e2f8
86 bar 2:67ec16bde7f1575d523313b9bca000f6a6f12dca
86 bar 2:67ec16bde7f1575d523313b9bca000f6a6f12dca
87 branch cache: unknown features: dummy, foo, bar
87 branch cache: unknown features: dummy, foo, bar
88 foo 4:4909a3732169c0c20011c4f4b8fdff4e3d89b23f
88 foo 4:4909a3732169c0c20011c4f4b8fdff4e3d89b23f
89 3:bf1bc2f45e834c75404d0ddab57d53beab56e2f8
89 3:bf1bc2f45e834c75404d0ddab57d53beab56e2f8
90 bar 2:67ec16bde7f1575d523313b9bca000f6a6f12dca
90 bar 2:67ec16bde7f1575d523313b9bca000f6a6f12dca
91 branch cache: missing features: unnamed
91 branch cache: missing features: unnamed
92 foo 4:4909a3732169c0c20011c4f4b8fdff4e3d89b23f
92 foo 4:4909a3732169c0c20011c4f4b8fdff4e3d89b23f
93 3:bf1bc2f45e834c75404d0ddab57d53beab56e2f8
93 3:bf1bc2f45e834c75404d0ddab57d53beab56e2f8
94 bar 2:67ec16bde7f1575d523313b9bca000f6a6f12dca
94 bar 2:67ec16bde7f1575d523313b9bca000f6a6f12dca
95 % test old hg reading branch cache with feature list
95 % test old hg reading branch cache with feature list
96 ValueError raised correctly, good.
96 ValueError raised correctly, good.
97 % update with no arguments: tipmost revision of the current branch
98 bf1bc2f45e83
99 4909a3732169 (foo) tip
General Comments 0
You need to be logged in to leave comments. Login now