Bug 644917 - imported bz://NNNN patch names are wrong, r=robarnold
authorSteve Fink <sfink@mozilla.com>
Tue, 21 Dec 2010 14:18:19 -0800
changeset 65 12e11daf441e
parent 64 8b9c6e4ff2ab
child 66 b86343ae2917
push id47
push usersfink@mozilla.com
push date2011-03-25 17:16 +0000
reviewersrobarnold
bugs644917
Bug 644917 - imported bz://NNNN patch names are wrong, r=robarnold
__init__.py
--- a/__init__.py
+++ b/__init__.py
@@ -162,21 +162,22 @@ def extsetup(ui=None):
 
     # If the user passed a name, then mq used that so we don't need to rename
     if not opts['name']:
       # cache the lookup of the name. findcmd is not fast.
       qrename = cmdutil.findcmd("qrename", commands.table)[1][0]
 
       # For all the already imported patches, rename them
       for (patch, path) in list(bzhandler.imported_patches):
-        # This mimicks the mq code to pick a filename.
-        oldpatchname = os.path.normpath(os.path.basename(path))
+        oldpatchname = patch.id or patch.bug.num
         newpatchname = checkpatchname(patch)
         if newpatchname != oldpatchname:
           qrename(ui, repo, oldpatchname, newpatchname)
+          if ui.verbose:
+            ui.write("Renamed %s -> %s\n" % (oldpatchname, newpatchname))
 
     # now process the delayed imports
 
     # these opts are invariant for all patches
     newopts = {}
     newopts.update(opts)
     newopts['force'] = True