LSSTApplications
10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
home
lsstsw
stack
Linux64
sconsUtils
11.0
python
lsst
sconsUtils
vcs
git.py
Go to the documentation of this file.
1
#
2
# A simple python interface to git, using os.popen
3
# Based on the svn interface.
4
#
5
# If ever we want to do anything clever, we should use one of
6
# the supported python packages
7
#
8
from
__future__
import
absolute_import, division, print_function
9
import
os
10
import
re
11
from
..
import
state
12
from
..
import
utils
13
14
def
guessVersionName
():
15
"""Guess a version name"""
16
17
if
not
os.path.exists(
".git"
):
18
state.log.warn(
"Cannot guess version without .git directory; version will be set to 'unknown'."
)
19
return
"unknown"
20
status = utils.runExternal(
"git status --porcelain --untracked-files=no"
, fatal=
True
)
21
if
status.strip():
22
raise
RuntimeError(
"Error with git version: uncommitted changes"
)
23
desc = utils.runExternal(
"git describe --tags --always"
, fatal=
True
)
24
return
desc.strip()
25
26
def
guessFingerprint
():
27
"""Return (fingerprint, modified) where fingerprint is the repository's SHA1"""
28
fingerprint, modified =
"0x0"
,
False
29
30
if
not
os.path.exists(
".git"
):
31
state.log.warn(
"Cannot guess fingerprint without .git directory; will be set to '%s'."
32
% fingerprint)
33
else
:
34
status = utils.runExternal(
"git status --porcelain --untracked-files=no"
, fatal=
True
)
35
if
status.strip():
36
modified =
True
37
output = utils.runExternal(
"git rev-parse HEAD"
, fatal=
False
)
38
39
fingerprint = output.strip()
40
41
return
fingerprint, modified
lsst.sconsUtils.vcs.git.guessFingerprint
def guessFingerprint
Definition:
git.py:26
lsst.sconsUtils.vcs.git.guessVersionName
def guessVersionName
Definition:
git.py:14
Generated on Thu Sep 24 2015 02:29:24 for LSSTApplications by
1.8.5