1
0
mirror of https://github.com/alliedmodders/metamod-source.git synced 2024-11-29 11:24:19 +01:00

Fix versioning script on Python 3.

This commit is contained in:
David Anderson 2013-11-18 10:18:30 -08:00
parent 6715a68945
commit d32e696f3a
2 changed files with 5 additions and 0 deletions

View File

@ -20,6 +20,9 @@ sources = [
# This is a hack, but we need some way to only run this script when HG changes. # This is a hack, but we need some way to only run this script when HG changes.
os.path.join(builder.sourcePath, '.hg', 'dirstate'), os.path.join(builder.sourcePath, '.hg', 'dirstate'),
# The script source is a dependency, of course...
argv[1]
] ]
cmd_node, output_nodes = builder.AddCommand( cmd_node, output_nodes = builder.AddCommand(
inputs=sources, inputs=sources,

View File

@ -14,6 +14,8 @@ OutputFolder = os.path.normpath(argv[1])
def get_hg_version(): def get_hg_version():
argv = ['hg', 'parent', '-R', SourceFolder] argv = ['hg', 'parent', '-R', SourceFolder]
text = subprocess.check_output(argv) text = subprocess.check_output(argv)
if str != bytes:
text = str(text, 'utf-8')
m = re.match('changeset:\s+(\d+):(.+)', text) m = re.match('changeset:\s+(\d+):(.+)', text)
if m == None: if m == None:
raise Exception('Could not determine repository version') raise Exception('Could not determine repository version')