# HG changeset patch # User Pierre-Yves David <pierre-yves.david@octobus.net> # Date 1568406932 -7200 # Fri Sep 13 22:35:32 2019 +0200 # Node ID 5e0164a76aa0984804806bf926b69757317164d0 # Parent de5e038152f68c5decc4370c92efe472e68a76a9 rust: fix the compatibility checks I am not sure what the previous code was trying to achieve... but this should work fine. diff --git a/benchmarks/utils.py b/benchmarks/utils.py --- a/benchmarks/utils.py +++ b/benchmarks/utils.py @@ -330,22 +330,14 @@ # Don't use `subprocess.PIPE` as it can deadlock (see docs). # We capture `stderr` because the error message from `hg log` would # make it seem like there was a bug. - with open(os.devnull, "w") as FNULL: - try: - self.hg( - "log", - "-r", - "94167e701e125dce1788e19b1e1489958235e40c", - stderr=FNULL, - ) - except subprocess.CalledProcessError as e: - if e.returncode == 255: - raise NotImplementedError( - "Rust modulepolicy was not implemented before " - "revision 94167e701e125dce1788e19b1e1489958235e40c" - ", skipping." - ) - raise + currentrev = self.get_asv_rev() + revset = "94167e701e125dce1788e19b1e1489958235e40c::" + if not self._matchrevset(revset, currentrev): + raise NotImplementedError( + "Rust modulepolicy was not implemented before " + "revision 94167e701e12" + ", skipping." + ) def _matchrevset(self, revset, target_rev): """return True if <target-rev> is within <revset>"""