+
+ if __is_current_branch(args[0]):
+ raise CmdException, 'Renaming the current branch is not supported'
+
+ stack.Series(args[0]).rename(args[1])
+
+ print 'Renamed branch "%s" as "%s".' % (args[0], args[1])
+
+ return
+
+ elif options.unprotect:
+
+ if len(args) == 0:
+ branch_name = crt_series.get_branch()
+ elif len(args) == 1:
+ branch_name = args[0]
+ else:
+ parser.error('incorrect number of arguments')
+ branch = stack.Series(branch_name)
+
+ if not branch.is_initialised():
+ raise CmdException, 'Branch "%s" is not controlled by StGIT' \
+ % branch_name
+
+ print 'Unprotecting branch "%s"...' % branch_name,
+ sys.stdout.flush()
+ branch.unprotect()
+ print 'done'
+