X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2Fsystem.py;h=6b793397f12e8280bece2dd60d28b37caaadbe4c;hb=d828b7da029994130b3717855155e49d58ee87ea;hp=6e7a788bdd41eead121c8f9cd459d56256f1d432;hpb=2d995e07e2b02f89ca0309716ca609655f56e8e8;p=tools%2Fsat.git diff --git a/src/system.py b/src/system.py index 6e7a788..6b79339 100644 --- a/src/system.py +++ b/src/system.py @@ -54,6 +54,21 @@ def show_in_editor(editor, filePath, logger): logger.write(printcolors.printcError(_("Unable to edit file %s\n") % filePath), 1) +def git_describe(repo_path): + '''Use git describe --tags command to return tag description of the git repository" + :param repo_path str: The git repository to describe + ''' + git_cmd="cd %s;git describe --tags" % repo_path + p = subprocess.Popen(git_cmd, shell=True, + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + p.wait() + if p.returncode != 0: + return False + else: + return p.stdout.readlines()[0].strip() + def git_extract(from_what, tag, where, logger, environment=None): '''Extracts sources from a git repository.