Infer used SVN code revision.
@param path location of the code whose SVN revision will be checked.
If the target path is not an SVN repository, a manually maintained text file database of revisions will be
consulted as a fallback.
If neither the SVN check nor the fallback solution finds a revision, 'unknown' will be returned.
@author Stefan Richter <stefan.richter@cern.ch>
Definition at line 6 of file revision_checking.py.
8 Infer used SVN code revision.
10 @param path location of the code whose SVN revision will be checked.
12 If the target path is not an SVN repository, a manually maintained text file database of revisions will be
13 consulted as a fallback.
15 If neither the SVN check nor the fallback solution finds a revision, 'unknown' will be returned.
17 @author Stefan Richter <stefan.richter@cern.ch>
21 command =
"svn info {path}".
format(path=os.path.realpath(path))
22 p = subprocess.Popen(command.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=
True)
23 (svninfo, _) = p.communicate()
24 for line
in svninfo.split(
'\n'):
25 if "Revision:" in line:
26 return line.split()[-1]
32 with open(os.path.join(os.environ[
"POWHEGPATH"],
"ProcessRevisions.txt"),
"r")
as dbfile:
34 tokens = line.split(
" : ")
35 if tokens[0] == os.path.basename(path):