Show More
@@ -1,76 +1,78 | |||||
1 | #!/bin/sh |
|
1 | #!/bin/sh | |
2 |
|
2 | |||
3 | echo '[extensions]' >> $HGRCPATH |
|
3 | echo '[extensions]' >> $HGRCPATH | |
4 | echo 'hgext.mq=' >> $HGRCPATH |
|
4 | echo 'hgext.mq=' >> $HGRCPATH | |
5 |
|
5 | |||
6 | show_branch_cache() |
|
6 | show_branch_cache() | |
7 | { |
|
7 | { | |
8 | branches=.hg/branches.cache |
|
8 | branches=.hg/branches.cache | |
|
9 | # force cache (re)generation | |||
|
10 | hg log -r does-not-exist 2> /dev/null | |||
9 | hg log -r tip --template 'tip: #rev#\n' |
|
11 | hg log -r tip --template 'tip: #rev#\n' | |
10 | if [ -f $branches ]; then |
|
12 | if [ -f $branches ]; then | |
11 | sort $branches |
|
13 | sort $branches | |
12 | else |
|
14 | else | |
13 | echo No $branches |
|
15 | echo No $branches | |
14 | fi |
|
16 | fi | |
15 | if [ "$1" = 1 ]; then |
|
17 | if [ "$1" = 1 ]; then | |
16 | for b in foo bar; do |
|
18 | for b in foo bar; do | |
17 | hg log -r $b --template "branch $b: "'#rev#\n' |
|
19 | hg log -r $b --template "branch $b: "'#rev#\n' | |
18 | done |
|
20 | done | |
19 | fi |
|
21 | fi | |
20 | } |
|
22 | } | |
21 |
|
23 | |||
22 | hg init a |
|
24 | hg init a | |
23 | cd a |
|
25 | cd a | |
24 | hg qinit -c |
|
26 | hg qinit -c | |
25 |
|
27 | |||
26 | echo '# mq patch on an empty repo' |
|
28 | echo '# mq patch on an empty repo' | |
27 | hg qnew p1 |
|
29 | hg qnew p1 | |
28 | show_branch_cache |
|
30 | show_branch_cache | |
29 |
|
31 | |||
30 | echo > pfile |
|
32 | echo > pfile | |
31 | hg add pfile |
|
33 | hg add pfile | |
32 | hg qrefresh -m 'patch 1' |
|
34 | hg qrefresh -m 'patch 1' | |
33 | show_branch_cache |
|
35 | show_branch_cache | |
34 |
|
36 | |||
35 | echo |
|
37 | echo | |
36 | echo '# some regular revisions' |
|
38 | echo '# some regular revisions' | |
37 | hg qpop |
|
39 | hg qpop | |
38 | echo foo > foo |
|
40 | echo foo > foo | |
39 | hg add foo |
|
41 | hg add foo | |
40 | echo foo > .hg/branch |
|
42 | echo foo > .hg/branch | |
41 | hg ci -m 'branch foo' -d '1000000 0' |
|
43 | hg ci -m 'branch foo' -d '1000000 0' | |
42 |
|
44 | |||
43 | echo bar > bar |
|
45 | echo bar > bar | |
44 | hg add bar |
|
46 | hg add bar | |
45 | echo bar > .hg/branch |
|
47 | echo bar > .hg/branch | |
46 | hg ci -m 'branch bar' -d '1000000 0' |
|
48 | hg ci -m 'branch bar' -d '1000000 0' | |
47 | show_branch_cache |
|
49 | show_branch_cache | |
48 |
|
50 | |||
49 | echo |
|
51 | echo | |
50 | echo '# add some mq patches' |
|
52 | echo '# add some mq patches' | |
51 | hg qpush |
|
53 | hg qpush | |
52 | show_branch_cache |
|
54 | show_branch_cache | |
53 |
|
55 | |||
54 | hg qnew p2 |
|
56 | hg qnew p2 | |
55 | echo foo > .hg/branch |
|
57 | echo foo > .hg/branch | |
56 | echo foo2 >> foo |
|
58 | echo foo2 >> foo | |
57 | hg qrefresh -m 'patch 2' |
|
59 | hg qrefresh -m 'patch 2' | |
58 | show_branch_cache 1 |
|
60 | show_branch_cache 1 | |
59 |
|
61 | |||
60 | echo |
|
62 | echo | |
61 | echo '# removing the cache' |
|
63 | echo '# removing the cache' | |
62 | rm -f .hg/branches.cache |
|
64 | rm -f .hg/branches.cache | |
63 | show_branch_cache 1 |
|
65 | show_branch_cache 1 | |
64 |
|
66 | |||
65 | echo |
|
67 | echo | |
66 | echo '# importing rev 1 (the cache now ends in one of the patches)' |
|
68 | echo '# importing rev 1 (the cache now ends in one of the patches)' | |
67 | hg qimport -r 1 -n p0 |
|
69 | hg qimport -r 1 -n p0 | |
68 | show_branch_cache 1 |
|
70 | show_branch_cache 1 | |
69 | hg log -r qbase --template 'qbase: #rev#\n' |
|
71 | hg log -r qbase --template 'qbase: #rev#\n' | |
70 |
|
72 | |||
71 | echo |
|
73 | echo | |
72 | echo '# detect an invalid cache' |
|
74 | echo '# detect an invalid cache' | |
73 | hg qpop -a |
|
75 | hg qpop -a | |
74 | hg qpush -a |
|
76 | hg qpush -a | |
75 | show_branch_cache |
|
77 | show_branch_cache | |
76 |
|
78 |
General Comments 0
You need to be logged in to leave comments.
Login now