# we are remastering to.) -F == fixed string (no regexing).
candidates = shell.eval("git", "rev-list", "-F", "--grep=" + summary, "--tags").splitlines()
if len(candidates) != 1:
- raise "Failed looking for " + hash
+ raise FailedRemasterSearch(hash)
mapping[hash] = candidates[0]
# Delete no-ops
for search, replace in mapping.items():
return """
ERROR: Nothing to do!"""
+
+class FailedRemasterSearch(Error):
+ """Couldn't find the corresponding commit for our hash."""
+ hash = None
+ def __init__(self, hash):
+ self.hash = hash
+ def __str__(self):
+ return """
+
+ERROR: Failed looking for %s""" % self.hash