Bug 1338180 - Use hg SHA1 to identify wpt sync point, r=Ms2ger
authorJames Graham <james@hoppipolla.co.uk>
Tue, 31 Jan 2017 19:05:14 -0800
changeset 342239 2e544c9e2fdcef1f3f7259764bdf263a7121e18f
parent 342238 fc4ac23cf72b7042ce4df5a6d80287a0119c7290
child 342240 9f23fb946723b47b9a1e1b1c82c6c3556e0354c7
push id31346
push userkwierso@gmail.com
push dateFri, 10 Feb 2017 22:33:24 +0000
treeherdermozilla-central@7b9d9e4a82a6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMs2ger
bugs1338180
milestone54.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
Bug 1338180 - Use hg SHA1 to identify wpt sync point, r=Ms2ger MozReview-Commit-ID: BEyaIyJqtZ4
testing/web-platform/update/tree.py
testing/web-platform/update/upstream.py
--- a/testing/web-platform/update/tree.py
+++ b/testing/web-platform/update/tree.py
@@ -20,16 +20,22 @@ class HgTree(wptupdate.tree.HgTree):
 class GitTree(wptupdate.tree.GitTree):
     def __init__(self, *args, **kwargs):
         """Extension of the basic GitTree with extra methods for
         transfering patches"""
         commit_cls = kwargs.pop("commit_cls", Commit)
         wptupdate.tree.GitTree.__init__(self, *args, **kwargs)
         self.commit_cls = commit_cls
 
+    def rev_from_hg(self, rev):
+        return self.git("cinnabar", "hg2git", rev).strip()
+
+    def rev_to_hg(self, rev):
+        return self.git("cinnabar", "git2hg", rev).strip()
+
     def create_branch(self, name, ref=None):
         """Create a named branch,
 
         :param name: String representing the branch name.
         :param ref: None to use current HEAD or rev that the branch should point to"""
 
         args = []
         if ref is not None:
--- a/testing/web-platform/update/upstream.py
+++ b/testing/web-platform/update/upstream.py
@@ -93,17 +93,18 @@ class GetLastSyncData(Step):
         self.logger.info("Looking for last sync commit")
         state.sync_data_path = os.path.join(state.metadata_path, "mozilla-sync")
         items = {}
         with open(state.sync_data_path) as f:
             for line in f.readlines():
                 key, value = [item.strip() for item in line.split(":", 1)]
                 items[key] = value
 
-        state.last_sync_commit = Commit(state.local_tree, items["local"])
+        state.last_sync_commit = Commit(state.local_tree,
+                                        state.local_tree.rev_from_hg(items["local"]))
         state.old_upstream_rev = items["upstream"]
 
         if not state.local_tree.contains_commit(state.last_sync_commit):
             self.logger.error("Could not find last sync commit %s" % last_sync_sha1)
             return exit_clean
 
         self.logger.info("Last sync to web-platform-tests happened in %s" % state.last_sync_commit.sha1)
 
@@ -306,17 +307,17 @@ class MergeUpstream(Step):
 
 class UpdateLastSyncData(Step):
     """Update the gecko commit at which we last performed a sync with upstream."""
 
     provides = []
 
     def create(self, state):
         self.logger.info("Updating last sync commit")
-        data = {"local": state.local_tree.rev,
+        data = {"local": state.local_tree.rev_to_hg(state.local_tree.rev),
                 "upstream": state.sync_tree.rev}
         with open(state.sync_data_path, "w") as f:
             for key, value in data.iteritems():
                 f.write("%s: %s\n" % (key, value))
         # This gets added to the patch later on
 
 class MergeLocalBranch(Step):
     """Create a local branch pointing at the commit to upstream"""