mirror of
https://github.com/alliedmodders/metamod-source.git
synced 2024-11-28 10:24:20 +01:00
Fix versioning script on Python 3.
This commit is contained in:
parent
6715a68945
commit
d32e696f3a
@ -20,6 +20,9 @@ sources = [
|
||||
|
||||
# This is a hack, but we need some way to only run this script when HG changes.
|
||||
os.path.join(builder.sourcePath, '.hg', 'dirstate'),
|
||||
|
||||
# The script source is a dependency, of course...
|
||||
argv[1]
|
||||
]
|
||||
cmd_node, output_nodes = builder.AddCommand(
|
||||
inputs=sources,
|
||||
|
@ -14,6 +14,8 @@ OutputFolder = os.path.normpath(argv[1])
|
||||
def get_hg_version():
|
||||
argv = ['hg', 'parent', '-R', SourceFolder]
|
||||
text = subprocess.check_output(argv)
|
||||
if str != bytes:
|
||||
text = str(text, 'utf-8')
|
||||
m = re.match('changeset:\s+(\d+):(.+)', text)
|
||||
if m == None:
|
||||
raise Exception('Could not determine repository version')
|
||||
|
Loading…
Reference in New Issue
Block a user