##// END OF EJS Templates
tests: unify test-convert-tla
Matt Mackall -
r12533:068449e5 default
parent child Browse files
Show More
@@ -1,73 +1,139
1 #!/bin/sh
2 1
3 "$TESTDIR/hghave" tla || exit 80
2 $ "$TESTDIR/hghave" tla || exit 80
3 $ mkdir do_not_use_HOME_tla
4 $ cd do_not_use_HOME_tla
5 $ HOME=`pwd`; export HOME
6 $ cd ..
7 $ tla my-id "mercurial <mercurial@selenic.com>"
8 $ echo "[extensions]" >> $HGRCPATH
9 $ echo "convert=" >> $HGRCPATH
10 $ echo 'graphlog =' >> $HGRCPATH
11
12 create tla archive
4 13
5 mkdir do_not_use_HOME_tla
6 cd do_not_use_HOME_tla
7 HOME=`pwd`; export HOME
8 cd ..
9 tla my-id "mercurial <mercurial@selenic.com>"
14 $ tla make-archive tla@mercurial--convert `pwd`/hg-test-convert-tla
15
16 initialize tla repo
10 17
11 echo "[extensions]" >> $HGRCPATH
12 echo "convert=" >> $HGRCPATH
13 echo 'graphlog =' >> $HGRCPATH
18 $ mkdir tla-repo
19 $ cd tla-repo/
20 $ tla init-tree tla@mercurial--convert/tla--test--0
21 $ tla import
22 * creating version tla@mercurial--convert/tla--test--0
23 * imported tla@mercurial--convert/tla--test--0
24
25 create initial files
14 26
15 echo % create tla archive
16 tla make-archive tla@mercurial--convert `pwd`/hg-test-convert-tla
27 $ echo 'this is a file' > a
28 $ tla add a
29 $ mkdir src
30 $ tla add src
31 $ cd src
32 $ dd count=1 if=/dev/zero of=b > /dev/null 2> /dev/null
33 $ tla add b
34 $ tla commit -s "added a file, src and src/b (binary)"
35 A/ .arch-ids
36 A/ src
37 A/ src/.arch-ids
38 A .arch-ids/a.id
39 A a
40 A src/.arch-ids/=id
41 A src/.arch-ids/b.id
42 A src/b
43 * update pristine tree (tla@mercurial--convert/tla--test--0--base-0 => tla--test--0--patch-1)
44 * committed tla@mercurial--convert/tla--test--0--patch-1
17 45
18 echo % initialize tla repo
19 mkdir tla-repo
20 cd tla-repo/
21 tla init-tree tla@mercurial--convert/tla--test--0
22 tla import
46 create link file and modify a
23 47
24 echo % create initial files
25 echo 'this is a file' > a
26 tla add a
27 mkdir src
28 tla add src
29 cd src
30 dd count=1 if=/dev/zero of=b > /dev/null 2> /dev/null
31 tla add b
32 tla commit -s "added a file, src and src/b (binary)"
48 $ ln -s ../a a-link
49 $ tla add a-link
50 $ echo 'this a modification to a' >> ../a
51 $ tla commit -s "added link to a and modify a"
52 A src/.arch-ids/a-link.id
53 A src/a-link
54 M a
55 * update pristine tree (tla@mercurial--convert/tla--test--0--patch-1 => tla--test--0--patch-2)
56 * committed tla@mercurial--convert/tla--test--0--patch-2
57
58 create second link and modify b
59
60 $ ln -s ../a a-link-2
61 $ tla add a-link-2
62 $ dd count=1 seek=1 if=/dev/zero of=b > /dev/null 2> /dev/null
63 $ tla commit -s "added second link and modify b"
64 A src/.arch-ids/a-link-2.id
65 A src/a-link-2
66 Mb src/b
67 * update pristine tree (tla@mercurial--convert/tla--test--0--patch-2 => tla--test--0--patch-3)
68 * committed tla@mercurial--convert/tla--test--0--patch-3
33 69
34 echo % create link file and modify a
35 ln -s ../a a-link
36 tla add a-link
37 echo 'this a modification to a' >> ../a
38 tla commit -s "added link to a and modify a"
70 b file to link and a-link-2 to regular file
71
72 $ rm -f a-link-2
73 $ echo 'this is now a regular file' > a-link-2
74 $ ln -sf ../a b
75 $ tla commit -s "file to link and link to file test"
76 fl src/b
77 lf src/a-link-2
78 * update pristine tree (tla@mercurial--convert/tla--test--0--patch-3 => tla--test--0--patch-4)
79 * committed tla@mercurial--convert/tla--test--0--patch-4
80
81 move a-link-2 file and src directory
39 82
40 echo % create second link and modify b
41 ln -s ../a a-link-2
42 tla add a-link-2
43 dd count=1 seek=1 if=/dev/zero of=b > /dev/null 2> /dev/null
44 tla commit -s "added second link and modify b"
83 $ cd ..
84 $ tla mv src/a-link-2 c
85 $ tla mv src test
86 $ tla commit -s "move and rename a-link-2 file and src directory"
87 D/ src/.arch-ids
88 A/ test/.arch-ids
89 /> src test
90 => src/.arch-ids/a-link-2.id .arch-ids/c.id
91 => src/a-link-2 c
92 => src/.arch-ids/=id test/.arch-ids/=id
93 => src/.arch-ids/a-link.id test/.arch-ids/a-link.id
94 => src/.arch-ids/b.id test/.arch-ids/b.id
95 * update pristine tree (tla@mercurial--convert/tla--test--0--patch-4 => tla--test--0--patch-5)
96 * committed tla@mercurial--convert/tla--test--0--patch-5
97 $ cd ..
45 98
46 echo % b file to link and a-link-2 to regular file
47 rm -f a-link-2
48 echo 'this is now a regular file' > a-link-2
49 ln -sf ../a b
50 tla commit -s "file to link and link to file test"
99 converting tla repo to Mercurial
51 100
52 echo % move a-link-2 file and src directory
53 cd ..
54 tla mv src/a-link-2 c
55 tla mv src test
56 tla commit -s "move and rename a-link-2 file and src directory"
101 $ hg convert tla-repo tla-repo-hg
102 initializing destination tla-repo-hg repository
103 analyzing tree version tla@mercurial--convert/tla--test--0...
104 scanning source...
105 sorting...
106 converting...
107 5 initial import
108 4 added a file, src and src/b (binary)
109 3 added link to a and modify a
110 2 added second link and modify b
111 1 file to link and link to file test
112 0 move and rename a-link-2 file and src directory
113 $ tla register-archive -d tla@mercurial--convert
114 $ glog()
115 > {
116 > hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@"
117 > }
57 118
58 cd ..
59
60 echo % converting tla repo to Mercurial
61 hg convert tla-repo tla-repo-hg
119 show graph log
62 120
63 tla register-archive -d tla@mercurial--convert
64
65 glog()
66 {
67 hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@"
68 }
69
70 echo % show graph log
71 glog -R tla-repo-hg
72 hg up -q -R tla-repo-hg
73 hg -R tla-repo-hg manifest --debug
121 $ glog -R tla-repo-hg
122 o 5 "move and rename a-link-2 file and src directory" files: c src/a-link src/a-link-2 src/b test/a-link test/b
123 |
124 o 4 "file to link and link to file test" files: src/a-link-2 src/b
125 |
126 o 3 "added second link and modify b" files: src/a-link-2 src/b
127 |
128 o 2 "added link to a and modify a" files: a src/a-link
129 |
130 o 1 "added a file, src and src/b (binary)" files: a src/b
131 |
132 o 0 "initial import" files:
133
134 $ hg up -q -R tla-repo-hg
135 $ hg -R tla-repo-hg manifest --debug
136 c4072c4b72e1cabace081888efa148ee80ca3cbb 644 a
137 0201ac32a3a8e86e303dff60366382a54b48a72e 644 c
138 c0067ba5ff0b7c9a3eb17270839d04614c435623 644 @ test/a-link
139 375f4263d86feacdea7e3c27100abd1560f2a973 644 @ test/b
1 NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now