Show More
@@ -38,3 +38,28 b' 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 | ||||
|
42 | echo % test for different branch cache features | |||
|
43 | echo '4909a3732169c0c20011c4f4b8fdff4e3d89b23f 4' > .hg/branches.cache | |||
|
44 | hg branches --debug | |||
|
45 | echo ' features: unnamed dummy foo bar' > .hg/branches.cache | |||
|
46 | hg branches --debug | |||
|
47 | echo ' features: dummy' > .hg/branches.cache | |||
|
48 | hg branches --debug | |||
|
49 | ||||
|
50 | echo % test old hg reading branch cache with feature list | |||
|
51 | python << EOF | |||
|
52 | import binascii | |||
|
53 | f = file('.hg/branches.cache') | |||
|
54 | lines = f.read().split('\n') | |||
|
55 | f.close() | |||
|
56 | firstline = lines[0] | |||
|
57 | last, lrev = lines.pop(0).rstrip().split(" ", 1) | |||
|
58 | try: | |||
|
59 | last, lrev = binascii.unhexlify(last), int(lrev) | |||
|
60 | except ValueError, inst: | |||
|
61 | if str(inst) == "invalid literal for int():%s" % firstline: | |||
|
62 | print "ValueError raised correctly, good." | |||
|
63 | else: | |||
|
64 | print "ValueError: %s" % inst | |||
|
65 | EOF |
@@ -79,3 +79,18 b' 4909a3732169c0c20011c4f4b8fdff4e3d89b23f' | |||||
79 | bf1bc2f45e834c75404d0ddab57d53beab56e2f8 |
|
79 | bf1bc2f45e834c75404d0ddab57d53beab56e2f8 | |
80 | 4909a3732169c0c20011c4f4b8fdff4e3d89b23f foo |
|
80 | 4909a3732169c0c20011c4f4b8fdff4e3d89b23f foo | |
81 | 67ec16bde7f1575d523313b9bca000f6a6f12dca bar |
|
81 | 67ec16bde7f1575d523313b9bca000f6a6f12dca bar | |
|
82 | % test for different branch cache features | |||
|
83 | branch cache: no features specified | |||
|
84 | foo 4:4909a3732169c0c20011c4f4b8fdff4e3d89b23f | |||
|
85 | 3:bf1bc2f45e834c75404d0ddab57d53beab56e2f8 | |||
|
86 | bar 2:67ec16bde7f1575d523313b9bca000f6a6f12dca | |||
|
87 | branch cache: unknown features: dummy, foo, bar | |||
|
88 | foo 4:4909a3732169c0c20011c4f4b8fdff4e3d89b23f | |||
|
89 | 3:bf1bc2f45e834c75404d0ddab57d53beab56e2f8 | |||
|
90 | bar 2:67ec16bde7f1575d523313b9bca000f6a6f12dca | |||
|
91 | branch cache: missing features: unnamed | |||
|
92 | foo 4:4909a3732169c0c20011c4f4b8fdff4e3d89b23f | |||
|
93 | 3:bf1bc2f45e834c75404d0ddab57d53beab56e2f8 | |||
|
94 | bar 2:67ec16bde7f1575d523313b9bca000f6a6f12dca | |||
|
95 | % test old hg reading branch cache with feature list | |||
|
96 | ValueError raised correctly, good. |
General Comments 0
You need to be logged in to leave comments.
Login now