Add an option to "stg branch" to convert the internal format
[stgit] / stgit / commands / branch.py
index 860d7d5..ef44349 100644 (file)
@@ -35,7 +35,9 @@ is always created in a new repository.  This subcommand allows you to
 manage several patch series in the same repository via GIT branches.
 
 When displaying the branches, the names can be prefixed with
-'s' (StGIT managed) or 'p' (protected)."""
+'s' (StGIT managed) or 'p' (protected).
+
+If not given any options, switch to the named branch."""
 
 options = [make_option('-c', '--create',
                        help = 'create a new development branch',
@@ -43,6 +45,9 @@ options = [make_option('-c', '--create',
            make_option('--clone',
                        help = 'clone the contents of the current branch',
                        action = 'store_true'),
+           make_option('--convert',
+                       help = 'switch between old and new format branches',
+                       action = 'store_true'),
            make_option('--delete',
                        help = 'delete an existing development branch',
                        action = 'store_true'),
@@ -148,6 +153,14 @@ def func(parser, options, args):
 
         return
 
+    elif options.convert:
+
+        if len(args) != 0:
+            parser.error('incorrect number of arguments')
+
+        crt_series.convert()
+        return
+
     elif options.delete:
 
         if len(args) != 1: