##// END OF EJS Templates
convert: added gnu arch (baz) tests
Aleix Conchillo Flaque -
r6078:ebc23d34 default
parent child Browse files
Show More
@@ -0,0 +1,66 b''
1 #!/bin/sh
2
3 "$TESTDIR/hghave" baz || exit 80
4
5 echo "[extensions]" >> $HGRCPATH
6 echo "convert=" >> $HGRCPATH
7 echo 'hgext.graphlog =' >> $HGRCPATH
8
9 echo % create baz archive
10 baz make-archive baz@mercurial--convert hg-test-convert-baz
11
12 echo % initialize baz repo
13 mkdir baz-repo
14 cd baz-repo/
15 baz init-tree baz@mercurial--convert/baz--test--0
16 baz import
17
18 echo % create initial files
19 echo 'this is a file' > a
20 baz add a
21 mkdir src
22 baz add src
23 cd src
24 dd count=1 if=/dev/zero of=b > /dev/null 2> /dev/null
25 baz add b
26 baz commit -s "added a file, src and src/b (binary)"
27
28 echo % create link file and modify a
29 ln -s ../a a-link
30 baz add a-link
31 echo 'this a modification to a' >> ../a
32 baz commit -s "added link to a and modify a"
33
34 echo % create second link and modify b
35 ln -s ../a a-link-2
36 baz add a-link-2
37 dd count=1 seek=1 if=/dev/zero of=b > /dev/null 2> /dev/null
38 baz commit -s "added second link and modify b"
39
40 echo % b file to link and a-link-2 to regular file
41 rm -f a-link-2
42 echo 'this is now a regular file' > a-link-2
43 ln -sf ../a b
44 baz commit -s "file to link and link to file test"
45
46 echo % move a-link-2 file and src directory
47 cd ..
48 baz mv src/a-link-2 c
49 baz mv src test
50 baz commit -s "move and rename a-link-2 file and src directory"
51
52 cd ..
53
54 echo % converting baz repo to Mercurial
55 hg convert baz-repo baz-repo-hg
56
57 baz register-archive -d baz@mercurial--convert
58
59 glog()
60 {
61 hg glog --template '#rev# "#desc|firstline#" files: #files#\n' "$@"
62 }
63
64 echo % show graph log
65 glog -R baz-repo-hg
66 hg -R baz-repo-hg manifest --debug
@@ -0,0 +1,75 b''
1 % create baz archive
2 % initialize baz repo
3 * creating version baz@mercurial--convert/baz--test--0
4 * imported baz@mercurial--convert/baz--test--0
5 % create initial files
6 * build pristine tree for baz@mercurial--convert/baz--test--0--base-0
7 * Scanning for full-tree revision: .
8 * from import revision: baz@mercurial--convert/baz--test--0--base-0
9 A/ .arch-ids
10 A/ src
11 A/ src/.arch-ids
12 A .arch-ids/a.id
13 A a
14 A src/.arch-ids/=id
15 A src/.arch-ids/b.id
16 A src/b
17 * update pristine tree (baz@mercurial--convert/baz--test--0--base-0 => baz--test--0--patch-1)
18 * committed baz@mercurial--convert/baz--test--0--patch-1
19 % create link file and modify a
20 A src/.arch-ids/a-link.id
21 A src/a-link
22 M a
23 * update pristine tree (baz@mercurial--convert/baz--test--0--patch-1 => baz--test--0--patch-2)
24 * committed baz@mercurial--convert/baz--test--0--patch-2
25 % create second link and modify b
26 A src/.arch-ids/a-link-2.id
27 A src/a-link-2
28 Mb src/b
29 * update pristine tree (baz@mercurial--convert/baz--test--0--patch-2 => baz--test--0--patch-3)
30 * committed baz@mercurial--convert/baz--test--0--patch-3
31 % b file to link and a-link-2 to regular file
32 fl src/b
33 lf src/a-link-2
34 * update pristine tree (baz@mercurial--convert/baz--test--0--patch-3 => baz--test--0--patch-4)
35 * committed baz@mercurial--convert/baz--test--0--patch-4
36 % move a-link-2 file and src directory
37 D/ src/.arch-ids
38 A/ test/.arch-ids
39 /> src test
40 => src/.arch-ids/a-link-2.id .arch-ids/c.id
41 => src/a-link-2 c
42 => src/.arch-ids/=id test/.arch-ids/=id
43 => src/.arch-ids/a-link.id test/.arch-ids/a-link.id
44 => src/.arch-ids/b.id test/.arch-ids/b.id
45 * update pristine tree (baz@mercurial--convert/baz--test--0--patch-4 => baz--test--0--patch-5)
46 * committed baz@mercurial--convert/baz--test--0--patch-5
47 % converting baz repo to Mercurial
48 initializing destination baz-repo-hg repository
49 analyzing tree version baz@mercurial--convert/baz--test--0...
50 scanning source...
51 sorting...
52 converting...
53 5 initial import
54 4 added a file, src and src/b (binary)
55 3 added link to a and modify a
56 2 added second link and modify b
57 1 file to link and link to file test
58 0 move and rename a-link-2 file and src directory
59 % show graph log
60 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
61 |
62 o 4 "file to link and link to file test" files: src/a-link-2 src/b
63 |
64 o 3 "added second link and modify b" files: src/a-link-2 src/b
65 |
66 o 2 "added link to a and modify a" files: a src/a-link
67 |
68 o 1 "added a file, src and src/b (binary)" files: a src/b
69 |
70 o 0 "initial import" files:
71
72 c4072c4b72e1cabace081888efa148ee80ca3cbb 644 a
73 e3207be798aaf87a444a62903621edab4ddc1fb6 644 c
74 1f6b5bb93f1da278ef1fead1e4740a03d8802e9f 644 @ test/a-link
75 1f6b5bb93f1da278ef1fead1e4740a03d8802e9f 644 @ test/b
@@ -23,7 +23,7 b' class gnuarch_source(converter_source, c'
23 super(gnuarch_source, self).__init__(ui, path, rev=rev)
23 super(gnuarch_source, self).__init__(ui, path, rev=rev)
24
24
25 if not os.path.exists(os.path.join(path, '{arch}')):
25 if not os.path.exists(os.path.join(path, '{arch}')):
26 raise NoRepo(_("couldn't open GNU Arch repo %s" % path))
26 raise NoRepo(_("%s does not look like a GNU Arch repo" % path))
27
27
28 # Could use checktool, but we want to check for baz or tla.
28 # Could use checktool, but we want to check for baz or tla.
29 self.execmd = None
29 self.execmd = None
@@ -21,6 +21,9 b' def matchoutput(cmd, regexp, ignorestatu'
21 ret = fh.close()
21 ret = fh.close()
22 return (ignorestatus or ret is None) and r.search(s)
22 return (ignorestatus or ret is None) and r.search(s)
23
23
24 def has_baz():
25 return matchoutput('baz --version 2>&1', r'baz Bazaar version')
26
24 def has_cvs():
27 def has_cvs():
25 return matchoutput('cvs --version 2>&1', r'Concurrent Versions System')
28 return matchoutput('cvs --version 2>&1', r'Concurrent Versions System')
26
29
@@ -102,6 +105,7 b' def has_unix_permissions():'
102 os.rmdir(d)
105 os.rmdir(d)
103
106
104 checks = {
107 checks = {
108 "baz": (has_baz, "GNU Arch baz client"),
105 "cvs": (has_cvs, "cvs client"),
109 "cvs": (has_cvs, "cvs client"),
106 "cvsps": (has_cvsps, "cvsps utility"),
110 "cvsps": (has_cvsps, "cvsps utility"),
107 "darcs": (has_darcs, "darcs client"),
111 "darcs": (has_darcs, "darcs client"),
General Comments 0
You need to be logged in to leave comments. Login now