Rev 335: Make to_location optional. If not specified, it is determined frm in http://people.samba.org/bzr/jelmer/bzr-svn/bzr.dev

Jelmer Vernooij jelmer at samba.org
Sat Dec 30 17:35:05 GMT 2006


------------------------------------------------------------
revno: 335
revision-id: jelmer at samba.org-20061230173356-d81shupvjqeb1g4j
parent: jelmer at samba.org-20061230021458-dlocxymqbkrngyet
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: main
timestamp: Sat 2006-12-30 18:33:56 +0100
message:
  Make to_location optional. If not specified, it is determined frm 
  from_location in the same way as cmd_branch from bzr does.
modified:
  __init__.py                    __init__.py-20051008155114-eae558e6cf149e1d
=== modified file '__init__.py'
--- a/__init__.py	2006-12-27 05:11:19 +0000
+++ b/__init__.py	2006-12-30 17:33:56 +0000
@@ -113,21 +113,25 @@
     """Convert a Subversion repository to a Bazaar repository.
     
     """
-    takes_args = ['url', 'output_dir']
+    takes_args = ['from_location', 'to_location?']
     takes_options = [Option('trees', help='Create working trees'),
                      Option('shared', help='Create shared repository'),
                      Option('scheme', type=get_scheme,
                          help='Branching scheme (none, trunk, or trunk-INT)')]
 
     @display_command
-    def run(self, url, output_dir, trees=False, shared=False, scheme=None):
+    def run(self, from_location, to_location=None, trees=False, 
+            shared=False, scheme=None):
         from convert import convert_repository
         from scheme import TrunkBranchingScheme
 
         if scheme is None:
             scheme = TrunkBranchingScheme()
 
-        convert_repository(url, output_dir, scheme, shared, trees)
+        if to_location is None:
+            to_location = os.path.basename(from_location.rstrip("/\\"))
+
+        convert_repository(from_location, to_location, scheme, shared, trees)
 
 
 register_command(cmd_svn_import)




More information about the bazaar-commits mailing list