Ensure that there isn't already a git tag for this version.
499784
def validate_no_existing_tag(tag_string)
      existing_tags = []
      @gitrepo.tags.each { |tag| existing_tags << tag.name }
      if existing_tags.include?(tag_string)
        ui.error 'This version tag has already been committed to the repo.'
        ui.error "Are you sure you haven't released this already?"
        exit 6
      end
    end
549504
def EnsureSConsVersion(self, major, minor, revision=0):
        """"""
        # split string to avoid replacement during build process
        if SCons.__version__ == '__' + 'VERSION__':
            SCons.Warnings.warn(SCons.Warnings.DevelopmentVersionWarning,
                "EnsureSConsVersion is ignored for development version")
            return
        scons_ver = self._get_major_minor_revision(SCons.__version__)
        if scons_ver < (major, minor, revision):
            if revision:
                scons_ver_string = '%d.%d.%d' % (major, minor, revision)
            else:
                scons_ver_string = '%d.%d' % (major, minor)
            print("SCons %s or greater required, but you have SCons %s" % \
                  (scons_ver_string, SCons.__version__))
            sys.exit(2)
159667
def check_existens_of_staging_tag_in_remote_repo():
        
        staging_tag = Git.create_git_version_tag(APISettings.GIT_STAGING_PRE_TAG)

        command_git = 'git ls-remote -t'
        command_awk = 'awk \'{print $2}\''
        command_cut_1 = 'cut -d \'/\' -f 3'
        command_cut_2 = 'cut -d \'^\' -f 1'
        command_sort = 'sort -b -t . -k 1,1nr -k 2,2nr -k 3,3r -k 4,4r -k 5,5r'
        command_uniq = 'uniq'

        command = command_git + ' | ' + command_awk + ' | ' + command_cut_1 + ' | ' + \
                  command_cut_2 + ' | ' + command_sort + ' | ' + command_uniq

        list_of_tags = str(check_output(command, shell=True))

        if staging_tag in list_of_tags:
            return True
        return False
1238038
def ensure_repo_exists(self):
        """"""
        if not os.path.isdir(self.cwd):
            os.makedirs(self.cwd)
        if not os.path.isdir(os.path.join(self.cwd, ".git")):
            self.git.init()
            self.git.config("user.email", "you@example.com")
            self.git.config("user.name", "Your Name")
1105550
function() {
    var highestTag = '0.0.0';
    var tags = exec('git tag');

    if (tags.code !== 0) return highestTag;

    tags = tags.output.split('\n');
    tags.forEach(function(tag) {
      tag = semver.valid(tag);
      if (tag && (!highestTag || semver.gt(tag, highestTag))) {
        highestTag = tag;
      }
    });

    return highestTag;
  }
174376
def tag(self, deploy_tag=''):
        
        if APISettings.SECURE_TAGGING and deploy_tag == APISettings.GIT_ACTIVATE_PRE_TAG:
            if self.check_existens_of_staging_tag_in_remote_repo():
                pass
            else:
                Shell.fail('SECURE TAGGING is TRUE! That means, before you are able to create a production tag, ' \
                           'you need to deploy the software on a staging envirnment.')
                return False
        if self.__git_tag(self.create_git_version_tag(deploy_tag)):
            return True
        return False
250307
def _process_version_lines(self):
        """"""
        if len(self._lines_seen["version"]) > 1:
            self._add_error(_("Multiple version lines appeared."))
        elif self._lines_seen["version"][0] != 1:
            self._add_error(_("The version must be on the first line."))
46448
def get_version_from_tag(tag_name: str) -> Optional[str]:
    

    debug('get_version_from_tag({})'.format(tag_name))
    check_repo()
    for i in repo.tags:
        if i.name == tag_name:
            return i.commit.hexsha
    return None
1257303
def bump_minor_version():
    """"""
    version = load_version_as_list()
    print('current version: {}'.format(format_version_string(version)))
    version[-1] += 1
    print('new version: {}'.format(format_version_string(version)))

    contents = "__version__ = '{}'\n".format(format_version_string(version))

    with open(VERSION_PATH, 'w') as wfile:
        wfile.write(contents)
1336641
def get_version():
        
        try:
            return check_output(
                "git describe --tags".split(" ")
                ).decode('utf-8').strip()
        except CalledProcessError:
            return check_output(
                "git rev-parse --short HEAD".split(" ")
                ).decode('utf-8').strip()
1360628
def _version_checker(module, minver):
    
    # We could use LooseVersion, but distutils imports imp which is deprecated
    version_regexp = r'[a-z]?((?:\d|\.)+\d+)(?:\.dev[0-9]+)?'
    version_tags = re.match(version_regexp, module.__version__)
    if not version_tags:
        return False
    version_tags = version_tags.group(1).split(".")
    version_tags = tuple(int(x) for x in version_tags)
    return version_tags >= minver
1165576
def tag_exists(self, version):
        
        for tag in self.available_tags():
            if tag == version:
                return True
        return False
292209
def get_last_version(skip_tags=None) -> Optional[str]:
    

    debug('get_last_version skip_tags=', skip_tags)
    check_repo()
    skip_tags = skip_tags or []

    def version_finder(tag):
        if isinstance(tag.commit, TagObject):
            return tag.tag.tagged_date
        return tag.commit.committed_date

    for i in sorted(repo.tags, reverse=True, key=version_finder):
        if re.match(r'v\d+\.\d+\.\d+', i.name):
            if i.name in skip_tags:
                continue
            return i.name[1:]
    return None
482853
def __git_commit(git_tag):
        
        Shell.msg('Commit changes.')
        if APISettings.DEBUG:
            Shell.debug('Execute "git commit" in dry mode.')
            if not call(['git', 'commit', '-m', '\'' + git_tag + '\'', '--dry-run']):
                pass
            return True

        if not call(['git', 'commit', '-m', '\'' + git_tag + '\'']):
            return True
        return False
37597
function getVersionTags() {
	var tags = exec('git tag', { silent: true }).output.trim().split(/\n/g);

	return tags.reduce(function(list, tag) {
		if (semver.valid(tag)) {
			list.push(tag);
		}
		return list;
	}, []).sort(semver.compare);
}
440783
def release(ctx, type_, repo=None, prebump_to=PREBUMP):
    
    unprebump(ctx)
    if bump_release(ctx, type_=type_):
        return

    this_version = _read_version()
    ctx.run('towncrier')
    ctx.run(f'git commit -am "Release {this_version}"')
    ctx.run(f'git tag -fa {this_version} -m "Version {this_version}"')

    if repo:
        if upload(ctx, repo=repo):
            return
    else:
        print('[release] Missing --repo, skip uploading')

    prebump(ctx, type_=prebump_to)

    next_version = _read_version()
    ctx.run(f'git commit -am "Prebump to {next_version}"')
82628
def versions(self) -> List(BlenderVersion):
        

        return [BlenderVersion(tag) for tag in self.git_repo.tags] + [BlenderVersion(BLENDER_VERSION_MASTER)]