Bug 732194 - Used wrong class name when checking for errors in check_update. r=jdm
authorSteve Fink <sfink@mozilla.com>
Thu, 01 Mar 2012 14:44:30 -0800
changeset 87 3bbd655e98409e2d8509f028ea9747fc7bc92b64
parent 86 9ee8ce05c83a80f9c72e79394100c35cb9452816
child 88 ce99681f1567561ce414f65109b76bac2850f326
push id37
push usersfink@mozilla.com
push dateFri, 02 Mar 2012 06:18:58 +0000
reviewersjdm
bugs732194
Bug 732194 - Used wrong class name when checking for errors in check_update. r=jdm
bzexport.py
--- a/bzexport.py
+++ b/bzexport.py
@@ -792,17 +792,17 @@ def infer_arguments(ui, repo, args, opts
         # Default to 'tip'
         rev = 'tip'
 
     if repo[rev] == repo["tip"]:
         m, a, r, d = repo.status()[:4]
         if (m or a or r or d):
             raise util.Abort(_("Local changes found; refresh first!"))
 
-    if rev in ["tip", "qtip"]:
+    if rev in ["tip", "qtip", "default"]:
         # Look for a nicer name in the MQ.
         if hasattr(repo, 'mq') and repo.mq.applied:
             rev = repo.mq.applied[-1].name
 
     # Check for bug number in the patch filename
     if bug is None:
         m = re.match(r'bug[_\-]?(\d+)', rev)
         if m:
@@ -941,17 +941,18 @@ def update_patch(ui, repo, rev, bug, upd
         rename_patch = update
     else:
         update_patch = ui.configbool("bzexport", "update-patch", False)
         rename_patch = ui.configbool("bzexport", "rename-patch", False)
 
     q = repo.mq
     try:
         rev = q.lookup(rev)
-    except mercurial.error.Abort, e:
+    except util.error.Abort, e:
+        # If the patch is not coming from mq, don't complain that the name is not found
         update_patch = False
         rename_patch = False
 
     if update_patch or rename_patch:
         if interactive and ui.prompt(_("Update patch name/description (y/n)?")) != 'y':
             ui.write(_("Exiting without updating patch\n"))
             return