Mercurial > hg > mercurial-crew-with-dirclash
annotate tests/test-mq-caches @ 5377:756a43a30e34
convert: readd --filemap
To handle merges correctly, this revision adds a filemap_source class
that wraps a converter_source and does the work necessary to calculate
the subgraph we're interested in.
The wrapped converter_source must provide a new getchangedfiles method
that, given a revision rev, and an index N, returns the list of files
that are different in rev and its Nth parent.
The implementation depends on the ability to skip some revisions and to
change the parents field of the commit objects that we returned earlier.
To make the conversion restartable, we assume the revisons in the
revmapfile are topologically sorted.
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Thu, 04 Oct 2007 23:21:37 -0300 |
parents | a7af0eeae8a3 |
children |
rev | line source |
---|---|
3486
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
1 #!/bin/sh |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
2 |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
3 echo '[extensions]' >> $HGRCPATH |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
4 echo 'hgext.mq=' >> $HGRCPATH |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
5 |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
6 show_branch_cache() |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
7 { |
4205
a7af0eeae8a3
Move branches.cache to branch.cache
Matt Mackall <mpm@selenic.com>
parents:
3988
diff
changeset
|
8 branches=.hg/branch.cache |
3501
89820e9b94f2
test-mq-caches: look up a revision that does not exist to force cache creation
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3486
diff
changeset
|
9 # force cache (re)generation |
89820e9b94f2
test-mq-caches: look up a revision that does not exist to force cache creation
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3486
diff
changeset
|
10 hg log -r does-not-exist 2> /dev/null |
3486
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
11 hg log -r tip --template 'tip: #rev#\n' |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
12 if [ -f $branches ]; then |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
13 sort $branches |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
14 else |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
15 echo No $branches |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
16 fi |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
17 if [ "$1" = 1 ]; then |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
18 for b in foo bar; do |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
19 hg log -r $b --template "branch $b: "'#rev#\n' |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
20 done |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
21 fi |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
22 } |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
23 |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
24 hg init a |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
25 cd a |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
26 hg qinit -c |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
27 |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
28 echo '# mq patch on an empty repo' |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
29 hg qnew p1 |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
30 show_branch_cache |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
31 |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
32 echo > pfile |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
33 hg add pfile |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
34 hg qrefresh -m 'patch 1' |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
35 show_branch_cache |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
36 |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
37 echo |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
38 echo '# some regular revisions' |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
39 hg qpop |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
40 echo foo > foo |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
41 hg add foo |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
42 echo foo > .hg/branch |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
43 hg ci -m 'branch foo' -d '1000000 0' |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
44 |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
45 echo bar > bar |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
46 hg add bar |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
47 echo bar > .hg/branch |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
48 hg ci -m 'branch bar' -d '1000000 0' |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
49 show_branch_cache |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
50 |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
51 echo |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
52 echo '# add some mq patches' |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
53 hg qpush |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
54 show_branch_cache |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
55 |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
56 hg qnew p2 |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
57 echo foo > .hg/branch |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
58 echo foo2 >> foo |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
59 hg qrefresh -m 'patch 2' |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
60 show_branch_cache 1 |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
61 |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
62 echo |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
63 echo '# removing the cache' |
4205
a7af0eeae8a3
Move branches.cache to branch.cache
Matt Mackall <mpm@selenic.com>
parents:
3988
diff
changeset
|
64 rm .hg/branch.cache |
3486
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
65 show_branch_cache 1 |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
66 |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
67 echo |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
68 echo '# importing rev 1 (the cache now ends in one of the patches)' |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
69 hg qimport -r 1 -n p0 |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
70 show_branch_cache 1 |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
71 hg log -r qbase --template 'qbase: #rev#\n' |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
72 |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
73 echo |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
74 echo '# detect an invalid cache' |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
75 hg qpop -a |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
76 hg qpush -a |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
77 show_branch_cache |
fbf8320f25c8
make mq play nicely with the branch cache
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
78 |