# HG changeset patch # User Matt Mackall # Date 1298738422 21600 # Node ID 45b48be6b9105d3bd6f760d98bddcd4708df434b # Parent 3178aca36b0f3fa2da5534a4ebfa81ec793a76c8# Parent 017f509c973c2270dad4c6476802cc5e0a493b5e merge with i18n diff -r 017f509c973c -r 45b48be6b910 hgext/convert/__init__.py --- a/hgext/convert/__init__.py Sat Feb 26 16:39:57 2011 +0100 +++ b/hgext/convert/__init__.py Sat Feb 26 10:40:22 2011 -0600 @@ -221,13 +221,13 @@ The following options can be set with ``--config``: :convert.svn.branches: specify the directory containing branches. - The defaults is ``branches``. + The default is ``branches``. :convert.svn.tags: specify the directory containing tags. The default is ``tags``. - :convert.svn.trunk: specify the name of the trunk branch The - defauls is ``trunk``. + :convert.svn.trunk: specify the name of the trunk branch. The + default is ``trunk``. Source history can be retrieved starting at a specific revision, instead of being integrally converted. Only single branch diff -r 017f509c973c -r 45b48be6b910 hgext/convert/subversion.py --- a/hgext/convert/subversion.py Sat Feb 26 16:39:57 2011 +0100 +++ b/hgext/convert/subversion.py Sat Feb 26 10:40:22 2011 -0600 @@ -311,6 +311,9 @@ return None path = (cfgpath or name).strip('/') if not self.exists(path, rev): + if self.module.endswith(path) and name == 'trunk': + # we are converting from inside this directory + return None if cfgpath: raise util.Abort(_('expected %s to be at %r, but not found') % (name, path)) @@ -758,7 +761,8 @@ author = author and self.recode(author) or '' try: branch = self.module.split("/")[-1] - if branch == 'trunk': + trunkname = self.ui.config('convert', 'svn.trunk', 'trunk') + if branch == trunkname.strip('/'): branch = '' except IndexError: branch = None diff -r 017f509c973c -r 45b48be6b910 tests/test-convert-svn-source.t --- a/tests/test-convert-svn-source.t Sat Feb 26 16:39:57 2011 +0100 +++ b/tests/test-convert-svn-source.t Sat Feb 26 10:40:22 2011 -0600 @@ -9,6 +9,8 @@ > [extensions] > convert = > graphlog = + > [convert] + > svn.trunk = mytrunk > EOF $ svnadmin create svn-repo @@ -27,20 +29,20 @@ $ mkdir projB $ cd projB - $ mkdir trunk + $ mkdir mytrunk $ mkdir tags $ cd .. $ svnurl="file://$svnpath/svn-repo/proj%20B" $ svn import -m "init projB" projB "$svnurl" | fixpath - Adding projB/trunk + Adding projB/mytrunk Adding projB/tags Committed revision 1. Update svn repository - $ svn co "$svnurl"/trunk B | fixpath + $ svn co "$svnurl"/mytrunk B | fixpath Checked out revision 1. $ cd B $ echo hello > 'letter .txt' @@ -57,7 +59,7 @@ Transmitting file data . Committed revision 3. - $ svn copy -m "tag v0.1" "$svnurl"/trunk "$svnurl"/tags/v0.1 + $ svn copy -m "tag v0.1" "$svnurl"/mytrunk "$svnurl"/tags/v0.1 Committed revision 4. @@ -94,7 +96,7 @@ Transmitting file data .. Committed revision 6. - $ svn copy -m "tag v0.2" "$svnurl"/trunk "$svnurl"/tags/v0.2 + $ svn copy -m "tag v0.2" "$svnurl"/mytrunk "$svnurl"/tags/v0.2 Committed revision 7. @@ -143,7 +145,7 @@ Test filemap $ echo 'include letter2.txt' > filemap - $ hg convert --filemap filemap "$svnurl"/trunk fmap + $ hg convert --filemap filemap "$svnurl"/mytrunk fmap initializing destination fmap repository scanning source... sorting... @@ -154,6 +156,8 @@ 2 nice day 1 second letter 0 work in progress + $ hg -R fmap branch -q + default $ hg glog -R fmap --template '{rev} {desc|firstline} files: {files}\n' o 1 work in progress files: letter2.txt | @@ -161,12 +165,14 @@ Test stop revision - $ hg convert --rev 1 "$svnurl"/trunk stoprev + $ hg convert --rev 1 "$svnurl"/mytrunk stoprev initializing destination stoprev repository scanning source... sorting... converting... 0 init projB + $ hg -R stoprev branch -q + default Check convert_revision extra-records. This is also the only place testing more than one extra field in a revision. @@ -174,5 +180,5 @@ $ cd stoprev $ hg tip --debug | grep extra extra: branch=default - extra: convert_revision=svn:........-....-....-....-............/proj B/trunk@1 (re) + extra: convert_revision=svn:........-....-....-....-............/proj B/mytrunk@1 (re) $ cd .. diff -r 017f509c973c -r 45b48be6b910 tests/test-convert.t --- a/tests/test-convert.t Sat Feb 26 16:39:57 2011 +0100 +++ b/tests/test-convert.t Sat Feb 26 10:40:22 2011 -0600 @@ -204,12 +204,12 @@ The following options can be set with "--config": convert.svn.branches - specify the directory containing branches. The defaults is + specify the directory containing branches. The default is "branches". convert.svn.tags specify the directory containing tags. The default is "tags". convert.svn.trunk - specify the name of the trunk branch The defauls is "trunk". + specify the name of the trunk branch. The default is "trunk". Source history can be retrieved starting at a specific revision, instead of being integrally converted. Only single branch conversions are