changeset 693:03dca55abec9

clone: add --singlebranch option Allows one to specify branch name for layout=single without an external branchmap file.
author Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
date Wed, 15 Sep 2010 17:49:27 +0200
parents 42879fddf727
children e32ed1802478
files hgsubversion/__init__.py hgsubversion/svnmeta.py hgsubversion/wrappers.py
diffstat 3 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/__init__.py
+++ b/hgsubversion/__init__.py
@@ -75,6 +75,7 @@ wrapcmds = { # cmd: generic, target, fix
         ('', 'layout', 'auto', ('import standard layout or single '
                                 'directory? Can be standard, single, or auto.')),
         ('', 'branchmap', '', 'file containing rules for branch conversion'),
+        ('', 'singlebranch', '', 'branch name to use for local svn commits'),
         ('', 'startrev', '', ('convert Subversion revisions starting at the one '
                               'specified, either an integer revision or HEAD; '
                               'HEAD causes only the latest revision to be '
--- a/hgsubversion/svnmeta.py
+++ b/hgsubversion/svnmeta.py
@@ -53,6 +53,8 @@ class SVNMeta(object):
         tag_locations = self.ui.configlist('hgsubversion', 'tagpaths', ['tags'])
         self.usebranchnames = self.ui.configbool('hgsubversion',
                                                  'usebranchnames', True)
+        branchmap = self.ui.config('hgsubversion', 'branchmap')
+        singlebranch = self.ui.config('hgsubversion', 'singlebranch')
 
         # FIXME: test that this hasn't changed! defer & compare?
         if subdir:
@@ -90,8 +92,10 @@ class SVNMeta(object):
                                  defaulthost=author_host)
         if authors: self.authors.load(authors)
         self.branchmap = maps.BranchMap(self.ui, self.branchmapfile)
-        if self.ui.config('hgsubversion', 'branchmap'):
-            self.branchmap.load(self.ui.config('hgsubversion', 'branchmap'))
+        if branchmap:
+            self.branchmap.load(branchmap)
+        if singlebranch:
+            self.branchmap['default'] = singlebranch
 
         self.lastdate = '1970-01-01 00:00:00 -0000'
         self.filemap = maps.FileMap(repo)
--- a/hgsubversion/wrappers.py
+++ b/hgsubversion/wrappers.py
@@ -390,6 +390,7 @@ optionmap = {
     'authors': ('hgsubversion', 'authormap'),
     'filemap': ('hgsubversion', 'filemap'),
     'branchmap': ('hgsubversion', 'branchmap'),
+    'singlebranch': ('hgsubversion', 'singlebranch'),
     'stupid': ('hgsubversion', 'stupid'),
     'defaulthost': ('hgsubversion', 'defaulthost'),
     'defaultauthors': ('hgsubversion', 'defaultauthors'),