]> scripts.mit.edu Git - wizard.git/commitdiff
Remove string exception from remaster.
authorEdward Z. Yang <ezyang@mit.edu>
Mon, 20 Aug 2012 00:07:01 +0000 (20:07 -0400)
committerEdward Z. Yang <ezyang@mit.edu>
Mon, 20 Aug 2012 00:07:01 +0000 (20:07 -0400)
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
wizard/command/remaster.py

index b07401486bda7e16d8ca697d9e5f19143d85596c..bc1b47d8f53a2d37902f998d3169de27f6050360 100644 (file)
@@ -40,7 +40,7 @@ def main(argv, baton):
         # 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():
@@ -152,3 +152,13 @@ class NothingToDo(Error):
         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