##// END OF EJS Templates
convert.svn: branch name which equals trunk means `default' branch (issue2653)...
Pavel Boldin -
r13494:3178aca3 stable
parent child Browse files
Show More
@@ -221,13 +221,13 b' def convert(ui, src, dest=None, revmapfi'
221 221 The following options can be set with ``--config``:
222 222
223 223 :convert.svn.branches: specify the directory containing branches.
224 The defaults is ``branches``.
224 The default is ``branches``.
225 225
226 226 :convert.svn.tags: specify the directory containing tags. The
227 227 default is ``tags``.
228 228
229 :convert.svn.trunk: specify the name of the trunk branch The
230 defauls is ``trunk``.
229 :convert.svn.trunk: specify the name of the trunk branch. The
230 default is ``trunk``.
231 231
232 232 Source history can be retrieved starting at a specific revision,
233 233 instead of being integrally converted. Only single branch
@@ -311,6 +311,9 b' class svn_source(converter_source):'
311 311 return None
312 312 path = (cfgpath or name).strip('/')
313 313 if not self.exists(path, rev):
314 if self.module.endswith(path) and name == 'trunk':
315 # we are converting from inside this directory
316 return None
314 317 if cfgpath:
315 318 raise util.Abort(_('expected %s to be at %r, but not found')
316 319 % (name, path))
@@ -758,7 +761,8 b' class svn_source(converter_source):'
758 761 author = author and self.recode(author) or ''
759 762 try:
760 763 branch = self.module.split("/")[-1]
761 if branch == 'trunk':
764 trunkname = self.ui.config('convert', 'svn.trunk', 'trunk')
765 if branch == trunkname.strip('/'):
762 766 branch = ''
763 767 except IndexError:
764 768 branch = None
@@ -9,6 +9,8 b''
9 9 > [extensions]
10 10 > convert =
11 11 > graphlog =
12 > [convert]
13 > svn.trunk = mytrunk
12 14 > EOF
13 15
14 16 $ svnadmin create svn-repo
@@ -27,20 +29,20 b' Initial svn import'
27 29
28 30 $ mkdir projB
29 31 $ cd projB
30 $ mkdir trunk
32 $ mkdir mytrunk
31 33 $ mkdir tags
32 34 $ cd ..
33 35
34 36 $ svnurl="file://$svnpath/svn-repo/proj%20B"
35 37 $ svn import -m "init projB" projB "$svnurl" | fixpath
36 Adding projB/trunk
38 Adding projB/mytrunk
37 39 Adding projB/tags
38 40
39 41 Committed revision 1.
40 42
41 43 Update svn repository
42 44
43 $ svn co "$svnurl"/trunk B | fixpath
45 $ svn co "$svnurl"/mytrunk B | fixpath
44 46 Checked out revision 1.
45 47 $ cd B
46 48 $ echo hello > 'letter .txt'
@@ -57,7 +59,7 b' Update svn repository'
57 59 Transmitting file data .
58 60 Committed revision 3.
59 61
60 $ svn copy -m "tag v0.1" "$svnurl"/trunk "$svnurl"/tags/v0.1
62 $ svn copy -m "tag v0.1" "$svnurl"/mytrunk "$svnurl"/tags/v0.1
61 63
62 64 Committed revision 4.
63 65
@@ -94,7 +96,7 b' Update svn repository again'
94 96 Transmitting file data ..
95 97 Committed revision 6.
96 98
97 $ svn copy -m "tag v0.2" "$svnurl"/trunk "$svnurl"/tags/v0.2
99 $ svn copy -m "tag v0.2" "$svnurl"/mytrunk "$svnurl"/tags/v0.2
98 100
99 101 Committed revision 7.
100 102
@@ -143,7 +145,7 b' Test incremental conversion'
143 145
144 146 Test filemap
145 147 $ echo 'include letter2.txt' > filemap
146 $ hg convert --filemap filemap "$svnurl"/trunk fmap
148 $ hg convert --filemap filemap "$svnurl"/mytrunk fmap
147 149 initializing destination fmap repository
148 150 scanning source...
149 151 sorting...
@@ -154,6 +156,8 b' Test filemap'
154 156 2 nice day
155 157 1 second letter
156 158 0 work in progress
159 $ hg -R fmap branch -q
160 default
157 161 $ hg glog -R fmap --template '{rev} {desc|firstline} files: {files}\n'
158 162 o 1 work in progress files: letter2.txt
159 163 |
@@ -161,12 +165,14 b' Test filemap'
161 165
162 166
163 167 Test stop revision
164 $ hg convert --rev 1 "$svnurl"/trunk stoprev
168 $ hg convert --rev 1 "$svnurl"/mytrunk stoprev
165 169 initializing destination stoprev repository
166 170 scanning source...
167 171 sorting...
168 172 converting...
169 173 0 init projB
174 $ hg -R stoprev branch -q
175 default
170 176
171 177 Check convert_revision extra-records.
172 178 This is also the only place testing more than one extra field in a revision.
@@ -174,5 +180,5 b' This is also the only place testing more'
174 180 $ cd stoprev
175 181 $ hg tip --debug | grep extra
176 182 extra: branch=default
177 extra: convert_revision=svn:........-....-....-....-............/proj B/trunk@1 (re)
183 extra: convert_revision=svn:........-....-....-....-............/proj B/mytrunk@1 (re)
178 184 $ cd ..
@@ -204,12 +204,12 b''
204 204 The following options can be set with "--config":
205 205
206 206 convert.svn.branches
207 specify the directory containing branches. The defaults is
207 specify the directory containing branches. The default is
208 208 "branches".
209 209 convert.svn.tags
210 210 specify the directory containing tags. The default is "tags".
211 211 convert.svn.trunk
212 specify the name of the trunk branch The defauls is "trunk".
212 specify the name of the trunk branch. The default is "trunk".
213 213
214 214 Source history can be retrieved starting at a specific revision, instead
215 215 of being integrally converted. Only single branch conversions are
General Comments 0
You need to be logged in to leave comments. Login now