Mercurial > hg
annotate tests/test-convert-filemap @ 5774:c850a8640981
bisect: faster merging
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 31 Dec 2007 18:20:34 -0600 |
parents | d3e51dc804f8 |
children | 7239e06e58e9 |
rev | line source |
---|---|
5379
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
1 #!/bin/sh |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
2 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
3 HGMERGE=true; export HGMERGE |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
4 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
5 echo '[extensions]' >> $HGRCPATH |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
6 echo 'hgext.graphlog =' >> $HGRCPATH |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
7 echo 'hgext.convert =' >> $HGRCPATH |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
8 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
9 glog() |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
10 { |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
11 hg glog --template '#rev# "#desc#" files: #files#\n' "$@" |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
12 } |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
13 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
14 hg init source |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
15 cd source |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
16 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
17 echo foo > foo |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
18 echo baz > baz |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
19 mkdir dir |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
20 echo dir/file >> dir/file |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
21 echo dir/file2 >> dir/file2 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
22 hg ci -d '0 0' -qAm '0: add foo baz dir/' |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
23 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
24 echo bar > bar |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
25 echo quux > quux |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
26 hg copy foo copied |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
27 hg ci -d '1 0' -qAm '1: add bar quux; copy foo to copied' |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
28 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
29 echo >> foo |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
30 hg ci -d '2 0' -m '2: change foo' |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
31 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
32 hg up -qC 1 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
33 echo >> bar |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
34 echo >> quux |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
35 hg ci -d '3 0' -m '3: change bar quux' |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
36 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
37 hg up -qC 2 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
38 hg merge -qr 3 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
39 echo >> bar |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
40 echo >> baz |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
41 hg ci -d '4 0' -m '4: first merge; change bar baz' |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
42 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
43 echo >> bar |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
44 echo 1 >> baz |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
45 echo >> quux |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
46 hg ci -d '5 0' -m '5: change bar baz quux' |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
47 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
48 hg up -qC 4 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
49 echo >> foo |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
50 echo 2 >> baz |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
51 hg ci -d '6 0' -m '6: change foo baz' |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
52 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
53 hg up -qC 5 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
54 hg merge -qr 6 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
55 echo >> bar |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
56 hg ci -d '7 0' -m '7: second merge; change bar' |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
57 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
58 echo >> foo |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
59 hg ci -m '8: change foo' |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
60 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
61 glog |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
62 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
63 echo '% final file versions in this repo:' |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
64 hg manifest --debug |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
65 hg debugrename copied |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
66 echo |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
67 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
68 cd .. |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
69 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
70 splitrepo() |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
71 { |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
72 msg="$1" |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
73 files="$2" |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
74 opts=$3 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
75 echo "% $files: $msg" |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
76 prefix=`echo "$files" | sed -e 's/ /-/g'` |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
77 fmap="$prefix.fmap" |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
78 repo="$prefix.repo" |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
79 for i in $files; do |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
80 echo "include $i" >> "$fmap" |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
81 done |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
82 hg -q convert $opts --filemap "$fmap" --datesort source "$repo" |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
83 glog -R "$repo" |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
84 hg -R "$repo" manifest --debug |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
85 } |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
86 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
87 splitrepo 'skip unwanted merges; use 1st parent in 1st merge, 2nd in 2nd' foo |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
88 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
89 splitrepo 'merges are not merges anymore' bar |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
90 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
91 splitrepo '1st merge is not a merge anymore; 2nd still is' baz |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
92 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
93 splitrepo 'we add additional merges when they are interesting' 'foo quux' |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
94 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
95 splitrepo 'partial conversion' 'bar quux' '-r 3' |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
96 splitrepo 'complete the partial conversion' 'bar quux' |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
97 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
98 rm -r foo.repo |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
99 splitrepo 'partial conversion' 'foo' '-r 3' |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
100 splitrepo 'complete the partial conversion' 'foo' |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
101 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
102 splitrepo 'copied file; source not included in new repo' copied |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
103 hg --cwd copied.repo debugrename copied |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
104 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
105 splitrepo 'copied file; source included in new repo' 'foo copied' |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
106 hg --cwd foo-copied.repo debugrename copied |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
107 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
108 cat > renames.fmap <<EOF |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
109 include dir |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
110 exclude dir/file2 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
111 rename dir dir2 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
112 include foo |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
113 include copied |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
114 rename foo foo2 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
115 rename copied copied2 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
116 EOF |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
117 hg -q convert --filemap renames.fmap --datesort source renames.repo |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
118 glog -R renames.repo |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
119 hg -R renames.repo manifest --debug |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
120 hg --cwd renames.repo debugrename copied2 |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
121 echo 'copied:' |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
122 hg --cwd source cat copied |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
123 echo 'copied2:' |
d3e51dc804f8
mercurial_source: add --filemap support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
124 hg --cwd renames.repo cat copied2 |