def set_version_and_tag(version): ''' ''' global release_branch, debug_mode, fresh_clone, cleanup # Delete existing tag to force creation in debug mode if debug_mode: try: updateversion.tag_delete(version) except: pass # Checkout release branch subprocess.call("git checkout %s" % release_branch, shell=True) if not debug_mode: # Make sure we're up-to-date, ignore untracked files ret = subprocess.check_output( "git status --branch --porcelain --untracked-files=no", shell=True) if not re.search(release_branch + "$", ret): print "\nERROR: branch must be aligned with upstream" sys.exit(4) # Update the code, create commit and tag updateversion.version_set(version) # Make sure we don't delete the modified repo if fresh_clone: cleanup = False
def set_version_and_tag(version): ''' ''' global release_branch, debug_mode, fresh_clone, cleanup # Delete existing tag to force creation in debug mode if debug_mode: try: updateversion.tag_delete(version) except: pass # Checkout release branch subprocess.call("git checkout %s" % release_branch, shell=True) if not debug_mode: # Make sure we're up-to-date ret = subprocess.check_output( "git status --branch --porcelain", shell=True ) if not re.search(release_branch + "$", ret): print "\nERROR: branch must be aligned with upstream" sys.exit(4) # Update the code, create commit and tag updateversion.version_set(version) # Make sure we don't delete the modified repo if fresh_clone: cleanup = False
# Check existence of Tag for version in repo, create if not found try: updateversion.tag_check(version) except: # Checkout release branch subprocess.call("git checkout %s" % release_branch, shell=True) # Make sure we're up-to-date ret = subprocess.check_output("git status --branch --porcelain", shell=True) if not re.search(release_branch + "$", ret): print "\nERROR: branch must be aligned with upstream" sys.exit(4) # Update the code, create commit and tag updateversion.version_set(version) # Make sure we don't delete the modified repo if fresh_clone: cleanup = False # Copy files to release dir release_tmp_dir = path.join(release_path, release_prefix) print "Copying files to '%s'" % release_path retry = True while True: try: shutil.copytree(repo_path, release_tmp_dir, ignore=shutil.ignore_patterns(*exclude_list)) break
# Check existence of Tag for version in repo, create if not found try: updateversion.tag_check(version) except: # Checkout release branch subprocess.call("git checkout %s" % release_branch, shell=True) # Make sure we're up-to-date ret = subprocess.check_output("git status --branch --porcelain", shell=True) if not re.search(release_branch + "$", ret): print "\nERROR: branch must be aligned with upstream" sys.exit(4) # Update the code, create commit and tag updateversion.version_set(version) # Make sure we don't delete the modified repo if fresh_clone: cleanup = False # Copy files to release dir release_tmp_dir = path.join(release_path, release_prefix) print "Copying files to '%s'" % release_path retry = True while True: try: shutil.copytree(repo_path, release_tmp_dir, ignore=shutil.ignore_patterns(*exclude_list)) break except OSError, err: # First try and file exists, try to delete dir