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