No bug: [taskgraph] Get hg branch name in a machine readable format; r=dustin
authorTom Prince <mozilla@hocat.ca>
Tue, 25 Dec 2018 14:25:19 +0000
changeset 509025 59cdd33a1ddf883b8db83645bad4991fe26465d7
parent 509024 1ff40219367b6abc761fc12207ae14a93eccab2d
child 509026 af22225148f7cb57718a9b3f4428d57ba93f6842
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
No bug: [taskgraph] Get hg branch name in a machine readable format; r=dustin The original code include several extraneous newlines. Use a template instead, to get a stable output format. Differential Revision: https://phabricator.services.mozilla.com/D15309
taskcluster/taskgraph/util/hg.py
--- a/taskcluster/taskgraph/util/hg.py
+++ b/taskcluster/taskgraph/util/hg.py
@@ -35,16 +35,20 @@ def find_hg_revision_push_info(repositor
         )
     pushid = pushes.keys()[0]
     return {'pushdate': pushes[pushid]['date'], 'pushid': pushid}
 
 
 def get_hg_revision_branch(root, revision):
     """Given the parameters for a revision, find the hg_branch (aka
     relbranch) of the revision."""
-    return subprocess.check_output(['hg', 'identify', '--branch', '--rev', revision], cwd=root)
+    return subprocess.check_output([
+        'hg', 'identify',
+        '-T', '{branch}',
+        '--rev', revision,
+    ], cwd=root)
 
 
 def calculate_head_rev(root):
     # we assume that run-task has correctly checked out the revision indicated by
     # GECKO_HEAD_REF, so all that remains is to see what the current revision is.
     # Mercurial refers to that as `.`.
     return subprocess.check_output(['hg', 'log', '-r', '.', '-T', '{node}'], cwd=root)