def run_start(args): gitflow = GitFlow() # NB: `args.version` is required since the branch must not yet exist # :fixme: get default value for `base` gitflow.start_transaction('create hotfix branch %s (from %s)' % (args.version, args.base)) try: branch = gitflow.create('hotfix', args.version, args.base, fetch=args.fetch) except (NotInitialized, BranchTypeExistsError, BaseNotOnBranch): # printed in main() raise except Exception as e: die("Could not create hotfix branch %r" % args.version, e) print() print("Summary of actions:") print("- A new branch", branch, "was created, based on", args.base) print("- You are now on branch", branch) print("") print("Follow-up actions:") print("- Bump the version number now!") print("- Start committing your hot fixes") print("- When done, run:") print() print(" git flow hotfix finish", args.version)
def run_list(args): gitflow = GitFlow() gitflow.start_transaction() gitflow.list('feature', 'name', use_tagname=False, verbose=args.verbose)
def run_list(args): gitflow = GitFlow() gitflow.start_transaction() gitflow.list('support', 'version', use_tagname=True, verbose=args.verbose)
def run_start(args): gitflow = GitFlow() # :fixme: Why does the sh-version not require a clean working dir? # NB: `args.name` is required since the branch must not yet exist # :fixme: get default value for `base` gitflow.start_transaction('create feature branch %s (from %s)' % (args.name, args.base)) try: branch = gitflow.create('feature', args.name, args.base, fetch=args.fetch) except (NotInitialized, BaseNotOnBranch): # printed in main() raise except Exception as e: die("Could not create feature branch %r" % args.name, e) print() print("Summary of actions:") print("- A new branch", branch, "was created, based on", args.base) print("- You are now on branch", branch) print("") print("Now, start committing on your feature. When done, use:") print("") print(" git flow feature finish", args.name) print()
def run_finish(args): gitflow = GitFlow() name = gitflow.nameprefix_or_current('feature', args.nameprefix) gitflow.start_transaction('finishing feature branch %s' % name) gitflow.finish('feature', name, fetch=args.fetch, rebase=args.rebase, keep=args.keep, force_delete=args.force_delete, tagging_info=None)
def run_publish(args): gitflow = GitFlow() version = gitflow.name_or_current('hotfix', args.version) gitflow.start_transaction('publishing hotfix branch %s' % version) branch = gitflow.publish('hotfix', version) print() print("Summary of actions:") print("- A new remote branch '%s' was created" % branch) print("- The local branch '%s' was configured to track the remote branch" % branch) print("- You are now on branch '%s'" % branch) print()
def run_track(args): gitflow = GitFlow() # NB: `args.name` is required since the branch must not yet exist gitflow.start_transaction('tracking remote feature branch %s' % args.name) branch = gitflow.track('feature', args.name) print() print("Summary of actions:") print("- A new remote tracking branch '%s' was created" % branch) print("- You are now on branch '%s'" % branch) print()
def run_track(args): gitflow = GitFlow() # NB: `args.name` is required since the branch must not yet exist gitflow.start_transaction('tracking remote feature branch %s' % args.name) branch = gitflow.track('feature', args.name) print print "Summary of actions:" print "- A new remote tracking branch '%s' was created" % branch print "- You are now on branch '%s'" % branch print
def run_publish(args): gitflow = GitFlow() version = gitflow.name_or_current('hotfix', args.version) gitflow.start_transaction('publishing hotfix branch %s' % version) branch = gitflow.publish('hotfix', version) print print "Summary of actions:" print "- A new remote branch '%s' was created" % branch print "- The local branch '%s' was configured to track the remote branch" % branch print "- You are now on branch '%s'" % branch print
def run_track(args): gitflow = GitFlow() # NB: `args.version` is required since the branch must not yet exist gitflow.start_transaction('tracking remote release branch %s' % args.version) branch = gitflow.track('release', args.version) print print "Summary of actions:" print "- A new remote tracking branch '%s' was created" % branch print "- You are now on branch '%s'" % branch print
def run_finish(args): gitflow = GitFlow() name = gitflow.nameprefix_or_current('feature', args.nameprefix) gitflow.start_transaction('finishing feature branch %s' % name) gitflow.finish('feature', name, fetch=args.fetch, rebase=args.rebase, keep=args.keep, force_delete=args.force_delete, tagging_info=None)
def run_publish(args): gitflow = GitFlow() name = gitflow.nameprefix_or_current('feature', args.nameprefix) gitflow.start_transaction('publishing feature branch %s' % name) branch = gitflow.publish('feature', name) print print "Summary of actions:" print "- A new remote branch '%s' was created" % branch print "- The local branch '%s' was configured to track the remote branch" % branch print "- You are now on branch '%s'" % branch print
def run_publish(args): gitflow = GitFlow() name = gitflow.nameprefix_or_current('feature', args.nameprefix) gitflow.start_transaction('publishing feature branch %s' % name) branch = gitflow.publish('feature', name) print() print("Summary of actions:") print("- A new remote branch '%s' was created" % branch) print("- The local branch '%s' was configured to track the remote branch" % branch) print("- You are now on branch '%s'" % branch) print()
def run_track(args): gitflow = GitFlow() # NB: `args.version` is required since the branch must not yet exist gitflow.start_transaction('tracking remote release branch %s' % args.version) branch = gitflow.track('release', args.version) print() print("Summary of actions:") print("- A new remote tracking branch '%s' was created" % branch) print("- You are now on branch '%s'" % branch) print()
def run_finish(args): gitflow = GitFlow() version = gitflow.name_or_current('hotfix', args.version) gitflow.start_transaction('finishing hotfix branch %s' % version) tagging_info = None if not args.notag: tagging_info = dict( sign=args.sign or args.signingkey, signingkey=args.signingkey, message=args.message) release = gitflow.finish('hotfix', version, fetch=args.fetch, rebase=False, keep=args.keep, force_delete=False, tagging_info=tagging_info)
def run_start(args): gitflow = GitFlow() # NB: `args.name` is required since the branch must not yet exist # :fixme: get default value for `base` gitflow.start_transaction('create support branch %s (from %s)' % (args.name, args.base)) try: branch = gitflow.create('support', args.name, args.base, fetch=args.fetch) except (NotInitialized, BranchTypeExistsError, BaseNotOnBranch): # printed in main() raise except Exception, e: die("Could not create support branch %r" % args.name, e)
def run_publish(args): gitflow = GitFlow() git = gitflow.git name = gitflow.nameprefix_or_current('feature', args.nameprefix) gitflow.start_transaction('publishing feature branch %s' % name) branch = gitflow.publish('feature', name) print(branch) base_marker = gitflow.managers['feature'].base_marker_name(str(branch)) git.push(gitflow.origin_name(), base_marker) print print "Summary of actions:" print "- A new remote branch '%s' was created" % branch print "- The local branch '%s' was configured to track the remote branch" % branch print "- You are now on branch '%s'" % branch print
def run_start(args): gitflow = GitFlow() # :fixme: Why does the sh-version not require a clean working dir? # NB: `args.name` is required since the branch must not yet exist # :fixme: get default value for `base` gitflow.start_transaction('create feature branch %s (from %s)' % \ (args.name, args.base)) try: branch = gitflow.create('feature', args.name, args.base, fetch=args.fetch) except (NotInitialized, BaseNotOnBranch): # printed in main() raise except Exception, e: die("Could not create feature branch %r" % args.name, e)
def run_publish(args): gitflow = GitFlow() git = gitflow.git name = gitflow.nameprefix_or_current('feature', args.nameprefix) gitflow.start_transaction('publishing feature branch %s' % name) branch = gitflow.publish('feature', name) print(branch) base_marker = gitflow.managers['feature'].base_marker_name(str(branch)) git.push(gitflow.origin_name(), base_marker) print print "Summary of actions:" print "- A new remote branch '%s' was created" % branch print "- The local branch '%s' was configured to track the remote branch" % branch print "- You are now on branch '%s'" % branch print
def run_finish(args): gitflow = GitFlow() version = gitflow.name_or_current('hotfix', args.version) gitflow.start_transaction('finishing hotfix branch %s' % version) tagging_info = None if not args.notag: tagging_info = dict(sign=args.sign or args.signingkey, signingkey=args.signingkey, message=args.message) release = gitflow.finish('hotfix', version, fetch=args.fetch, rebase=False, keep=args.keep, force_delete=False, tagging_info=tagging_info)
def run_start(args): gitflow = GitFlow() # NB: `args.name` is required since the branch must not yet exist # :fixme: get default value for `base` gitflow.start_transaction('create support branch %s (from %s)' % (args.name, args.base)) try: branch = gitflow.create('support', args.name, args.base, fetch=args.fetch) except (NotInitialized, BranchTypeExistsError, BaseNotOnBranch): # printed in main() raise except Exception, e: die("Could not create support branch %r" % args.name, e)
def run_start(args): gitflow = GitFlow() # :fixme: Why does the sh-version not require a clean working dir? # NB: `args.name` is required since the branch must not yet exist # :fixme: get default value for `base` gitflow.start_transaction('create feature branch %s (from %s)' % \ (args.name, args.base)) try: branch = gitflow.create('feature', args.name, args.base, fetch=args.fetch) except (NotInitialized, BaseNotOnBranch): # printed in main() raise except Exception, e: die("Could not create feature branch %r" % args.name, e)
def run_start(args): gitflow = GitFlow() # NB: `args.version` is required since the branch must not yet exist # :fixme: get default value for `base` gitflow.start_transaction('create release branch %s (from %s)' % (args.version, args.base)) try: gitflow.create('release', args.version, args.base, fetch=args.fetch) except (NotInitialized, BranchTypeExistsError, BaseNotOnBranch): # printed in main() raise except Exception as e: die("Could not create release branch %r" % args.version, e) print("Follow-up actions:") print("- Bump the version number now!") print("- Start committing last-minute fixes in preparing your release") print("- When done, run:") print() print(" git flow release finish", args.version)
def run_start(args): gitflow = GitFlow() # NB: `args.version` is required since the branch must not yet exist # :fixme: get default value for `base` gitflow.start_transaction('create release branch %s (from %s)' % (args.version, args.base)) try: gitflow.create('release', args.version, args.base, fetch=args.fetch) except (NotInitialized, BranchTypeExistsError, BaseNotOnBranch): # printed in main() raise except Exception as e: die("Could not create release branch %r" % args.version, e) print("Follow-up actions:") print("- Bump the version number now!") print("- Start committing last-minute fixes in preparing your release") print("- When done, run:") print() print(" git flow release finish", args.version)
def run_start(args): gitflow = GitFlow() # NB: `args.version` is required since the branch must not yet exist # :fixme: get default value for `base` gitflow.start_transaction('create hotfix branch %s (from %s)' % (args.version, args.base)) try: branch = gitflow.create('hotfix', args.version, args.base, fetch=args.fetch) except (NotInitialized, BranchTypeExistsError, BaseNotOnBranch): # printed in main() raise except Exception as e: die("Could not create hotfix branch %r" % args.version, e) print() print("Summary of actions:") print("- A new branch", branch, "was created, based on", args.base) print("- You are now on branch", branch) print("") print("Follow-up actions:") print("- Bump the version number now!") print("- Start committing your hot fixes") print("- When done, run:") print() print(" git flow hotfix finish", args.version)
def run_start(args): gitflow = GitFlow() # :fixme: Why does the sh-version not require a clean working dir? # NB: `args.name` is required since the branch must not yet exist # :fixme: get default value for `base` gitflow.start_transaction( 'create feature branch %s (from %s)' % (args.name, args.base)) try: branch = gitflow.create('feature', args.name, args.base, fetch=args.fetch) except (NotInitialized, BaseNotOnBranch): # printed in main() raise except Exception as e: die("Could not create feature branch %r" % args.name, e) print() print("Summary of actions:") print("- A new branch", branch, "was created, based on", args.base) print("- You are now on branch", branch) print("") print("Now, start committing on your feature. When done, use:") print("") print(" git flow feature finish", args.name) print()
def run_start(args): if args.for_release: pivotal.check_version_format(args.for_release) gitflow = GitFlow() git = gitflow.git base = None if args.for_release is not None: # Make sure --for-release matches the requirements. pivotal.check_version_format(args.for_release) base = gitflow.get_prefix('release') + args.for_release else: base = gitflow.managers['feature'].default_base() if not args.no_fetch: sys.stderr.write('Fetching origin ... ') gitflow.origin().fetch() print 'OK' # Check if the base exists and is in sync as soon as possible. sys.stdout.write('Checking the base branch ({0}) ... '.format(base)) origin_base = gitflow.require_origin_branch(base) try: gitflow.must_be_uptodate(base) except NoSuchBranchError: sys.stdout.write('found remote counterpart ... ') git.branch(base, origin_base.name) print('OK') [story, name] = pivotal.prompt_user_to_select_story(match=args.match) sys.stdout.write('Setting myself as the story owner ... ') try: story.set_me_as_owner() except: print('FAIL') print('OK') if args.for_release is not None: sys.stdout.write( 'Assigning the chosen story to release {0} ... '.format( args.for_release)) story.assign_to_release(args.for_release) print('OK') if story.is_rejected(): sid = str(story.get_id()) gitflow.start_transaction('restart story {0}'.format(sid)) sys.stdout.write('Checking out the feature branch ... ') try: gitflow.checkout('feature', sid) print('OK') except NoSuchBranchError as e: print('FAIL') raise InconsistencyDetected( 'The branch is missing for story {0}.'.format(sid)) sys.stdout.write('Updating Pivotal Tracker ... ') story.start() print('OK') return # :fixme: Why does the sh-version not require a clean working dir? gitflow.start_transaction('start feature branch %s (from %s)' % \ (name, base)) try: # fetch=False because we are already fetching at the beginning. branch = gitflow.create('feature', name, base, fetch=False) except (NotInitialized, BaseNotOnBranch): # printed in main() raise except Exception, e: die("Could not create feature branch %r" % name, e)
def run_pull(args): gitflow = GitFlow() name = gitflow.name_or_current('feature', args.name, must_exist=False) gitflow.start_transaction('pulling remote feature branch %s ' 'into local banch %s' % (args.remote, name)) gitflow.pull('feature', args.remote, name)
def run_rebase(args): gitflow = GitFlow() name = gitflow.nameprefix_or_current('feature', args.nameprefix) gitflow.start_transaction('rebasing feature branch %s' % name) gitflow.rebase('feature', name, args.interactive)
def run_pull(args): gitflow = GitFlow() name = gitflow.name_or_current('feature', args.name, must_exist=False) gitflow.start_transaction('pulling remote feature branch %s ' 'into local banch %s' % (args.remote, name)) gitflow.pull('feature', args.remote, name)
def run_checkout(args): gitflow = GitFlow() # NB: Does not default to the current branch as `nameprefix` is required name = gitflow.nameprefix_or_current('feature', args.nameprefix) gitflow.start_transaction('checking out feature branch %s' % name) gitflow.checkout('feature', name)
def run_checkout(args): gitflow = GitFlow() # NB: Does not default to the current branch as `nameprefix` is required name = gitflow.nameprefix_or_current('feature', args.nameprefix) gitflow.start_transaction('checking out feature branch %s' % name) gitflow.checkout('feature', name)
def run_list(args): gitflow = GitFlow() gitflow.start_transaction() gitflow.list('feature', 'name', use_tagname=False, verbose=args.verbose)
def run_diff(args): gitflow = GitFlow() name = gitflow.nameprefix_or_current('feature', args.nameprefix) gitflow.start_transaction('diff for feature branch %s' % name) gitflow.diff('feature', name)
def run_rebase(args): gitflow = GitFlow() name = gitflow.nameprefix_or_current('feature', args.nameprefix) gitflow.start_transaction('rebasing feature branch %s' % name) gitflow.rebase('feature', name, args.interactive)
def run_diff(args): gitflow = GitFlow() name = gitflow.nameprefix_or_current('feature', args.nameprefix) gitflow.start_transaction('diff for feature branch %s' % name) gitflow.diff('feature', name)
def run_list(args): gitflow = GitFlow() gitflow.start_transaction() gitflow.list('support', 'version', use_tagname=True, verbose=args.verbose)
def run_start(args): if args.for_release: pivotal.check_version_format(args.for_release) gitflow = GitFlow() git = gitflow.git base = None if args.for_release is not None: # Make sure --for-release matches the requirements. pivotal.check_version_format(args.for_release) base = gitflow.get_prefix('release') + args.for_release else: base = gitflow.managers['feature'].default_base() if not args.no_fetch: sys.stderr.write('Fetching origin ... ') gitflow.origin().fetch() print 'OK' # Check if the base exists and is in sync as soon as possible. sys.stdout.write('Checking the base branch ({0}) ... '.format(base)) origin_base = gitflow.require_origin_branch(base) try: gitflow.must_be_uptodate(base) except NoSuchBranchError: sys.stdout.write('found remote counterpart ... ') git.branch(base, origin_base.name) print('OK') [story, name] = pivotal.prompt_user_to_select_story(match=args.match) sys.stdout.write('Setting myself as the story owner ... ') try: story.set_me_as_owner() except: print('FAIL') print('OK') if args.for_release is not None: sys.stdout.write('Assigning the chosen story to release {0} ... '.format(args.for_release)) story.assign_to_release(args.for_release) print('OK') if story.is_rejected(): sid = str(story.get_id()) gitflow.start_transaction('restart story {0}'.format(sid)) sys.stdout.write('Checking out the feature branch ... ') try: gitflow.checkout('feature', sid) print('OK') except NoSuchBranchError as e: print('FAIL') raise InconsistencyDetected( 'The branch is missing for story {0}.'.format(sid)) sys.stdout.write('Updating Pivotal Tracker ... ') story.start() print('OK') return # :fixme: Why does the sh-version not require a clean working dir? gitflow.start_transaction('start feature branch %s (from %s)' % \ (name, base)) try: # fetch=False because we are already fetching at the beginning. branch = gitflow.create('feature', name, base, fetch=False) except (NotInitialized, BaseNotOnBranch): # printed in main() raise except Exception, e: die("Could not create feature branch %r" % name, e)