##// END OF EJS Templates
tests: cleanup of svn url handling...
Mads Kiilerich -
r17033:0413f68d default
parent child Browse files
Show More
@@ -1,108 +1,105 b''
1
1
2 $ "$TESTDIR/hghave" svn svn-bindings || exit 80
2 $ "$TESTDIR/hghave" svn svn-bindings || exit 80
3 $ fix_path()
4 > {
5 > tr '\\' /
6 > }
7 $ echo "[extensions]" >> $HGRCPATH
3 $ echo "[extensions]" >> $HGRCPATH
8 $ echo "convert = " >> $HGRCPATH
4 $ echo "convert = " >> $HGRCPATH
9 $ echo "mq = " >> $HGRCPATH
5 $ echo "mq = " >> $HGRCPATH
10 $ svnpath=`pwd | fix_path`/svn-repo
6
11 $ svnadmin create "$svnpath"
7 $ SVNREPOPATH=`pwd`/svn-repo
12 $ cat > "$svnpath"/hooks/pre-revprop-change <<EOF
8 #if windows
9 $ SVNREPOURL=file:///`python -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
10 #else
11 $ SVNREPOURL=file://`python -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
12 #endif
13
14 $ svnadmin create "$SVNREPOPATH"
15 $ cat > "$SVNREPOPATH"/hooks/pre-revprop-change <<EOF
13 > #!/bin/sh
16 > #!/bin/sh
14 >
17 >
15 > REPOS="$1"
18 > REPOS="$1"
16 > REV="$2"
19 > REV="$2"
17 > USER="$3"
20 > USER="$3"
18 > PROPNAME="$4"
21 > PROPNAME="$4"
19 > ACTION="$5"
22 > ACTION="$5"
20 >
23 >
21 > if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ]; then exit 0; fi
24 > if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ]; then exit 0; fi
22 > if [ "$ACTION" = "A" -a "$PROPNAME" = "hg:convert-branch" ]; then exit 0; fi
25 > if [ "$ACTION" = "A" -a "$PROPNAME" = "hg:convert-branch" ]; then exit 0; fi
23 > if [ "$ACTION" = "A" -a "$PROPNAME" = "hg:convert-rev" ]; then exit 0; fi
26 > if [ "$ACTION" = "A" -a "$PROPNAME" = "hg:convert-rev" ]; then exit 0; fi
24 >
27 >
25 > echo "Changing prohibited revision property" >&2
28 > echo "Changing prohibited revision property" >&2
26 > exit 1
29 > exit 1
27 > EOF
30 > EOF
28 $ chmod +x "$svnpath"/hooks/pre-revprop-change
31 $ chmod +x "$SVNREPOPATH"/hooks/pre-revprop-change
29 $
32 $ svn co "$SVNREPOURL" "$SVNREPOPATH"-wc
30 $ # SVN wants all paths to start with a slash. Unfortunately,
31 $ # Windows ones don't. Handle that.
32 $ svnurl="$svnpath"
33 $ expr "$svnurl" : "\/" > /dev/null || svnurl="/$svnurl"
34 $ svnurl="file://$svnurl"
35 $ svn co "$svnurl" "$svnpath"-wc
36 Checked out revision 0.
33 Checked out revision 0.
37 $ cd "$svnpath"-wc
34 $ cd "$SVNREPOPATH"-wc
38 $ echo a > a
35 $ echo a > a
39 $ svn add a
36 $ svn add a
40 A a
37 A a
41 $ svn ci -m'added a' a
38 $ svn ci -m'added a' a
42 Adding a
39 Adding a
43 Transmitting file data .
40 Transmitting file data .
44 Committed revision 1.
41 Committed revision 1.
45 $ cd ..
42 $ cd ..
46
43
47 initial roundtrip
44 initial roundtrip
48
45
49 $ hg convert -s svn -d hg "$svnpath"-wc "$svnpath"-hg | grep -v initializing
46 $ hg convert -s svn -d hg "$SVNREPOPATH"-wc "$SVNREPOPATH"-hg | grep -v initializing
50 scanning source...
47 scanning source...
51 sorting...
48 sorting...
52 converting...
49 converting...
53 0 added a
50 0 added a
54 $ hg convert -s hg -d svn "$svnpath"-hg "$svnpath"-wc
51 $ hg convert -s hg -d svn "$SVNREPOPATH"-hg "$SVNREPOPATH"-wc
55 scanning source...
52 scanning source...
56 sorting...
53 sorting...
57 converting...
54 converting...
58
55
59 second roundtrip should do nothing
56 second roundtrip should do nothing
60
57
61 $ hg convert -s svn -d hg "$svnpath"-wc "$svnpath"-hg
58 $ hg convert -s svn -d hg "$SVNREPOPATH"-wc "$SVNREPOPATH"-hg
62 scanning source...
59 scanning source...
63 sorting...
60 sorting...
64 converting...
61 converting...
65 $ hg convert -s hg -d svn "$svnpath"-hg "$svnpath"-wc
62 $ hg convert -s hg -d svn "$SVNREPOPATH"-hg "$SVNREPOPATH"-wc
66 scanning source...
63 scanning source...
67 sorting...
64 sorting...
68 converting...
65 converting...
69
66
70 new hg rev
67 new hg rev
71
68
72 $ hg clone "$svnpath"-hg "$svnpath"-work
69 $ hg clone "$SVNREPOPATH"-hg "$SVNREPOPATH"-work
73 updating to branch default
70 updating to branch default
74 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
71 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
75 $ cd "$svnpath"-work
72 $ cd "$SVNREPOPATH"-work
76 $ echo b > b
73 $ echo b > b
77 $ hg add b
74 $ hg add b
78 $ hg ci -mb
75 $ hg ci -mb
79
76
80 adding an empty revision
77 adding an empty revision
81
78
82 $ hg qnew -m emtpy empty
79 $ hg qnew -m emtpy empty
83 $ hg qfinish -a
80 $ hg qfinish -a
84 $ cd ..
81 $ cd ..
85
82
86 echo hg to svn
83 echo hg to svn
87
84
88 $ hg --cwd "$svnpath"-hg pull -q "$svnpath"-work
85 $ hg --cwd "$SVNREPOPATH"-hg pull -q "$SVNREPOPATH"-work
89 $ hg convert -s hg -d svn "$svnpath"-hg "$svnpath"-wc
86 $ hg convert -s hg -d svn "$SVNREPOPATH"-hg "$SVNREPOPATH"-wc
90 scanning source...
87 scanning source...
91 sorting...
88 sorting...
92 converting...
89 converting...
93 1 b
90 1 b
94 0 emtpy
91 0 emtpy
95
92
96 svn back to hg should do nothing
93 svn back to hg should do nothing
97
94
98 $ hg convert -s svn -d hg "$svnpath"-wc "$svnpath"-hg
95 $ hg convert -s svn -d hg "$SVNREPOPATH"-wc "$SVNREPOPATH"-hg
99 scanning source...
96 scanning source...
100 sorting...
97 sorting...
101 converting...
98 converting...
102
99
103 hg back to svn should do nothing
100 hg back to svn should do nothing
104
101
105 $ hg convert -s hg -d svn "$svnpath"-hg "$svnpath"-wc
102 $ hg convert -s hg -d svn "$SVNREPOPATH"-hg "$SVNREPOPATH"-wc
106 scanning source...
103 scanning source...
107 sorting...
104 sorting...
108 converting...
105 converting...
@@ -1,251 +1,243 b''
1
1
2 $ "$TESTDIR/hghave" svn svn-bindings || exit 80
2 $ "$TESTDIR/hghave" svn svn-bindings || exit 80
3
3
4 $ fixpath()
5 > {
6 > tr '\\' /
7 > }
8 $ cat >> $HGRCPATH <<EOF
4 $ cat >> $HGRCPATH <<EOF
9 > [extensions]
5 > [extensions]
10 > convert =
6 > convert =
11 > graphlog =
7 > graphlog =
12 > EOF
8 > EOF
13
9
14 $ svnadmin create svn-repo
10 $ svnadmin create svn-repo
15 $ svnadmin load -q svn-repo < "$TESTDIR/svn/move.svndump"
11 $ svnadmin load -q svn-repo < "$TESTDIR/svn/move.svndump"
16 $ svnpath=`pwd | fixpath`
12 $ SVNREPOPATH=`pwd`/svn-repo
17
13 #if windows
18 SVN wants all paths to start with a slash. Unfortunately,
14 $ SVNREPOURL=file:///`python -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
19 Windows ones don't. Handle that.
15 #else
20
16 $ SVNREPOURL=file://`python -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
21 $ expr "$svnpath" : "\/" > /dev/null
17 #endif
22 > if [ $? -ne 0 ]; then
23 > svnpath="/$svnpath"
24 > fi
25 > svnurl="file://$svnpath/svn-repo"
26
18
27 Convert trunk and branches
19 Convert trunk and branches
28
20
29 $ hg convert --datesort "$svnurl"/subproject A-hg
21 $ hg convert --datesort "$SVNREPOURL"/subproject A-hg
30 initializing destination A-hg repository
22 initializing destination A-hg repository
31 scanning source...
23 scanning source...
32 sorting...
24 sorting...
33 converting...
25 converting...
34 13 createtrunk
26 13 createtrunk
35 12 moved1
27 12 moved1
36 11 moved1
28 11 moved1
37 10 moved2
29 10 moved2
38 9 changeb and rm d2
30 9 changeb and rm d2
39 8 changeb and rm d2
31 8 changeb and rm d2
40 7 moved1again
32 7 moved1again
41 6 moved1again
33 6 moved1again
42 5 copyfilefrompast
34 5 copyfilefrompast
43 4 copydirfrompast
35 4 copydirfrompast
44 3 add d3
36 3 add d3
45 2 copy dir and remove subdir
37 2 copy dir and remove subdir
46 1 add d4old
38 1 add d4old
47 0 rename d4old into d4new
39 0 rename d4old into d4new
48
40
49 $ cd A-hg
41 $ cd A-hg
50 $ hg glog --template '{rev} {desc|firstline} files: {files}\n'
42 $ hg glog --template '{rev} {desc|firstline} files: {files}\n'
51 o 13 rename d4old into d4new files: d4new/g d4old/g
43 o 13 rename d4old into d4new files: d4new/g d4old/g
52 |
44 |
53 o 12 add d4old files: d4old/g
45 o 12 add d4old files: d4old/g
54 |
46 |
55 o 11 copy dir and remove subdir files: d3/d31/e d4/d31/e d4/f
47 o 11 copy dir and remove subdir files: d3/d31/e d4/d31/e d4/f
56 |
48 |
57 o 10 add d3 files: d3/d31/e d3/f
49 o 10 add d3 files: d3/d31/e d3/f
58 |
50 |
59 o 9 copydirfrompast files: d2/d
51 o 9 copydirfrompast files: d2/d
60 |
52 |
61 o 8 copyfilefrompast files: d
53 o 8 copyfilefrompast files: d
62 |
54 |
63 o 7 moved1again files: d1/b d1/c
55 o 7 moved1again files: d1/b d1/c
64 |
56 |
65 | o 6 moved1again files:
57 | o 6 moved1again files:
66 | |
58 | |
67 o | 5 changeb and rm d2 files: d1/b d2/d
59 o | 5 changeb and rm d2 files: d1/b d2/d
68 | |
60 | |
69 | o 4 changeb and rm d2 files: b
61 | o 4 changeb and rm d2 files: b
70 | |
62 | |
71 o | 3 moved2 files: d2/d
63 o | 3 moved2 files: d2/d
72 | |
64 | |
73 o | 2 moved1 files: d1/b d1/c
65 o | 2 moved1 files: d1/b d1/c
74 | |
66 | |
75 | o 1 moved1 files: b c
67 | o 1 moved1 files: b c
76 |
68 |
77 o 0 createtrunk files:
69 o 0 createtrunk files:
78
70
79
71
80 Check move copy records
72 Check move copy records
81
73
82 $ hg st --rev 12:13 --copies
74 $ hg st --rev 12:13 --copies
83 A d4new/g
75 A d4new/g
84 d4old/g
76 d4old/g
85 R d4old/g
77 R d4old/g
86
78
87 Check branches
79 Check branches
88
80
89 $ hg branches
81 $ hg branches
90 default 13:* (glob)
82 default 13:* (glob)
91 d1 6:* (glob)
83 d1 6:* (glob)
92 $ cd ..
84 $ cd ..
93
85
94 $ mkdir test-replace
86 $ mkdir test-replace
95 $ cd test-replace
87 $ cd test-replace
96 $ svnadmin create svn-repo
88 $ svnadmin create svn-repo
97 $ svnadmin load -q svn-repo < "$TESTDIR/svn/replace.svndump"
89 $ svnadmin load -q svn-repo < "$TESTDIR/svn/replace.svndump"
98
90
99 Convert files being replaced by directories
91 Convert files being replaced by directories
100
92
101 $ hg convert svn-repo hg-repo
93 $ hg convert svn-repo hg-repo
102 initializing destination hg-repo repository
94 initializing destination hg-repo repository
103 scanning source...
95 scanning source...
104 sorting...
96 sorting...
105 converting...
97 converting...
106 6 initial
98 6 initial
107 5 clobber symlink
99 5 clobber symlink
108 4 clobber1
100 4 clobber1
109 3 clobber2
101 3 clobber2
110 2 adddb
102 2 adddb
111 1 branch
103 1 branch
112 0 clobberdir
104 0 clobberdir
113
105
114 $ cd hg-repo
106 $ cd hg-repo
115
107
116 Manifest before
108 Manifest before
117
109
118 $ hg -v manifest -r 1
110 $ hg -v manifest -r 1
119 644 a
111 644 a
120 644 d/b
112 644 d/b
121 644 d2/a
113 644 d2/a
122 644 @ dlink
114 644 @ dlink
123 644 @ dlink2
115 644 @ dlink2
124 644 dlink3
116 644 dlink3
125
117
126 Manifest after clobber1
118 Manifest after clobber1
127
119
128 $ hg -v manifest -r 2
120 $ hg -v manifest -r 2
129 644 a/b
121 644 a/b
130 644 d/b
122 644 d/b
131 644 d2/a
123 644 d2/a
132 644 dlink/b
124 644 dlink/b
133 644 @ dlink2
125 644 @ dlink2
134 644 dlink3
126 644 dlink3
135
127
136 Manifest after clobber2
128 Manifest after clobber2
137
129
138 $ hg -v manifest -r 3
130 $ hg -v manifest -r 3
139 644 a/b
131 644 a/b
140 644 d/b
132 644 d/b
141 644 d2/a
133 644 d2/a
142 644 dlink/b
134 644 dlink/b
143 644 @ dlink2
135 644 @ dlink2
144 644 @ dlink3
136 644 @ dlink3
145
137
146 Manifest after clobberdir
138 Manifest after clobberdir
147
139
148 $ hg -v manifest -r 6
140 $ hg -v manifest -r 6
149 644 a/b
141 644 a/b
150 644 d/b
142 644 d/b
151 644 d2/a
143 644 d2/a
152 644 d2/c
144 644 d2/c
153 644 dlink/b
145 644 dlink/b
154 644 @ dlink2
146 644 @ dlink2
155 644 @ dlink3
147 644 @ dlink3
156
148
157 Try updating
149 Try updating
158
150
159 $ hg up -qC default
151 $ hg up -qC default
160 $ cd ..
152 $ cd ..
161
153
162 Test convert progress bar'
154 Test convert progress bar'
163
155
164 $ cat >> $HGRCPATH <<EOF
156 $ cat >> $HGRCPATH <<EOF
165 > [extensions]
157 > [extensions]
166 > progress =
158 > progress =
167 > [progress]
159 > [progress]
168 > assume-tty = 1
160 > assume-tty = 1
169 > delay = 0
161 > delay = 0
170 > changedelay = 0
162 > changedelay = 0
171 > format = topic bar number
163 > format = topic bar number
172 > refresh = 0
164 > refresh = 0
173 > width = 60
165 > width = 60
174 > EOF
166 > EOF
175
167
176 $ hg convert svn-repo hg-progress 2>&1 | "$TESTDIR/filtercr.py"
168 $ hg convert svn-repo hg-progress 2>&1 | "$TESTDIR/filtercr.py"
177
169
178 scanning [ <=> ] 1
170 scanning [ <=> ] 1
179 scanning [ <=> ] 2
171 scanning [ <=> ] 2
180 scanning [ <=> ] 3
172 scanning [ <=> ] 3
181 scanning [ <=> ] 4
173 scanning [ <=> ] 4
182 scanning [ <=> ] 5
174 scanning [ <=> ] 5
183 scanning [ <=> ] 6
175 scanning [ <=> ] 6
184 scanning [ <=> ] 7
176 scanning [ <=> ] 7
185
177
186 converting [ ] 0/7
178 converting [ ] 0/7
187 getting files [=====> ] 1/6
179 getting files [=====> ] 1/6
188 getting files [============> ] 2/6
180 getting files [============> ] 2/6
189 getting files [==================> ] 3/6
181 getting files [==================> ] 3/6
190 getting files [=========================> ] 4/6
182 getting files [=========================> ] 4/6
191 getting files [===============================> ] 5/6
183 getting files [===============================> ] 5/6
192 getting files [======================================>] 6/6
184 getting files [======================================>] 6/6
193
185
194 converting [=====> ] 1/7
186 converting [=====> ] 1/7
195 scanning paths [ ] 0/1
187 scanning paths [ ] 0/1
196 getting files [======================================>] 1/1
188 getting files [======================================>] 1/1
197
189
198 converting [===========> ] 2/7
190 converting [===========> ] 2/7
199 scanning paths [ ] 0/2
191 scanning paths [ ] 0/2
200 scanning paths [==================> ] 1/2
192 scanning paths [==================> ] 1/2
201 getting files [========> ] 1/4
193 getting files [========> ] 1/4
202 getting files [==================> ] 2/4
194 getting files [==================> ] 2/4
203 getting files [============================> ] 3/4
195 getting files [============================> ] 3/4
204 getting files [======================================>] 4/4
196 getting files [======================================>] 4/4
205
197
206 converting [=================> ] 3/7
198 converting [=================> ] 3/7
207 scanning paths [ ] 0/1
199 scanning paths [ ] 0/1
208 getting files [======================================>] 1/1
200 getting files [======================================>] 1/1
209
201
210 converting [=======================> ] 4/7
202 converting [=======================> ] 4/7
211 scanning paths [ ] 0/1
203 scanning paths [ ] 0/1
212 getting files [======================================>] 1/1
204 getting files [======================================>] 1/1
213
205
214 converting [=============================> ] 5/7
206 converting [=============================> ] 5/7
215 scanning paths [ ] 0/3
207 scanning paths [ ] 0/3
216 scanning paths [===========> ] 1/3
208 scanning paths [===========> ] 1/3
217 scanning paths [========================> ] 2/3
209 scanning paths [========================> ] 2/3
218 getting files [===> ] 1/8
210 getting files [===> ] 1/8
219 getting files [========> ] 2/8
211 getting files [========> ] 2/8
220 getting files [=============> ] 3/8
212 getting files [=============> ] 3/8
221 getting files [==================> ] 4/8
213 getting files [==================> ] 4/8
222 getting files [=======================> ] 5/8
214 getting files [=======================> ] 5/8
223 getting files [============================> ] 6/8
215 getting files [============================> ] 6/8
224 getting files [=================================> ] 7/8
216 getting files [=================================> ] 7/8
225 getting files [======================================>] 8/8
217 getting files [======================================>] 8/8
226
218
227 converting [===================================> ] 6/7
219 converting [===================================> ] 6/7
228 scanning paths [ ] 0/1
220 scanning paths [ ] 0/1
229 getting files [===> ] 1/8
221 getting files [===> ] 1/8
230 getting files [========> ] 2/8
222 getting files [========> ] 2/8
231 getting files [=============> ] 3/8
223 getting files [=============> ] 3/8
232 getting files [==================> ] 4/8
224 getting files [==================> ] 4/8
233 getting files [=======================> ] 5/8
225 getting files [=======================> ] 5/8
234 getting files [============================> ] 6/8
226 getting files [============================> ] 6/8
235 getting files [=================================> ] 7/8
227 getting files [=================================> ] 7/8
236 getting files [======================================>] 8/8
228 getting files [======================================>] 8/8
237
229
238 initializing destination hg-progress repository
230 initializing destination hg-progress repository
239 scanning source...
231 scanning source...
240 sorting...
232 sorting...
241 converting...
233 converting...
242 6 initial
234 6 initial
243 5 clobber symlink
235 5 clobber symlink
244 4 clobber1
236 4 clobber1
245 3 clobber2
237 3 clobber2
246 2 adddb
238 2 adddb
247 1 branch
239 1 branch
248 0 clobberdir
240 0 clobberdir
249
241
250
242
251 $ cd ..
243 $ cd ..
@@ -1,436 +1,432 b''
1 $ "$TESTDIR/hghave" svn13 || exit 80
1 $ "$TESTDIR/hghave" svn13 || exit 80
2
2
3 $ fixpath()
4 > {
5 > tr '\\' /
6 > }
7 $ svnupanddisplay()
3 $ svnupanddisplay()
8 > {
4 > {
9 > (
5 > (
10 > cd $1;
6 > cd $1;
11 > svn up -q;
7 > svn up -q;
12 > svn st -v | fixpath | sed 's/ */ /g' | sort
8 > svn st -v | sed 's/ */ /g' | sort
13 > limit=''
9 > limit=''
14 > if [ $2 -gt 0 ]; then
10 > if [ $2 -gt 0 ]; then
15 > limit="--limit=$2"
11 > limit="--limit=$2"
16 > fi
12 > fi
17 > svn log --xml -v $limit | python "$TESTDIR/svnxml.py"
13 > svn log --xml -v $limit | python "$TESTDIR/svnxml.py"
18 > )
14 > )
19 > }
15 > }
20
16
21 $ cat >> $HGRCPATH <<EOF
17 $ cat >> $HGRCPATH <<EOF
22 > [extensions]
18 > [extensions]
23 > convert =
19 > convert =
24 > graphlog =
20 > graphlog =
25 > EOF
21 > EOF
26
22
27 $ hg init a
23 $ hg init a
28
24
29 Add
25 Add
30
26
31 $ echo a > a/a
27 $ echo a > a/a
32 $ mkdir -p a/d1/d2
28 $ mkdir -p a/d1/d2
33 $ echo b > a/d1/d2/b
29 $ echo b > a/d1/d2/b
34 $ hg --cwd a ci -d '0 0' -A -m 'add a file'
30 $ hg --cwd a ci -d '0 0' -A -m 'add a file'
35 adding a
31 adding a
36 adding d1/d2/b
32 adding d1/d2/b
37
33
38 Modify
34 Modify
39
35
40 $ "$TESTDIR/svn-safe-append.py" a a/a
36 $ "$TESTDIR/svn-safe-append.py" a a/a
41 $ hg --cwd a ci -d '1 0' -m 'modify a file'
37 $ hg --cwd a ci -d '1 0' -m 'modify a file'
42 $ hg --cwd a tip -q
38 $ hg --cwd a tip -q
43 1:e0e2b8a9156b
39 1:e0e2b8a9156b
44
40
45 $ hg convert -d svn a
41 $ hg convert -d svn a
46 assuming destination a-hg
42 assuming destination a-hg
47 initializing svn repository 'a-hg'
43 initializing svn repository 'a-hg'
48 initializing svn working copy 'a-hg-wc'
44 initializing svn working copy 'a-hg-wc'
49 scanning source...
45 scanning source...
50 sorting...
46 sorting...
51 converting...
47 converting...
52 1 add a file
48 1 add a file
53 0 modify a file
49 0 modify a file
54 $ svnupanddisplay a-hg-wc 2
50 $ svnupanddisplay a-hg-wc 2
55 2 1 test d1
51 2 1 test d1
56 2 1 test d1/d2
52 2 1 test d1/d2
57 2 1 test d1/d2/b
53 2 1 test d1/d2/b
58 2 2 test .
54 2 2 test .
59 2 2 test a
55 2 2 test a
60 revision: 2
56 revision: 2
61 author: test
57 author: test
62 msg: modify a file
58 msg: modify a file
63 M /a
59 M /a
64 revision: 1
60 revision: 1
65 author: test
61 author: test
66 msg: add a file
62 msg: add a file
67 A /a
63 A /a
68 A /d1
64 A /d1
69 A /d1/d2
65 A /d1/d2
70 A /d1/d2/b
66 A /d1/d2/b
71 $ ls a a-hg-wc
67 $ ls a a-hg-wc
72 a:
68 a:
73 a
69 a
74 d1
70 d1
75
71
76 a-hg-wc:
72 a-hg-wc:
77 a
73 a
78 d1
74 d1
79 $ cmp a/a a-hg-wc/a
75 $ cmp a/a a-hg-wc/a
80
76
81 Rename
77 Rename
82
78
83 $ hg --cwd a mv a b
79 $ hg --cwd a mv a b
84 $ hg --cwd a ci -d '2 0' -m 'rename a file'
80 $ hg --cwd a ci -d '2 0' -m 'rename a file'
85 $ hg --cwd a tip -q
81 $ hg --cwd a tip -q
86 2:eb5169441d43
82 2:eb5169441d43
87
83
88 $ hg convert -d svn a
84 $ hg convert -d svn a
89 assuming destination a-hg
85 assuming destination a-hg
90 initializing svn working copy 'a-hg-wc'
86 initializing svn working copy 'a-hg-wc'
91 scanning source...
87 scanning source...
92 sorting...
88 sorting...
93 converting...
89 converting...
94 0 rename a file
90 0 rename a file
95 $ svnupanddisplay a-hg-wc 1
91 $ svnupanddisplay a-hg-wc 1
96 3 1 test d1
92 3 1 test d1
97 3 1 test d1/d2
93 3 1 test d1/d2
98 3 1 test d1/d2/b
94 3 1 test d1/d2/b
99 3 3 test .
95 3 3 test .
100 3 3 test b
96 3 3 test b
101 revision: 3
97 revision: 3
102 author: test
98 author: test
103 msg: rename a file
99 msg: rename a file
104 D /a
100 D /a
105 A /b (from /a@2)
101 A /b (from /a@2)
106 $ ls a a-hg-wc
102 $ ls a a-hg-wc
107 a:
103 a:
108 b
104 b
109 d1
105 d1
110
106
111 a-hg-wc:
107 a-hg-wc:
112 b
108 b
113 d1
109 d1
114
110
115 Copy
111 Copy
116
112
117 $ hg --cwd a cp b c
113 $ hg --cwd a cp b c
118
114
119 $ hg --cwd a ci -d '3 0' -m 'copy a file'
115 $ hg --cwd a ci -d '3 0' -m 'copy a file'
120 $ hg --cwd a tip -q
116 $ hg --cwd a tip -q
121 3:60effef6ab48
117 3:60effef6ab48
122
118
123 $ hg convert -d svn a
119 $ hg convert -d svn a
124 assuming destination a-hg
120 assuming destination a-hg
125 initializing svn working copy 'a-hg-wc'
121 initializing svn working copy 'a-hg-wc'
126 scanning source...
122 scanning source...
127 sorting...
123 sorting...
128 converting...
124 converting...
129 0 copy a file
125 0 copy a file
130 $ svnupanddisplay a-hg-wc 1
126 $ svnupanddisplay a-hg-wc 1
131 4 1 test d1
127 4 1 test d1
132 4 1 test d1/d2
128 4 1 test d1/d2
133 4 1 test d1/d2/b
129 4 1 test d1/d2/b
134 4 3 test b
130 4 3 test b
135 4 4 test .
131 4 4 test .
136 4 4 test c
132 4 4 test c
137 revision: 4
133 revision: 4
138 author: test
134 author: test
139 msg: copy a file
135 msg: copy a file
140 A /c (from /b@3)
136 A /c (from /b@3)
141 $ ls a a-hg-wc
137 $ ls a a-hg-wc
142 a:
138 a:
143 b
139 b
144 c
140 c
145 d1
141 d1
146
142
147 a-hg-wc:
143 a-hg-wc:
148 b
144 b
149 c
145 c
150 d1
146 d1
151
147
152 $ hg --cwd a rm b
148 $ hg --cwd a rm b
153
149
154 Remove
150 Remove
155
151
156 $ hg --cwd a ci -d '4 0' -m 'remove a file'
152 $ hg --cwd a ci -d '4 0' -m 'remove a file'
157 $ hg --cwd a tip -q
153 $ hg --cwd a tip -q
158 4:87bbe3013fb6
154 4:87bbe3013fb6
159
155
160 $ hg convert -d svn a
156 $ hg convert -d svn a
161 assuming destination a-hg
157 assuming destination a-hg
162 initializing svn working copy 'a-hg-wc'
158 initializing svn working copy 'a-hg-wc'
163 scanning source...
159 scanning source...
164 sorting...
160 sorting...
165 converting...
161 converting...
166 0 remove a file
162 0 remove a file
167 $ svnupanddisplay a-hg-wc 1
163 $ svnupanddisplay a-hg-wc 1
168 5 1 test d1
164 5 1 test d1
169 5 1 test d1/d2
165 5 1 test d1/d2
170 5 1 test d1/d2/b
166 5 1 test d1/d2/b
171 5 4 test c
167 5 4 test c
172 5 5 test .
168 5 5 test .
173 revision: 5
169 revision: 5
174 author: test
170 author: test
175 msg: remove a file
171 msg: remove a file
176 D /b
172 D /b
177 $ ls a a-hg-wc
173 $ ls a a-hg-wc
178 a:
174 a:
179 c
175 c
180 d1
176 d1
181
177
182 a-hg-wc:
178 a-hg-wc:
183 c
179 c
184 d1
180 d1
185
181
186 Executable
182 Executable
187
183
188 #if execbit
184 #if execbit
189 $ chmod +x a/c
185 $ chmod +x a/c
190 #else
186 #else
191 $ echo fake >> a/c
187 $ echo fake >> a/c
192 #endif
188 #endif
193 $ hg --cwd a ci -d '5 0' -m 'make a file executable'
189 $ hg --cwd a ci -d '5 0' -m 'make a file executable'
194 #if execbit
190 #if execbit
195 $ hg --cwd a tip -q
191 $ hg --cwd a tip -q
196 5:ff42e473c340
192 5:ff42e473c340
197 #else
193 #else
198 $ hg --cwd a tip -q
194 $ hg --cwd a tip -q
199 5:817a700c8cf1
195 5:817a700c8cf1
200 #endif
196 #endif
201
197
202 $ hg convert -d svn a
198 $ hg convert -d svn a
203 assuming destination a-hg
199 assuming destination a-hg
204 initializing svn working copy 'a-hg-wc'
200 initializing svn working copy 'a-hg-wc'
205 scanning source...
201 scanning source...
206 sorting...
202 sorting...
207 converting...
203 converting...
208 0 make a file executable
204 0 make a file executable
209 $ svnupanddisplay a-hg-wc 1
205 $ svnupanddisplay a-hg-wc 1
210 6 1 test d1
206 6 1 test d1
211 6 1 test d1/d2
207 6 1 test d1/d2
212 6 1 test d1/d2/b
208 6 1 test d1/d2/b
213 6 6 test .
209 6 6 test .
214 6 6 test c
210 6 6 test c
215 revision: 6
211 revision: 6
216 author: test
212 author: test
217 msg: make a file executable
213 msg: make a file executable
218 M /c
214 M /c
219 #if execbit
215 #if execbit
220 $ test -x a-hg-wc/c
216 $ test -x a-hg-wc/c
221 #endif
217 #endif
222
218
223 #if symlink
219 #if symlink
224
220
225 Symlinks
221 Symlinks
226
222
227 $ ln -s a/missing a/link
223 $ ln -s a/missing a/link
228 $ hg --cwd a commit -Am 'add symlink'
224 $ hg --cwd a commit -Am 'add symlink'
229 adding link
225 adding link
230 $ hg --cwd a mv link newlink
226 $ hg --cwd a mv link newlink
231 $ hg --cwd a commit -m 'move symlink'
227 $ hg --cwd a commit -m 'move symlink'
232 $ hg convert -d svn a
228 $ hg convert -d svn a
233 assuming destination a-hg
229 assuming destination a-hg
234 initializing svn working copy 'a-hg-wc'
230 initializing svn working copy 'a-hg-wc'
235 scanning source...
231 scanning source...
236 sorting...
232 sorting...
237 converting...
233 converting...
238 1 add symlink
234 1 add symlink
239 0 move symlink
235 0 move symlink
240 $ svnupanddisplay a-hg-wc 1
236 $ svnupanddisplay a-hg-wc 1
241 8 1 test d1
237 8 1 test d1
242 8 1 test d1/d2
238 8 1 test d1/d2
243 8 1 test d1/d2/b
239 8 1 test d1/d2/b
244 8 6 test c
240 8 6 test c
245 8 8 test .
241 8 8 test .
246 8 8 test newlink
242 8 8 test newlink
247 revision: 8
243 revision: 8
248 author: test
244 author: test
249 msg: move symlink
245 msg: move symlink
250 D /link
246 D /link
251 A /newlink (from /link@7)
247 A /newlink (from /link@7)
252
248
253 #endif
249 #endif
254
250
255 $ rm -rf a a-hg a-hg-wc
251 $ rm -rf a a-hg a-hg-wc
256
252
257
253
258 Executable in new directory
254 Executable in new directory
259
255
260 $ hg init a
256 $ hg init a
261
257
262 $ mkdir a/d1
258 $ mkdir a/d1
263 $ echo a > a/d1/a
259 $ echo a > a/d1/a
264 #if execbit
260 #if execbit
265 $ chmod +x a/d1/a
261 $ chmod +x a/d1/a
266 #else
262 #else
267 $ echo fake >> a/d1/a
263 $ echo fake >> a/d1/a
268 #endif
264 #endif
269 $ hg --cwd a ci -d '0 0' -A -m 'add executable file in new directory'
265 $ hg --cwd a ci -d '0 0' -A -m 'add executable file in new directory'
270 adding d1/a
266 adding d1/a
271
267
272 $ hg convert -d svn a
268 $ hg convert -d svn a
273 assuming destination a-hg
269 assuming destination a-hg
274 initializing svn repository 'a-hg'
270 initializing svn repository 'a-hg'
275 initializing svn working copy 'a-hg-wc'
271 initializing svn working copy 'a-hg-wc'
276 scanning source...
272 scanning source...
277 sorting...
273 sorting...
278 converting...
274 converting...
279 0 add executable file in new directory
275 0 add executable file in new directory
280 $ svnupanddisplay a-hg-wc 1
276 $ svnupanddisplay a-hg-wc 1
281 1 1 test .
277 1 1 test .
282 1 1 test d1
278 1 1 test d1
283 1 1 test d1/a
279 1 1 test d1/a
284 revision: 1
280 revision: 1
285 author: test
281 author: test
286 msg: add executable file in new directory
282 msg: add executable file in new directory
287 A /d1
283 A /d1
288 A /d1/a
284 A /d1/a
289 #if execbit
285 #if execbit
290 $ test -x a-hg-wc/d1/a
286 $ test -x a-hg-wc/d1/a
291 #endif
287 #endif
292
288
293 Copy to new directory
289 Copy to new directory
294
290
295 $ mkdir a/d2
291 $ mkdir a/d2
296 $ hg --cwd a cp d1/a d2/a
292 $ hg --cwd a cp d1/a d2/a
297 $ hg --cwd a ci -d '1 0' -A -m 'copy file to new directory'
293 $ hg --cwd a ci -d '1 0' -A -m 'copy file to new directory'
298
294
299 $ hg convert -d svn a
295 $ hg convert -d svn a
300 assuming destination a-hg
296 assuming destination a-hg
301 initializing svn working copy 'a-hg-wc'
297 initializing svn working copy 'a-hg-wc'
302 scanning source...
298 scanning source...
303 sorting...
299 sorting...
304 converting...
300 converting...
305 0 copy file to new directory
301 0 copy file to new directory
306 $ svnupanddisplay a-hg-wc 1
302 $ svnupanddisplay a-hg-wc 1
307 2 1 test d1
303 2 1 test d1
308 2 1 test d1/a
304 2 1 test d1/a
309 2 2 test .
305 2 2 test .
310 2 2 test d2
306 2 2 test d2
311 2 2 test d2/a
307 2 2 test d2/a
312 revision: 2
308 revision: 2
313 author: test
309 author: test
314 msg: copy file to new directory
310 msg: copy file to new directory
315 A /d2
311 A /d2
316 A /d2/a (from /d1/a@1)
312 A /d2/a (from /d1/a@1)
317
313
318 Branchy history
314 Branchy history
319
315
320 $ hg init b
316 $ hg init b
321 $ echo base > b/b
317 $ echo base > b/b
322 $ hg --cwd b ci -d '0 0' -Ambase
318 $ hg --cwd b ci -d '0 0' -Ambase
323 adding b
319 adding b
324
320
325 $ "$TESTDIR/svn-safe-append.py" left-1 b/b
321 $ "$TESTDIR/svn-safe-append.py" left-1 b/b
326 $ echo left-1 > b/left-1
322 $ echo left-1 > b/left-1
327 $ hg --cwd b ci -d '1 0' -Amleft-1
323 $ hg --cwd b ci -d '1 0' -Amleft-1
328 adding left-1
324 adding left-1
329
325
330 $ "$TESTDIR/svn-safe-append.py" left-2 b/b
326 $ "$TESTDIR/svn-safe-append.py" left-2 b/b
331 $ echo left-2 > b/left-2
327 $ echo left-2 > b/left-2
332 $ hg --cwd b ci -d '2 0' -Amleft-2
328 $ hg --cwd b ci -d '2 0' -Amleft-2
333 adding left-2
329 adding left-2
334
330
335 $ hg --cwd b up 0
331 $ hg --cwd b up 0
336 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
332 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
337
333
338 $ "$TESTDIR/svn-safe-append.py" right-1 b/b
334 $ "$TESTDIR/svn-safe-append.py" right-1 b/b
339 $ echo right-1 > b/right-1
335 $ echo right-1 > b/right-1
340 $ hg --cwd b ci -d '3 0' -Amright-1
336 $ hg --cwd b ci -d '3 0' -Amright-1
341 adding right-1
337 adding right-1
342 created new head
338 created new head
343
339
344 $ "$TESTDIR/svn-safe-append.py" right-2 b/b
340 $ "$TESTDIR/svn-safe-append.py" right-2 b/b
345 $ echo right-2 > b/right-2
341 $ echo right-2 > b/right-2
346 $ hg --cwd b ci -d '4 0' -Amright-2
342 $ hg --cwd b ci -d '4 0' -Amright-2
347 adding right-2
343 adding right-2
348
344
349 $ hg --cwd b up -C 2
345 $ hg --cwd b up -C 2
350 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
346 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
351 $ hg --cwd b merge
347 $ hg --cwd b merge
352 merging b
348 merging b
353 warning: conflicts during merge.
349 warning: conflicts during merge.
354 merging b incomplete! (edit conflicts, then use 'hg resolve --mark')
350 merging b incomplete! (edit conflicts, then use 'hg resolve --mark')
355 2 files updated, 0 files merged, 0 files removed, 1 files unresolved
351 2 files updated, 0 files merged, 0 files removed, 1 files unresolved
356 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
352 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
357 [1]
353 [1]
358 $ hg --cwd b revert -r 2 b
354 $ hg --cwd b revert -r 2 b
359 $ hg --cwd b resolve -m b
355 $ hg --cwd b resolve -m b
360 $ hg --cwd b ci -d '5 0' -m 'merge'
356 $ hg --cwd b ci -d '5 0' -m 'merge'
361
357
362 Expect 4 changes
358 Expect 4 changes
363
359
364 $ hg convert -d svn b
360 $ hg convert -d svn b
365 assuming destination b-hg
361 assuming destination b-hg
366 initializing svn repository 'b-hg'
362 initializing svn repository 'b-hg'
367 initializing svn working copy 'b-hg-wc'
363 initializing svn working copy 'b-hg-wc'
368 scanning source...
364 scanning source...
369 sorting...
365 sorting...
370 converting...
366 converting...
371 5 base
367 5 base
372 4 left-1
368 4 left-1
373 3 left-2
369 3 left-2
374 2 right-1
370 2 right-1
375 1 right-2
371 1 right-2
376 0 merge
372 0 merge
377
373
378 $ svnupanddisplay b-hg-wc 0
374 $ svnupanddisplay b-hg-wc 0
379 4 2 test left-1
375 4 2 test left-1
380 4 3 test b
376 4 3 test b
381 4 3 test left-2
377 4 3 test left-2
382 4 4 test .
378 4 4 test .
383 4 4 test right-1
379 4 4 test right-1
384 4 4 test right-2
380 4 4 test right-2
385 revision: 4
381 revision: 4
386 author: test
382 author: test
387 msg: merge
383 msg: merge
388 A /right-1
384 A /right-1
389 A /right-2
385 A /right-2
390 revision: 3
386 revision: 3
391 author: test
387 author: test
392 msg: left-2
388 msg: left-2
393 M /b
389 M /b
394 A /left-2
390 A /left-2
395 revision: 2
391 revision: 2
396 author: test
392 author: test
397 msg: left-1
393 msg: left-1
398 M /b
394 M /b
399 A /left-1
395 A /left-1
400 revision: 1
396 revision: 1
401 author: test
397 author: test
402 msg: base
398 msg: base
403 A /b
399 A /b
404
400
405 Tags are not supported, but must not break conversion
401 Tags are not supported, but must not break conversion
406
402
407 $ rm -rf a a-hg a-hg-wc
403 $ rm -rf a a-hg a-hg-wc
408 $ hg init a
404 $ hg init a
409 $ echo a > a/a
405 $ echo a > a/a
410 $ hg --cwd a ci -d '0 0' -A -m 'Add file a'
406 $ hg --cwd a ci -d '0 0' -A -m 'Add file a'
411 adding a
407 adding a
412 $ hg --cwd a tag -d '1 0' -m 'Tagged as v1.0' v1.0
408 $ hg --cwd a tag -d '1 0' -m 'Tagged as v1.0' v1.0
413
409
414 $ hg convert -d svn a
410 $ hg convert -d svn a
415 assuming destination a-hg
411 assuming destination a-hg
416 initializing svn repository 'a-hg'
412 initializing svn repository 'a-hg'
417 initializing svn working copy 'a-hg-wc'
413 initializing svn working copy 'a-hg-wc'
418 scanning source...
414 scanning source...
419 sorting...
415 sorting...
420 converting...
416 converting...
421 1 Add file a
417 1 Add file a
422 0 Tagged as v1.0
418 0 Tagged as v1.0
423 writing Subversion tags is not yet implemented
419 writing Subversion tags is not yet implemented
424 $ svnupanddisplay a-hg-wc 2
420 $ svnupanddisplay a-hg-wc 2
425 2 1 test a
421 2 1 test a
426 2 2 test .
422 2 2 test .
427 2 2 test .hgtags
423 2 2 test .hgtags
428 revision: 2
424 revision: 2
429 author: test
425 author: test
430 msg: Tagged as v1.0
426 msg: Tagged as v1.0
431 A /.hgtags
427 A /.hgtags
432 revision: 1
428 revision: 1
433 author: test
429 author: test
434 msg: Add file a
430 msg: Add file a
435 A /a
431 A /a
436 $ rm -rf a a-hg a-hg-wc
432 $ rm -rf a a-hg a-hg-wc
@@ -1,210 +1,203 b''
1
1
2 $ "$TESTDIR/hghave" svn svn-bindings || exit 80
2 $ "$TESTDIR/hghave" svn svn-bindings || exit 80
3
3
4 $ fixpath()
5 > {
6 > tr '\\' /
7 > }
8 $ cat >> $HGRCPATH <<EOF
4 $ cat >> $HGRCPATH <<EOF
9 > [extensions]
5 > [extensions]
10 > convert =
6 > convert =
11 > graphlog =
7 > graphlog =
12 > [convert]
8 > [convert]
13 > svn.trunk = mytrunk
9 > svn.trunk = mytrunk
14 > EOF
10 > EOF
15
11
16 $ svnadmin create svn-repo
12 $ svnadmin create svn-repo
17 $ svnpath=`pwd | fixpath`
13 $ SVNREPOPATH=`pwd`/svn-repo
18
14 #if windows
19
15 $ SVNREPOURL=file:///`python -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
20 $ expr "$svnpath" : "\/" > /dev/null
16 #else
21 > if [ $? -ne 0 ]; then
17 $ SVNREPOURL=file://`python -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
22 > svnpath="/$svnpath"
18 #endif
23 > fi
24 > svnurl="file://$svnpath/svn-repo"
25
19
26 Now test that it works with trunk/tags layout, but no branches yet.
20 Now test that it works with trunk/tags layout, but no branches yet.
27
21
28 Initial svn import
22 Initial svn import
29
23
30 $ mkdir projB
24 $ mkdir projB
31 $ cd projB
25 $ cd projB
32 $ mkdir mytrunk
26 $ mkdir mytrunk
33 $ mkdir tags
27 $ mkdir tags
34 $ cd ..
28 $ cd ..
35
29
36 $ svnurl="file://$svnpath/svn-repo/proj%20B"
30 $ svn import -m "init projB" projB "$SVNREPOURL/proj%20B" | sort
37 $ svn import -m "init projB" projB "$svnurl" | fixpath | sort
38
31
39 Adding projB/mytrunk
32 Adding projB/mytrunk
40 Adding projB/tags
33 Adding projB/tags
41 Committed revision 1.
34 Committed revision 1.
42
35
43 Update svn repository
36 Update svn repository
44
37
45 $ svn co "$svnurl"/mytrunk B | fixpath
38 $ svn co "$SVNREPOURL/proj%20B/mytrunk" B
46 Checked out revision 1.
39 Checked out revision 1.
47 $ cd B
40 $ cd B
48 $ echo hello > 'letter .txt'
41 $ echo hello > 'letter .txt'
49 $ svn add 'letter .txt'
42 $ svn add 'letter .txt'
50 A letter .txt
43 A letter .txt
51 $ svn ci -m hello
44 $ svn ci -m hello
52 Adding letter .txt
45 Adding letter .txt
53 Transmitting file data .
46 Transmitting file data .
54 Committed revision 2.
47 Committed revision 2.
55
48
56 $ "$TESTDIR/svn-safe-append.py" world 'letter .txt'
49 $ "$TESTDIR/svn-safe-append.py" world 'letter .txt'
57 $ svn ci -m world
50 $ svn ci -m world
58 Sending letter .txt
51 Sending letter .txt
59 Transmitting file data .
52 Transmitting file data .
60 Committed revision 3.
53 Committed revision 3.
61
54
62 $ svn copy -m "tag v0.1" "$svnurl"/mytrunk "$svnurl"/tags/v0.1
55 $ svn copy -m "tag v0.1" "$SVNREPOURL/proj%20B/mytrunk" "$SVNREPOURL/proj%20B/tags/v0.1"
63
56
64 Committed revision 4.
57 Committed revision 4.
65
58
66 $ "$TESTDIR/svn-safe-append.py" 'nice day today!' 'letter .txt'
59 $ "$TESTDIR/svn-safe-append.py" 'nice day today!' 'letter .txt'
67 $ svn ci -m "nice day"
60 $ svn ci -m "nice day"
68 Sending letter .txt
61 Sending letter .txt
69 Transmitting file data .
62 Transmitting file data .
70 Committed revision 5.
63 Committed revision 5.
71 $ cd ..
64 $ cd ..
72
65
73 Convert to hg once
66 Convert to hg once
74
67
75 $ hg convert "$svnurl" B-hg
68 $ hg convert "$SVNREPOURL/proj%20B" B-hg
76 initializing destination B-hg repository
69 initializing destination B-hg repository
77 scanning source...
70 scanning source...
78 sorting...
71 sorting...
79 converting...
72 converting...
80 3 init projB
73 3 init projB
81 2 hello
74 2 hello
82 1 world
75 1 world
83 0 nice day
76 0 nice day
84 updating tags
77 updating tags
85
78
86 Update svn repository again
79 Update svn repository again
87
80
88 $ cd B
81 $ cd B
89 $ "$TESTDIR/svn-safe-append.py" "see second letter" 'letter .txt'
82 $ "$TESTDIR/svn-safe-append.py" "see second letter" 'letter .txt'
90 $ echo "nice to meet you" > letter2.txt
83 $ echo "nice to meet you" > letter2.txt
91 $ svn add letter2.txt
84 $ svn add letter2.txt
92 A letter2.txt
85 A letter2.txt
93 $ svn ci -m "second letter"
86 $ svn ci -m "second letter"
94 Sending letter .txt
87 Sending letter .txt
95 Adding letter2.txt
88 Adding letter2.txt
96 Transmitting file data ..
89 Transmitting file data ..
97 Committed revision 6.
90 Committed revision 6.
98
91
99 $ svn copy -m "tag v0.2" "$svnurl"/mytrunk "$svnurl"/tags/v0.2
92 $ svn copy -m "tag v0.2" "$SVNREPOURL/proj%20B/mytrunk" "$SVNREPOURL/proj%20B/tags/v0.2"
100
93
101 Committed revision 7.
94 Committed revision 7.
102
95
103 $ "$TESTDIR/svn-safe-append.py" "blah-blah-blah" letter2.txt
96 $ "$TESTDIR/svn-safe-append.py" "blah-blah-blah" letter2.txt
104 $ svn ci -m "work in progress"
97 $ svn ci -m "work in progress"
105 Sending letter2.txt
98 Sending letter2.txt
106 Transmitting file data .
99 Transmitting file data .
107 Committed revision 8.
100 Committed revision 8.
108 $ cd ..
101 $ cd ..
109
102
110 $ hg convert -s svn "$svnurl/non-existent-path" dest
103 $ hg convert -s svn "$SVNREPOURL/proj%20B/non-existent-path" dest
111 initializing destination dest repository
104 initializing destination dest repository
112 abort: no revision found in module /proj B/non-existent-path
105 abort: no revision found in module /proj B/non-existent-path
113 [255]
106 [255]
114
107
115 ########################################
108 ########################################
116
109
117 Test incremental conversion
110 Test incremental conversion
118
111
119 $ hg convert "$svnurl" B-hg
112 $ hg convert "$SVNREPOURL/proj%20B" B-hg
120 scanning source...
113 scanning source...
121 sorting...
114 sorting...
122 converting...
115 converting...
123 1 second letter
116 1 second letter
124 0 work in progress
117 0 work in progress
125 updating tags
118 updating tags
126
119
127 $ cd B-hg
120 $ cd B-hg
128 $ hg glog --template '{rev} {desc|firstline} files: {files}\n'
121 $ hg glog --template '{rev} {desc|firstline} files: {files}\n'
129 o 7 update tags files: .hgtags
122 o 7 update tags files: .hgtags
130 |
123 |
131 o 6 work in progress files: letter2.txt
124 o 6 work in progress files: letter2.txt
132 |
125 |
133 o 5 second letter files: letter .txt letter2.txt
126 o 5 second letter files: letter .txt letter2.txt
134 |
127 |
135 o 4 update tags files: .hgtags
128 o 4 update tags files: .hgtags
136 |
129 |
137 o 3 nice day files: letter .txt
130 o 3 nice day files: letter .txt
138 |
131 |
139 o 2 world files: letter .txt
132 o 2 world files: letter .txt
140 |
133 |
141 o 1 hello files: letter .txt
134 o 1 hello files: letter .txt
142 |
135 |
143 o 0 init projB files:
136 o 0 init projB files:
144
137
145 $ hg tags -q
138 $ hg tags -q
146 tip
139 tip
147 v0.2
140 v0.2
148 v0.1
141 v0.1
149 $ cd ..
142 $ cd ..
150
143
151 Test filemap
144 Test filemap
152 $ echo 'include letter2.txt' > filemap
145 $ echo 'include letter2.txt' > filemap
153 $ hg convert --filemap filemap "$svnurl"/mytrunk fmap
146 $ hg convert --filemap filemap "$SVNREPOURL/proj%20B/mytrunk" fmap
154 initializing destination fmap repository
147 initializing destination fmap repository
155 scanning source...
148 scanning source...
156 sorting...
149 sorting...
157 converting...
150 converting...
158 5 init projB
151 5 init projB
159 4 hello
152 4 hello
160 3 world
153 3 world
161 2 nice day
154 2 nice day
162 1 second letter
155 1 second letter
163 0 work in progress
156 0 work in progress
164 $ hg -R fmap branch -q
157 $ hg -R fmap branch -q
165 default
158 default
166 $ hg glog -R fmap --template '{rev} {desc|firstline} files: {files}\n'
159 $ hg glog -R fmap --template '{rev} {desc|firstline} files: {files}\n'
167 o 1 work in progress files: letter2.txt
160 o 1 work in progress files: letter2.txt
168 |
161 |
169 o 0 second letter files: letter2.txt
162 o 0 second letter files: letter2.txt
170
163
171
164
172 Test stop revision
165 Test stop revision
173 $ hg convert --rev 1 "$svnurl"/mytrunk stoprev
166 $ hg convert --rev 1 "$SVNREPOURL/proj%20B/mytrunk" stoprev
174 initializing destination stoprev repository
167 initializing destination stoprev repository
175 scanning source...
168 scanning source...
176 sorting...
169 sorting...
177 converting...
170 converting...
178 0 init projB
171 0 init projB
179 $ hg -R stoprev branch -q
172 $ hg -R stoprev branch -q
180 default
173 default
181
174
182 Check convert_revision extra-records.
175 Check convert_revision extra-records.
183 This is also the only place testing more than one extra field in a revision.
176 This is also the only place testing more than one extra field in a revision.
184
177
185 $ cd stoprev
178 $ cd stoprev
186 $ hg tip --debug | grep extra
179 $ hg tip --debug | grep extra
187 extra: branch=default
180 extra: branch=default
188 extra: convert_revision=svn:........-....-....-....-............/proj B/mytrunk@1 (re)
181 extra: convert_revision=svn:........-....-....-....-............/proj B/mytrunk@1 (re)
189 $ cd ..
182 $ cd ..
190
183
191 Test converting empty heads (issue3347)
184 Test converting empty heads (issue3347)
192
185
193 $ svnadmin create svn-empty
186 $ svnadmin create svn-empty
194 $ svnadmin load -q svn-empty < "$TESTDIR/svn/empty.svndump"
187 $ svnadmin load -q svn-empty < "$TESTDIR/svn/empty.svndump"
195 $ hg --config convert.svn.trunk= convert svn-empty
188 $ hg --config convert.svn.trunk= convert svn-empty
196 assuming destination svn-empty-hg
189 assuming destination svn-empty-hg
197 initializing destination svn-empty-hg repository
190 initializing destination svn-empty-hg repository
198 scanning source...
191 scanning source...
199 sorting...
192 sorting...
200 converting...
193 converting...
201 1 init projA
194 1 init projA
202 0 adddir
195 0 adddir
203 $ hg --config convert.svn.trunk= convert file://$svnpath/svn-empty/trunk
196 $ hg --config convert.svn.trunk= convert "$SVNREPOURL/../svn-empty/trunk"
204 assuming destination trunk-hg
197 assuming destination trunk-hg
205 initializing destination trunk-hg repository
198 initializing destination trunk-hg repository
206 scanning source...
199 scanning source...
207 sorting...
200 sorting...
208 converting...
201 converting...
209 1 init projA
202 1 init projA
210 0 adddir
203 0 adddir
@@ -1,52 +1,54 b''
1 $ "$TESTDIR/hghave" svn13 || exit 80
1 $ "$TESTDIR/hghave" svn13 || exit 80
2
2
3 $ echo "[extensions]" >> $HGRCPATH
3 $ echo "[extensions]" >> $HGRCPATH
4 $ echo "mq=" >> $HGRCPATH
4 $ echo "mq=" >> $HGRCPATH
5 $ echo "[diff]" >> $HGRCPATH
5 $ echo "[diff]" >> $HGRCPATH
6 $ echo "nodates=1" >> $HGRCPATH
6 $ echo "nodates=1" >> $HGRCPATH
7
7
8 fn to create new repository, and cd into it
8 fn to create new repository, and cd into it
9 $ mkrepo() {
9 $ mkrepo() {
10 > hg init $1
10 > hg init $1
11 > cd $1
11 > cd $1
12 > hg qinit
12 > hg qinit
13 > }
13 > }
14
14
15
15
16 handle svn subrepos safely
16 handle svn subrepos safely
17
17
18 $ svnadmin create svn-repo-2499
18 $ svnadmin create svn-repo-2499
19 $ curpath=`pwd | tr '\\\\' /`
19
20 $ expr "$svnpath" : "\/" > /dev/null
20 $ SVNREPOPATH=`pwd`/svn-repo-2499/project
21 > if [ $? -ne 0 ]; then
21 #if windows
22 > curpath="/$curpath"
22 $ SVNREPOURL=file:///`python -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
23 > fi
23 #else
24 $ svnurl="file://$curpath/svn-repo-2499/project"
24 $ SVNREPOURL=file://`python -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
25 #endif
26
25 $ mkdir -p svn-project-2499/trunk
27 $ mkdir -p svn-project-2499/trunk
26 $ svn import -m 'init project' svn-project-2499 "$svnurl"
28 $ svn import -m 'init project' svn-project-2499 "$SVNREPOURL"
27 Adding svn-project-2499/trunk (glob)
29 Adding svn-project-2499/trunk (glob)
28
30
29 Committed revision 1.
31 Committed revision 1.
30
32
31 qnew on repo w/svn subrepo
33 qnew on repo w/svn subrepo
32 $ mkrepo repo-2499-svn-subrepo
34 $ mkrepo repo-2499-svn-subrepo
33 $ svn co "$svnurl"/trunk sub
35 $ svn co "$SVNREPOURL"/trunk sub
34 Checked out revision 1.
36 Checked out revision 1.
35 $ echo 'sub = [svn]sub' >> .hgsub
37 $ echo 'sub = [svn]sub' >> .hgsub
36 $ hg add .hgsub
38 $ hg add .hgsub
37 $ hg status -S -X '**/format'
39 $ hg status -S -X '**/format'
38 A .hgsub
40 A .hgsub
39 $ hg qnew -m0 0.diff
41 $ hg qnew -m0 0.diff
40 $ cd sub
42 $ cd sub
41 $ echo a > a
43 $ echo a > a
42 $ svn add a
44 $ svn add a
43 A a
45 A a
44 $ svn st
46 $ svn st
45 A* a (glob)
47 A* a (glob)
46 $ cd ..
48 $ cd ..
47 $ hg status -S # doesn't show status for svn subrepos (yet)
49 $ hg status -S # doesn't show status for svn subrepos (yet)
48 $ hg qnew -m1 1.diff
50 $ hg qnew -m1 1.diff
49 abort: uncommitted changes in subrepository sub
51 abort: uncommitted changes in subrepository sub
50 [255]
52 [255]
51
53
52 $ cd ..
54 $ cd ..
@@ -1,609 +1,603 b''
1 $ "$TESTDIR/hghave" svn15 || exit 80
1 $ "$TESTDIR/hghave" svn15 || exit 80
2
2
3 $ fix_path()
3 $ SVNREPOPATH=`pwd`/svn-repo
4 > {
4 #if windows
5 > tr '\\' /
5 $ SVNREPOURL=file:///`python -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
6 > }
6 #else
7
7 $ SVNREPOURL=file://`python -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
8 SVN wants all paths to start with a slash. Unfortunately, Windows ones
8 #endif
9 don't. Handle that.
10
11 $ escapedwd=`pwd | fix_path`
12 $ expr "$escapedwd" : '\/' > /dev/null || escapedwd="/$escapedwd"
13 $ escapedwd=`python -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$escapedwd"`
14
9
15 create subversion repo
10 create subversion repo
16
11
17 $ SVNREPO="file://$escapedwd/svn-repo"
18 $ WCROOT="`pwd`/svn-wc"
12 $ WCROOT="`pwd`/svn-wc"
19 $ svnadmin create svn-repo
13 $ svnadmin create svn-repo
20 $ svn co "$SVNREPO" svn-wc
14 $ svn co "$SVNREPOURL" svn-wc
21 Checked out revision 0.
15 Checked out revision 0.
22 $ cd svn-wc
16 $ cd svn-wc
23 $ mkdir src
17 $ mkdir src
24 $ echo alpha > src/alpha
18 $ echo alpha > src/alpha
25 $ svn add src
19 $ svn add src
26 A src
20 A src
27 A src/alpha (glob)
21 A src/alpha (glob)
28 $ mkdir externals
22 $ mkdir externals
29 $ echo other > externals/other
23 $ echo other > externals/other
30 $ svn add externals
24 $ svn add externals
31 A externals
25 A externals
32 A externals/other (glob)
26 A externals/other (glob)
33 $ svn ci -m 'Add alpha'
27 $ svn ci -m 'Add alpha'
34 Adding externals
28 Adding externals
35 Adding externals/other (glob)
29 Adding externals/other (glob)
36 Adding src
30 Adding src
37 Adding src/alpha (glob)
31 Adding src/alpha (glob)
38 Transmitting file data ..
32 Transmitting file data ..
39 Committed revision 1.
33 Committed revision 1.
40 $ svn up -q
34 $ svn up -q
41 $ echo "externals -r1 $SVNREPO/externals" > extdef
35 $ echo "externals -r1 $SVNREPOURL/externals" > extdef
42 $ svn propset -F extdef svn:externals src
36 $ svn propset -F extdef svn:externals src
43 property 'svn:externals' set on 'src'
37 property 'svn:externals' set on 'src'
44 $ svn ci -m 'Setting externals'
38 $ svn ci -m 'Setting externals'
45 Sending src
39 Sending src
46
40
47 Committed revision 2.
41 Committed revision 2.
48 $ cd ..
42 $ cd ..
49
43
50 create hg repo
44 create hg repo
51
45
52 $ mkdir sub
46 $ mkdir sub
53 $ cd sub
47 $ cd sub
54 $ hg init t
48 $ hg init t
55 $ cd t
49 $ cd t
56
50
57 first revision, no sub
51 first revision, no sub
58
52
59 $ echo a > a
53 $ echo a > a
60 $ hg ci -Am0
54 $ hg ci -Am0
61 adding a
55 adding a
62
56
63 add first svn sub with leading whitespaces
57 add first svn sub with leading whitespaces
64
58
65 $ echo "s = [svn] $SVNREPO/src" >> .hgsub
59 $ echo "s = [svn] $SVNREPOURL/src" >> .hgsub
66 $ echo "subdir/s = [svn] $SVNREPO/src" >> .hgsub
60 $ echo "subdir/s = [svn] $SVNREPOURL/src" >> .hgsub
67 $ svn co --quiet "$SVNREPO"/src s
61 $ svn co --quiet "$SVNREPOURL"/src s
68 $ mkdir subdir
62 $ mkdir subdir
69 $ svn co --quiet "$SVNREPO"/src subdir/s
63 $ svn co --quiet "$SVNREPOURL"/src subdir/s
70 $ hg add .hgsub
64 $ hg add .hgsub
71 $ hg ci -m1
65 $ hg ci -m1
72
66
73 make sure we avoid empty commits (issue2445)
67 make sure we avoid empty commits (issue2445)
74
68
75 $ hg sum
69 $ hg sum
76 parent: 1:* tip (glob)
70 parent: 1:* tip (glob)
77 1
71 1
78 branch: default
72 branch: default
79 commit: (clean)
73 commit: (clean)
80 update: (current)
74 update: (current)
81 $ hg ci -moops
75 $ hg ci -moops
82 nothing changed
76 nothing changed
83 [1]
77 [1]
84
78
85 debugsub
79 debugsub
86
80
87 $ hg debugsub
81 $ hg debugsub
88 path s
82 path s
89 source file://*/svn-repo/src (glob)
83 source file://*/svn-repo/src (glob)
90 revision 2
84 revision 2
91 path subdir/s
85 path subdir/s
92 source file://*/svn-repo/src (glob)
86 source file://*/svn-repo/src (glob)
93 revision 2
87 revision 2
94
88
95 change file in svn and hg, commit
89 change file in svn and hg, commit
96
90
97 $ echo a >> a
91 $ echo a >> a
98 $ echo alpha >> s/alpha
92 $ echo alpha >> s/alpha
99 $ hg sum
93 $ hg sum
100 parent: 1:* tip (glob)
94 parent: 1:* tip (glob)
101 1
95 1
102 branch: default
96 branch: default
103 commit: 1 modified, 1 subrepos
97 commit: 1 modified, 1 subrepos
104 update: (current)
98 update: (current)
105 $ hg commit --subrepos -m 'Message!' | grep -v Updating
99 $ hg commit --subrepos -m 'Message!' | grep -v Updating
106 committing subrepository s
100 committing subrepository s
107 Sending*s/alpha (glob)
101 Sending*s/alpha (glob)
108 Transmitting file data .
102 Transmitting file data .
109 Committed revision 3.
103 Committed revision 3.
110
104
111 Fetching external item into '*s/externals'* (glob)
105 Fetching external item into '*s/externals'* (glob)
112 External at revision 1.
106 External at revision 1.
113
107
114 At revision 3.
108 At revision 3.
115 $ hg debugsub
109 $ hg debugsub
116 path s
110 path s
117 source file://*/svn-repo/src (glob)
111 source file://*/svn-repo/src (glob)
118 revision 3
112 revision 3
119 path subdir/s
113 path subdir/s
120 source file://*/svn-repo/src (glob)
114 source file://*/svn-repo/src (glob)
121 revision 2
115 revision 2
122
116
123 missing svn file, commit should fail
117 missing svn file, commit should fail
124
118
125 $ rm s/alpha
119 $ rm s/alpha
126 $ hg commit --subrepos -m 'abort on missing file'
120 $ hg commit --subrepos -m 'abort on missing file'
127 committing subrepository s
121 committing subrepository s
128 abort: cannot commit missing svn entries
122 abort: cannot commit missing svn entries
129 [255]
123 [255]
130 $ svn revert s/alpha > /dev/null
124 $ svn revert s/alpha > /dev/null
131
125
132 add an unrelated revision in svn and update the subrepo to without
126 add an unrelated revision in svn and update the subrepo to without
133 bringing any changes.
127 bringing any changes.
134
128
135 $ svn mkdir "$SVNREPO/unrelated" -m 'create unrelated'
129 $ svn mkdir "$SVNREPOURL/unrelated" -m 'create unrelated'
136
130
137 Committed revision 4.
131 Committed revision 4.
138 $ svn up -q s
132 $ svn up -q s
139 $ hg sum
133 $ hg sum
140 parent: 2:* tip (glob)
134 parent: 2:* tip (glob)
141 Message!
135 Message!
142 branch: default
136 branch: default
143 commit: (clean)
137 commit: (clean)
144 update: (current)
138 update: (current)
145
139
146 $ echo a > s/a
140 $ echo a > s/a
147
141
148 should be empty despite change to s/a
142 should be empty despite change to s/a
149
143
150 $ hg st
144 $ hg st
151
145
152 add a commit from svn
146 add a commit from svn
153
147
154 $ cd "$WCROOT"/src
148 $ cd "$WCROOT/src"
155 $ svn up -q
149 $ svn up -q
156 $ echo xyz >> alpha
150 $ echo xyz >> alpha
157 $ svn propset svn:mime-type 'text/xml' alpha
151 $ svn propset svn:mime-type 'text/xml' alpha
158 property 'svn:mime-type' set on 'alpha'
152 property 'svn:mime-type' set on 'alpha'
159 $ svn ci -m 'amend a from svn'
153 $ svn ci -m 'amend a from svn'
160 Sending *alpha (glob)
154 Sending *alpha (glob)
161 Transmitting file data .
155 Transmitting file data .
162 Committed revision 5.
156 Committed revision 5.
163 $ cd ../../sub/t
157 $ cd ../../sub/t
164
158
165 this commit from hg will fail
159 this commit from hg will fail
166
160
167 $ echo zzz >> s/alpha
161 $ echo zzz >> s/alpha
168 $ (hg ci --subrepos -m 'amend alpha from hg' 2>&1; echo "[$?]") | grep -vi 'out of date'
162 $ (hg ci --subrepos -m 'amend alpha from hg' 2>&1; echo "[$?]") | grep -vi 'out of date'
169 committing subrepository s
163 committing subrepository s
170 abort: svn:*Commit failed (details follow): (glob)
164 abort: svn:*Commit failed (details follow): (glob)
171 [255]
165 [255]
172 $ svn revert -q s/alpha
166 $ svn revert -q s/alpha
173
167
174 this commit fails because of meta changes
168 this commit fails because of meta changes
175
169
176 $ svn propset svn:mime-type 'text/html' s/alpha
170 $ svn propset svn:mime-type 'text/html' s/alpha
177 property 'svn:mime-type' set on 's/alpha' (glob)
171 property 'svn:mime-type' set on 's/alpha' (glob)
178 $ (hg ci --subrepos -m 'amend alpha from hg' 2>&1; echo "[$?]") | grep -vi 'out of date'
172 $ (hg ci --subrepos -m 'amend alpha from hg' 2>&1; echo "[$?]") | grep -vi 'out of date'
179 committing subrepository s
173 committing subrepository s
180 abort: svn:*Commit failed (details follow): (glob)
174 abort: svn:*Commit failed (details follow): (glob)
181 [255]
175 [255]
182 $ svn revert -q s/alpha
176 $ svn revert -q s/alpha
183
177
184 this commit fails because of externals changes
178 this commit fails because of externals changes
185
179
186 $ echo zzz > s/externals/other
180 $ echo zzz > s/externals/other
187 $ hg ci --subrepos -m 'amend externals from hg'
181 $ hg ci --subrepos -m 'amend externals from hg'
188 committing subrepository s
182 committing subrepository s
189 abort: cannot commit svn externals
183 abort: cannot commit svn externals
190 [255]
184 [255]
191 $ hg diff --subrepos -r 1:2 | grep -v diff
185 $ hg diff --subrepos -r 1:2 | grep -v diff
192 --- a/.hgsubstate Thu Jan 01 00:00:00 1970 +0000
186 --- a/.hgsubstate Thu Jan 01 00:00:00 1970 +0000
193 +++ b/.hgsubstate Thu Jan 01 00:00:00 1970 +0000
187 +++ b/.hgsubstate Thu Jan 01 00:00:00 1970 +0000
194 @@ -1,2 +1,2 @@
188 @@ -1,2 +1,2 @@
195 -2 s
189 -2 s
196 +3 s
190 +3 s
197 2 subdir/s
191 2 subdir/s
198 --- a/a Thu Jan 01 00:00:00 1970 +0000
192 --- a/a Thu Jan 01 00:00:00 1970 +0000
199 +++ b/a Thu Jan 01 00:00:00 1970 +0000
193 +++ b/a Thu Jan 01 00:00:00 1970 +0000
200 @@ -1,1 +1,2 @@
194 @@ -1,1 +1,2 @@
201 a
195 a
202 +a
196 +a
203 $ svn revert -q s/externals/other
197 $ svn revert -q s/externals/other
204
198
205 this commit fails because of externals meta changes
199 this commit fails because of externals meta changes
206
200
207 $ svn propset svn:mime-type 'text/html' s/externals/other
201 $ svn propset svn:mime-type 'text/html' s/externals/other
208 property 'svn:mime-type' set on 's/externals/other' (glob)
202 property 'svn:mime-type' set on 's/externals/other' (glob)
209 $ hg ci --subrepos -m 'amend externals from hg'
203 $ hg ci --subrepos -m 'amend externals from hg'
210 committing subrepository s
204 committing subrepository s
211 abort: cannot commit svn externals
205 abort: cannot commit svn externals
212 [255]
206 [255]
213 $ svn revert -q s/externals/other
207 $ svn revert -q s/externals/other
214
208
215 clone
209 clone
216
210
217 $ cd ..
211 $ cd ..
218 $ hg clone t tc | fix_path
212 $ hg clone t tc
219 updating to branch default
213 updating to branch default
220 A tc/s/alpha
214 A tc/s/alpha (glob)
221 U tc/s
215 U tc/s (glob)
222
216
223 Fetching external item into 'tc/s/externals'* (glob)
217 Fetching external item into 'tc/s/externals'* (glob)
224 A tc/s/externals/other
218 A tc/s/externals/other (glob)
225 Checked out external at revision 1.
219 Checked out external at revision 1.
226
220
227 Checked out revision 3.
221 Checked out revision 3.
228 A tc/subdir/s/alpha
222 A tc/subdir/s/alpha (glob)
229 U tc/subdir/s
223 U tc/subdir/s (glob)
230
224
231 Fetching external item into 'tc/subdir/s/externals'* (glob)
225 Fetching external item into 'tc/subdir/s/externals'* (glob)
232 A tc/subdir/s/externals/other
226 A tc/subdir/s/externals/other (glob)
233 Checked out external at revision 1.
227 Checked out external at revision 1.
234
228
235 Checked out revision 2.
229 Checked out revision 2.
236 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
230 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
237 $ cd tc
231 $ cd tc
238
232
239 debugsub in clone
233 debugsub in clone
240
234
241 $ hg debugsub
235 $ hg debugsub
242 path s
236 path s
243 source file://*/svn-repo/src (glob)
237 source file://*/svn-repo/src (glob)
244 revision 3
238 revision 3
245 path subdir/s
239 path subdir/s
246 source file://*/svn-repo/src (glob)
240 source file://*/svn-repo/src (glob)
247 revision 2
241 revision 2
248
242
249 verify subrepo is contained within the repo directory
243 verify subrepo is contained within the repo directory
250
244
251 $ python -c "import os.path; print os.path.exists('s')"
245 $ python -c "import os.path; print os.path.exists('s')"
252 True
246 True
253
247
254 update to nullrev (must delete the subrepo)
248 update to nullrev (must delete the subrepo)
255
249
256 $ hg up null
250 $ hg up null
257 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
251 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
258 $ ls
252 $ ls
259
253
260 Check hg update --clean
254 Check hg update --clean
261 $ cd $TESTTMP/sub/t
255 $ cd "$TESTTMP/sub/t"
262 $ cd s
256 $ cd s
263 $ echo c0 > alpha
257 $ echo c0 > alpha
264 $ echo c1 > f1
258 $ echo c1 > f1
265 $ echo c1 > f2
259 $ echo c1 > f2
266 $ svn add f1 -q
260 $ svn add f1 -q
267 $ svn status | sort
261 $ svn status | sort
268
262
269 ? * a (glob)
263 ? * a (glob)
270 ? * f2 (glob)
264 ? * f2 (glob)
271 A * f1 (glob)
265 A * f1 (glob)
272 M * alpha (glob)
266 M * alpha (glob)
273 Performing status on external item at 'externals'* (glob)
267 Performing status on external item at 'externals'* (glob)
274 X * externals (glob)
268 X * externals (glob)
275 $ cd ../..
269 $ cd ../..
276 $ hg -R t update -C
270 $ hg -R t update -C
277
271
278 Fetching external item into 't/s/externals'* (glob)
272 Fetching external item into 't/s/externals'* (glob)
279 Checked out external at revision 1.
273 Checked out external at revision 1.
280
274
281 Checked out revision 3.
275 Checked out revision 3.
282 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
276 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
283 $ cd t/s
277 $ cd t/s
284 $ svn status | sort
278 $ svn status | sort
285
279
286 ? * a (glob)
280 ? * a (glob)
287 ? * f1 (glob)
281 ? * f1 (glob)
288 ? * f2 (glob)
282 ? * f2 (glob)
289 Performing status on external item at 'externals'* (glob)
283 Performing status on external item at 'externals'* (glob)
290 X * externals (glob)
284 X * externals (glob)
291
285
292 Sticky subrepositories, no changes
286 Sticky subrepositories, no changes
293 $ cd $TESTTMP/sub/t
287 $ cd "$TESTTMP/sub/t"
294 $ hg id -n
288 $ hg id -n
295 2
289 2
296 $ cd s
290 $ cd s
297 $ svnversion
291 $ svnversion
298 3
292 3
299 $ cd ..
293 $ cd ..
300 $ hg update 1
294 $ hg update 1
301 U *s/alpha (glob)
295 U *s/alpha (glob)
302
296
303 Fetching external item into '*s/externals'* (glob)
297 Fetching external item into '*s/externals'* (glob)
304 Checked out external at revision 1.
298 Checked out external at revision 1.
305
299
306 Checked out revision 2.
300 Checked out revision 2.
307 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
301 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
308 $ hg id -n
302 $ hg id -n
309 1
303 1
310 $ cd s
304 $ cd s
311 $ svnversion
305 $ svnversion
312 2
306 2
313 $ cd ..
307 $ cd ..
314
308
315 Sticky subrepositorys, file changes
309 Sticky subrepositorys, file changes
316 $ touch s/f1
310 $ touch s/f1
317 $ cd s
311 $ cd s
318 $ svn add f1
312 $ svn add f1
319 A f1
313 A f1
320 $ cd ..
314 $ cd ..
321 $ hg id -n
315 $ hg id -n
322 1
316 1
323 $ cd s
317 $ cd s
324 $ svnversion
318 $ svnversion
325 2M
319 2M
326 $ cd ..
320 $ cd ..
327 $ hg update tip
321 $ hg update tip
328 subrepository sources for s differ
322 subrepository sources for s differ
329 use (l)ocal source (2) or (r)emote source (3)?
323 use (l)ocal source (2) or (r)emote source (3)?
330 l
324 l
331 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
325 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
332 $ hg id -n
326 $ hg id -n
333 2+
327 2+
334 $ cd s
328 $ cd s
335 $ svnversion
329 $ svnversion
336 2M
330 2M
337 $ cd ..
331 $ cd ..
338 $ hg update --clean tip
332 $ hg update --clean tip
339 U *s/alpha (glob)
333 U *s/alpha (glob)
340
334
341 Fetching external item into '*s/externals'* (glob)
335 Fetching external item into '*s/externals'* (glob)
342 Checked out external at revision 1.
336 Checked out external at revision 1.
343
337
344 Checked out revision 3.
338 Checked out revision 3.
345 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
339 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
346
340
347 Sticky subrepository, revision updates
341 Sticky subrepository, revision updates
348 $ hg id -n
342 $ hg id -n
349 2
343 2
350 $ cd s
344 $ cd s
351 $ svnversion
345 $ svnversion
352 3
346 3
353 $ cd ..
347 $ cd ..
354 $ cd s
348 $ cd s
355 $ svn update -qr 1
349 $ svn update -qr 1
356 $ cd ..
350 $ cd ..
357 $ hg update 1
351 $ hg update 1
358 subrepository sources for s differ (in checked out version)
352 subrepository sources for s differ (in checked out version)
359 use (l)ocal source (1) or (r)emote source (2)?
353 use (l)ocal source (1) or (r)emote source (2)?
360 l
354 l
361 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
355 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
362 $ hg id -n
356 $ hg id -n
363 1+
357 1+
364 $ cd s
358 $ cd s
365 $ svnversion
359 $ svnversion
366 1
360 1
367 $ cd ..
361 $ cd ..
368
362
369 Sticky subrepository, file changes and revision updates
363 Sticky subrepository, file changes and revision updates
370 $ touch s/f1
364 $ touch s/f1
371 $ cd s
365 $ cd s
372 $ svn add f1
366 $ svn add f1
373 A f1
367 A f1
374 $ svnversion
368 $ svnversion
375 1M
369 1M
376 $ cd ..
370 $ cd ..
377 $ hg id -n
371 $ hg id -n
378 1+
372 1+
379 $ hg update tip
373 $ hg update tip
380 subrepository sources for s differ
374 subrepository sources for s differ
381 use (l)ocal source (1) or (r)emote source (3)?
375 use (l)ocal source (1) or (r)emote source (3)?
382 l
376 l
383 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
377 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
384 $ hg id -n
378 $ hg id -n
385 2
379 2
386 $ cd s
380 $ cd s
387 $ svnversion
381 $ svnversion
388 1M
382 1M
389 $ cd ..
383 $ cd ..
390
384
391 Sticky repository, update --clean
385 Sticky repository, update --clean
392 $ hg update --clean tip | grep -v 's[/\]externals[/\]other'
386 $ hg update --clean tip | grep -v 's[/\]externals[/\]other'
393 U *s/alpha (glob)
387 U *s/alpha (glob)
394 U *s (glob)
388 U *s (glob)
395
389
396 Fetching external item into '*s/externals'* (glob)
390 Fetching external item into '*s/externals'* (glob)
397 Checked out external at revision 1.
391 Checked out external at revision 1.
398
392
399 Checked out revision 3.
393 Checked out revision 3.
400 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
394 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
401 $ hg id -n
395 $ hg id -n
402 2
396 2
403 $ cd s
397 $ cd s
404 $ svnversion
398 $ svnversion
405 3
399 3
406 $ cd ..
400 $ cd ..
407
401
408 Test subrepo already at intended revision:
402 Test subrepo already at intended revision:
409 $ cd s
403 $ cd s
410 $ svn update -qr 2
404 $ svn update -qr 2
411 $ cd ..
405 $ cd ..
412 $ hg update 1
406 $ hg update 1
413 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
407 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
414 $ hg id -n
408 $ hg id -n
415 1+
409 1+
416 $ cd s
410 $ cd s
417 $ svnversion
411 $ svnversion
418 2
412 2
419 $ cd ..
413 $ cd ..
420
414
421 Test case where subversion would fail to update the subrepo because there
415 Test case where subversion would fail to update the subrepo because there
422 are unknown directories being replaced by tracked ones (happens with rebase).
416 are unknown directories being replaced by tracked ones (happens with rebase).
423
417
424 $ cd $WCROOT/src
418 $ cd "$WCROOT/src"
425 $ mkdir dir
419 $ mkdir dir
426 $ echo epsilon.py > dir/epsilon.py
420 $ echo epsilon.py > dir/epsilon.py
427 $ svn add dir
421 $ svn add dir
428 A dir
422 A dir
429 A dir/epsilon.py (glob)
423 A dir/epsilon.py (glob)
430 $ svn ci -m 'Add dir/epsilon.py'
424 $ svn ci -m 'Add dir/epsilon.py'
431 Adding *dir (glob)
425 Adding *dir (glob)
432 Adding *dir/epsilon.py (glob)
426 Adding *dir/epsilon.py (glob)
433 Transmitting file data .
427 Transmitting file data .
434 Committed revision 6.
428 Committed revision 6.
435 $ cd ../..
429 $ cd ../..
436 $ hg init rebaserepo
430 $ hg init rebaserepo
437 $ cd rebaserepo
431 $ cd rebaserepo
438 $ svn co -r5 --quiet "$SVNREPO"/src s
432 $ svn co -r5 --quiet "$SVNREPOURL"/src s
439 $ echo "s = [svn] $SVNREPO/src" >> .hgsub
433 $ echo "s = [svn] $SVNREPOURL/src" >> .hgsub
440 $ hg add .hgsub
434 $ hg add .hgsub
441 $ hg ci -m addsub
435 $ hg ci -m addsub
442 $ echo a > a
436 $ echo a > a
443 $ hg ci -Am adda
437 $ hg ci -Am adda
444 adding a
438 adding a
445 $ hg up 0
439 $ hg up 0
446 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
440 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
447 $ svn up -qr6 s
441 $ svn up -qr6 s
448 $ hg ci -m updatesub
442 $ hg ci -m updatesub
449 created new head
443 created new head
450 $ echo pyc > s/dir/epsilon.pyc
444 $ echo pyc > s/dir/epsilon.pyc
451 $ hg up 1
445 $ hg up 1
452 D *s/dir (glob)
446 D *s/dir (glob)
453
447
454 Fetching external item into '*s/externals'* (glob)
448 Fetching external item into '*s/externals'* (glob)
455 Checked out external at revision 1.
449 Checked out external at revision 1.
456
450
457 Checked out revision 5.
451 Checked out revision 5.
458 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
452 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
459 $ hg up -q 2
453 $ hg up -q 2
460
454
461 Modify one of the externals to point to a different path so we can
455 Modify one of the externals to point to a different path so we can
462 test having obstructions when switching branches on checkout:
456 test having obstructions when switching branches on checkout:
463 $ hg checkout tip
457 $ hg checkout tip
464 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
458 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
465 $ echo "obstruct = [svn] $SVNREPO/externals" >> .hgsub
459 $ echo "obstruct = [svn] $SVNREPOURL/externals" >> .hgsub
466 $ svn co -r5 --quiet "$SVNREPO"/externals obstruct
460 $ svn co -r5 --quiet "$SVNREPOURL"/externals obstruct
467 $ hg commit -m 'Start making obstructed working copy'
461 $ hg commit -m 'Start making obstructed working copy'
468 $ hg book other
462 $ hg book other
469 $ hg co -r 'p1(tip)'
463 $ hg co -r 'p1(tip)'
470 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
464 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
471 $ echo "obstruct = [svn] $SVNREPO/src" >> .hgsub
465 $ echo "obstruct = [svn] $SVNREPOURL/src" >> .hgsub
472 $ svn co -r5 --quiet "$SVNREPO"/src obstruct
466 $ svn co -r5 --quiet "$SVNREPOURL"/src obstruct
473 $ hg commit -m 'Other branch which will be obstructed'
467 $ hg commit -m 'Other branch which will be obstructed'
474 created new head
468 created new head
475
469
476 Switching back to the head where we have another path mapped to the
470 Switching back to the head where we have another path mapped to the
477 same subrepo should work if the subrepo is clean.
471 same subrepo should work if the subrepo is clean.
478 $ hg co other
472 $ hg co other
479 A *obstruct/other (glob)
473 A *obstruct/other (glob)
480 Checked out revision 1.
474 Checked out revision 1.
481 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
475 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
482
476
483 This is surprising, but is also correct based on the current code:
477 This is surprising, but is also correct based on the current code:
484 $ echo "updating should (maybe) fail" > obstruct/other
478 $ echo "updating should (maybe) fail" > obstruct/other
485 $ hg co tip
479 $ hg co tip
486 abort: crosses branches (merge branches or use --clean to discard changes)
480 abort: crosses branches (merge branches or use --clean to discard changes)
487 [255]
481 [255]
488
482
489 Point to a Subversion branch which has since been deleted and recreated
483 Point to a Subversion branch which has since been deleted and recreated
490 First, create that condition in the repository.
484 First, create that condition in the repository.
491
485
492 $ hg ci --subrepos -m cleanup | grep -v Updating
486 $ hg ci --subrepos -m cleanup | grep -v Updating
493 committing subrepository obstruct
487 committing subrepository obstruct
494 Sending obstruct/other (glob)
488 Sending obstruct/other (glob)
495 Transmitting file data .
489 Transmitting file data .
496 Committed revision 7.
490 Committed revision 7.
497 At revision 7.
491 At revision 7.
498 $ svn mkdir -m "baseline" $SVNREPO/trunk
492 $ svn mkdir -m "baseline" $SVNREPOURL/trunk
499
493
500 Committed revision 8.
494 Committed revision 8.
501 $ svn copy -m "initial branch" $SVNREPO/trunk $SVNREPO/branch
495 $ svn copy -m "initial branch" $SVNREPOURL/trunk $SVNREPOURL/branch
502
496
503 Committed revision 9.
497 Committed revision 9.
504 $ svn co --quiet "$SVNREPO"/branch tempwc
498 $ svn co --quiet "$SVNREPOURL"/branch tempwc
505 $ cd tempwc
499 $ cd tempwc
506 $ echo "something old" > somethingold
500 $ echo "something old" > somethingold
507 $ svn add somethingold
501 $ svn add somethingold
508 A somethingold
502 A somethingold
509 $ svn ci -m 'Something old'
503 $ svn ci -m 'Something old'
510 Adding somethingold
504 Adding somethingold
511 Transmitting file data .
505 Transmitting file data .
512 Committed revision 10.
506 Committed revision 10.
513 $ svn rm -m "remove branch" $SVNREPO/branch
507 $ svn rm -m "remove branch" $SVNREPOURL/branch
514
508
515 Committed revision 11.
509 Committed revision 11.
516 $ svn copy -m "recreate branch" $SVNREPO/trunk $SVNREPO/branch
510 $ svn copy -m "recreate branch" $SVNREPOURL/trunk $SVNREPOURL/branch
517
511
518 Committed revision 12.
512 Committed revision 12.
519 $ svn up -q
513 $ svn up -q
520 $ echo "something new" > somethingnew
514 $ echo "something new" > somethingnew
521 $ svn add somethingnew
515 $ svn add somethingnew
522 A somethingnew
516 A somethingnew
523 $ svn ci -m 'Something new'
517 $ svn ci -m 'Something new'
524 Adding somethingnew
518 Adding somethingnew
525 Transmitting file data .
519 Transmitting file data .
526 Committed revision 13.
520 Committed revision 13.
527 $ cd ..
521 $ cd ..
528 $ rm -rf tempwc
522 $ rm -rf tempwc
529 $ svn co "$SVNREPO/branch"@10 recreated
523 $ svn co "$SVNREPOURL/branch"@10 recreated
530 A recreated/somethingold (glob)
524 A recreated/somethingold (glob)
531 Checked out revision 10.
525 Checked out revision 10.
532 $ echo "recreated = [svn] $SVNREPO/branch" >> .hgsub
526 $ echo "recreated = [svn] $SVNREPOURL/branch" >> .hgsub
533 $ hg ci -m addsub
527 $ hg ci -m addsub
534 $ cd recreated
528 $ cd recreated
535 $ svn up -q
529 $ svn up -q
536 $ cd ..
530 $ cd ..
537 $ hg ci -m updatesub
531 $ hg ci -m updatesub
538 $ hg up -r-2
532 $ hg up -r-2
539 D *recreated/somethingnew (glob)
533 D *recreated/somethingnew (glob)
540 A *recreated/somethingold (glob)
534 A *recreated/somethingold (glob)
541 Checked out revision 10.
535 Checked out revision 10.
542 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
536 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
543 $ test -f recreated/somethingold
537 $ test -f recreated/somethingold
544
538
545 Test archive
539 Test archive
546
540
547 $ hg archive -S ../archive-all --debug
541 $ hg archive -S ../archive-all --debug
548 archiving: 0/2 files (0.00%)
542 archiving: 0/2 files (0.00%)
549 archiving: .hgsub 1/2 files (50.00%)
543 archiving: .hgsub 1/2 files (50.00%)
550 archiving: .hgsubstate 2/2 files (100.00%)
544 archiving: .hgsubstate 2/2 files (100.00%)
551 archiving (obstruct): 0/1 files (0.00%)
545 archiving (obstruct): 0/1 files (0.00%)
552 archiving (obstruct): 1/1 files (100.00%)
546 archiving (obstruct): 1/1 files (100.00%)
553 archiving (s): 0/2 files (0.00%)
547 archiving (s): 0/2 files (0.00%)
554 archiving (s): 1/2 files (50.00%)
548 archiving (s): 1/2 files (50.00%)
555 archiving (s): 2/2 files (100.00%)
549 archiving (s): 2/2 files (100.00%)
556 archiving (recreated): 0/1 files (0.00%)
550 archiving (recreated): 0/1 files (0.00%)
557 archiving (recreated): 1/1 files (100.00%)
551 archiving (recreated): 1/1 files (100.00%)
558
552
559 Test forgetting files, not implemented in svn subrepo, used to
553 Test forgetting files, not implemented in svn subrepo, used to
560 traceback
554 traceback
561
555
562 #if no-windows
556 #if no-windows
563 $ hg forget 'notafile*'
557 $ hg forget 'notafile*'
564 notafile*: No such file or directory
558 notafile*: No such file or directory
565 [1]
559 [1]
566 #else
560 #else
567 $ hg forget 'notafile'
561 $ hg forget 'notafile'
568 notafile: * (glob)
562 notafile: * (glob)
569 [1]
563 [1]
570 #endif
564 #endif
571
565
572 Test a subrepo referencing a just moved svn path. Last commit rev will
566 Test a subrepo referencing a just moved svn path. Last commit rev will
573 be different from the revision, and the path will be different as
567 be different from the revision, and the path will be different as
574 well.
568 well.
575
569
576 $ cd $WCROOT
570 $ cd "$WCROOT"
577 $ svn up > /dev/null
571 $ svn up > /dev/null
578 $ mkdir trunk/subdir branches
572 $ mkdir trunk/subdir branches
579 $ echo a > trunk/subdir/a
573 $ echo a > trunk/subdir/a
580 $ svn add trunk/subdir branches
574 $ svn add trunk/subdir branches
581 A trunk/subdir (glob)
575 A trunk/subdir (glob)
582 A trunk/subdir/a (glob)
576 A trunk/subdir/a (glob)
583 A branches
577 A branches
584 $ svn ci -m addsubdir
578 $ svn ci -m addsubdir
585 Adding branches
579 Adding branches
586 Adding trunk/subdir (glob)
580 Adding trunk/subdir (glob)
587 Adding trunk/subdir/a (glob)
581 Adding trunk/subdir/a (glob)
588 Transmitting file data .
582 Transmitting file data .
589 Committed revision 14.
583 Committed revision 14.
590 $ svn cp -m branchtrunk $SVNREPO/trunk $SVNREPO/branches/somebranch
584 $ svn cp -m branchtrunk $SVNREPOURL/trunk $SVNREPOURL/branches/somebranch
591
585
592 Committed revision 15.
586 Committed revision 15.
593 $ cd ..
587 $ cd ..
594
588
595 $ hg init repo2
589 $ hg init repo2
596 $ cd repo2
590 $ cd repo2
597 $ svn co $SVNREPO/branches/somebranch/subdir
591 $ svn co $SVNREPOURL/branches/somebranch/subdir
598 A subdir/a (glob)
592 A subdir/a (glob)
599 Checked out revision 15.
593 Checked out revision 15.
600 $ echo "subdir = [svn] $SVNREPO/branches/somebranch/subdir" > .hgsub
594 $ echo "subdir = [svn] $SVNREPOURL/branches/somebranch/subdir" > .hgsub
601 $ hg add .hgsub
595 $ hg add .hgsub
602 $ hg ci -m addsub
596 $ hg ci -m addsub
603 $ hg up null
597 $ hg up null
604 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
598 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
605 $ hg up
599 $ hg up
606 A *subdir/a (glob)
600 A *subdir/a (glob)
607 Checked out revision 15.
601 Checked out revision 15.
608 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
602 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
609 $ cd ..
603 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now