LSSTApplications  10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
Functions
lsst.sconsUtils.vcs.git Namespace Reference

Functions

def guessVersionName
 
def guessFingerprint
 

Function Documentation

def lsst.sconsUtils.vcs.git.guessFingerprint ( )
Return (fingerprint, modified) where fingerprint is the repository's SHA1

Definition at line 26 of file git.py.

26 
27 def guessFingerprint():
28  """Return (fingerprint, modified) where fingerprint is the repository's SHA1"""
29  fingerprint, modified = "0x0", False
30 
31  if not os.path.exists(".git"):
32  state.log.warn("Cannot guess fingerprint without .git directory; will be set to '%s'."
33  % fingerprint)
34  else:
35  status = utils.runExternal("git status --porcelain --untracked-files=no", fatal=True)
36  if status.strip():
37  modified = True
38  output = utils.runExternal("git rev-parse HEAD", fatal=False)
39 
40  fingerprint = output.strip()
41 
42  return fingerprint, modified
def lsst.sconsUtils.vcs.git.guessVersionName ( )
Guess a version name

Definition at line 14 of file git.py.

14 
15 def guessVersionName():
16  """Guess a version name"""
17 
18  if not os.path.exists(".git"):
19  state.log.warn("Cannot guess version without .git directory; version will be set to 'unknown'.")
20  return "unknown"
21  status = utils.runExternal("git status --porcelain --untracked-files=no", fatal=True)
22  if status.strip():
23  raise RuntimeError("Error with git version: uncommitted changes")
24  desc = utils.runExternal("git describe --tags --always", fatal=True)
25  return desc.strip()