##// END OF EJS Templates
tests: unify test-convert-hg-sink
Matt Mackall -
r12525:81bf25dd default
parent child Browse files
Show More
@@ -1,67 +1,124 b''
1 #!/bin/sh
2
3 cat >> $HGRCPATH <<EOF
4 [extensions]
5 convert=
6 [convert]
7 hg.saverev=False
8 EOF
9
10 hg init orig
11 cd orig
12 echo foo > foo
13 echo bar > bar
14 hg ci -qAm 'add foo and bar'
15
1
16 hg rm foo
2 $ cat >> $HGRCPATH <<EOF
17 hg ci -m 'remove foo'
3 > [extensions]
18
4 > convert=
19 mkdir foo
5 > [convert]
20 echo file > foo/file
6 > hg.saverev=False
21 hg ci -qAm 'add foo/file'
7 > EOF
8 $ hg init orig
9 $ cd orig
10 $ echo foo > foo
11 $ echo bar > bar
12 $ hg ci -qAm 'add foo and bar'
13 $ hg rm foo
14 $ hg ci -m 'remove foo'
15 $ mkdir foo
16 $ echo file > foo/file
17 $ hg ci -qAm 'add foo/file'
18 $ hg tag some-tag
19 $ hg log
20 changeset: 3:593cbf6fb2b4
21 tag: tip
22 user: test
23 date: Thu Jan 01 00:00:00 1970 +0000
24 summary: Added tag some-tag for changeset ad681a868e44
25
26 changeset: 2:ad681a868e44
27 tag: some-tag
28 user: test
29 date: Thu Jan 01 00:00:00 1970 +0000
30 summary: add foo/file
31
32 changeset: 1:cbba8ecc03b7
33 user: test
34 date: Thu Jan 01 00:00:00 1970 +0000
35 summary: remove foo
36
37 changeset: 0:327daa9251fa
38 user: test
39 date: Thu Jan 01 00:00:00 1970 +0000
40 summary: add foo and bar
41
42 $ cd ..
43 $ hg convert orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
44 initializing destination new repository
45 scanning source...
46 sorting...
47 converting...
48 3 add foo and bar
49 2 remove foo
50 1 add foo/file
51 0 Added tag some-tag for changeset ad681a868e44
52 $ cd new
53 $ hg out ../orig
54 comparing with ../orig
55 searching for changes
56 no changes found
57 [1]
22
58
23 hg tag some-tag
59 dirstate should be empty:
24
25 hg log
26 cd ..
27
28 hg convert orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
29 cd new
30 hg out ../orig
31
60
32 echo '% dirstate should be empty:'
61 $ hg debugstate
33 hg debugstate
62 $ hg parents -q
34 hg parents -q
63 $ hg up -C
64 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
65 $ hg copy bar baz
66
67 put something in the dirstate:
68
69 $ hg debugstate > debugstate
70 $ grep baz debugstate
71 a 0 -1 unset baz
72 copy: bar -> baz
73
74 add a new revision in the original repo
35
75
36 hg up -C
76 $ cd ../orig
37 hg copy bar baz
77 $ echo baz > baz
38 echo '% put something in the dirstate:'
78 $ hg ci -qAm 'add baz'
39 hg debugstate > debugstate
79 $ cd ..
40 grep baz debugstate
80 $ hg convert orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
41
81 scanning source...
42 echo '% add a new revision in the original repo'
82 sorting...
43 cd ../orig
83 converting...
44 echo baz > baz
84 0 add baz
45 hg ci -qAm 'add baz'
85 $ cd new
86 $ hg out ../orig
87 comparing with ../orig
88 searching for changes
89 no changes found
90 [1]
46
91
47 cd ..
92 dirstate should be the same (no output below):
48 hg convert orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
93
49 cd new
94 $ hg debugstate > new-debugstate
50 hg out ../orig
95 $ diff debugstate new-debugstate
51 echo '% dirstate should be the same (no output below):'
96
52 hg debugstate > new-debugstate
97 no copies
53 diff debugstate new-debugstate
98
99 $ hg up -C
100 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
101 $ hg debugrename baz
102 baz not renamed
103 $ cd ..
104
105 test tag rewriting
54
106
55 echo '% no copies'
107 $ cat > filemap <<EOF
56 hg up -C
108 > exclude foo
57 hg debugrename baz
109 > EOF
58 cd ..
110 $ hg convert --filemap filemap orig new-filemap 2>&1 | grep -v 'subversion python bindings could not be loaded'
59
111 initializing destination new-filemap repository
60 echo '% test tag rewriting'
112 scanning source...
61 cat > filemap <<EOF
113 sorting...
62 exclude foo
114 converting...
63 EOF
115 4 add foo and bar
64 hg convert --filemap filemap orig new-filemap 2>&1 | grep -v 'subversion python bindings could not be loaded'
116 3 remove foo
65 cd new-filemap
117 2 add foo/file
66 hg tags
118 1 Added tag some-tag for changeset ad681a868e44
67 cd ..
119 0 add baz
120 $ cd new-filemap
121 $ hg tags
122 tip 2:6f4fd1df87fb
123 some-tag 0:ba8636729451
124 $ cd ..
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now