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