LSSTApplications  16.0-10-g0ee56ad+4,16.0-11-ga33d1f2+4,16.0-12-g3ef5c14+2,16.0-12-g71e5ef5+17,16.0-12-gbdf3636+2,16.0-13-g118c103+2,16.0-13-g8f68b0a+2,16.0-15-gbf5c1cb+3,16.0-16-gfd17674+2,16.0-17-g7c01f5c+2,16.0-18-g0a50484,16.0-20-ga20f992+7,16.0-21-g0e05fd4+5,16.0-21-g15e2d33+3,16.0-22-g62d8060+3,16.0-22-g847a80f+3,16.0-25-gf00d9b8,16.0-28-g3990c221+3,16.0-3-gf928089+2,16.0-32-g88a4f23+4,16.0-34-gd7987ad+2,16.0-37-gc7333cb+1,16.0-4-g10fc685+1,16.0-4-g18f3627+25,16.0-4-g5f3a788+25,16.0-5-gaf5c3d7+3,16.0-5-gcc1f4bb,16.0-6-g3b92700+3,16.0-6-g4412fcd+2,16.0-6-g7235603+3,16.0-69-g2562ce1b+1,16.0-7-g0913a87,16.0-8-g14ebd58+3,16.0-8-g2df868b,16.0-8-g4cec79c+5,16.0-8-gadf6c7a,16.0-82-g59ec2a54a,16.0-9-g5400cdc+1,16.0-9-ge6233d7+4,master-g2880f2d8cf+2,v17.0.rc1
LSSTDataManagementBasePackage
Functions
lsst.sconsUtils.vcs.hg Namespace Reference

Functions

def guessVersionName ()
 
def guessFingerprint ()
 

Function Documentation

◆ guessFingerprint()

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

Definition at line 45 of file hg.py.

45 def guessFingerprint():
46  """Return (fingerprint, modified) where fingerprint is the repository's SHA1"""
47  fingerprint, modified = "0x0", False
48  if not os.path.exists(".hg"):
49  state.log.warn("Cannot guess fingerprint without .hg directory; will be set to '%s'." % fingerprint)
50  else:
51  idents = utils.runExternal("hg id", fatal=True)
52  ident = re.split(r"\s+", idents)
53  if len(ident) == 0:
54  raise RuntimeError("Unable to determine hg version")
55 
56  fingerprint = utils.runExternal("hg ident --id", fatal=True).strip()
57  if re.search(r"\+", ident[0]):
58  modified = True
59 
60  return fingerprint, modified
61 
def guessFingerprint()
Definition: hg.py:45
bool strip
Definition: fits.cc:831

◆ guessVersionName()

def lsst.sconsUtils.vcs.hg.guessVersionName ( )
Guess a version name

Definition at line 14 of file hg.py.

14 def guessVersionName():
15  """Guess a version name"""
16  version = "unknown"
17  if not os.path.exists(".hg"):
18  state.log.warn("Cannot guess version without .hg directory; will be set to '%s'." % version)
19  return version
20 
21  idents = utils.runExternal("hg id", fatal=True)
22  ident = re.split(r"\s+", idents)
23  if len(ident) == 0:
24  raise RuntimeError("Unable to determine hg version")
25 
26  if re.search(r"\+", ident[0]):
27  raise RuntimeError("Error with hg version: uncommitted changes")
28 
29  if len(ident) == 1:
30  # Somehow, this is all we've got...
31  return ident[0]
32 
33  # Prefer tag name to branch name; branch names get printed in parens
34  index = 1
35  while ident[index].startswith('(') and ident[index].endswith(')') and len(ident) > index + 1:
36  index += 1
37 
38  # Prefer hash to "tip"
39  if ident[index] == "tip":
40  return ident[0]
41 
42  return ident[index]
43 
44 
def guessVersionName()
Definition: hg.py:14