hgext/mq.py
branchstable
changeset 10186 296a0b14a686
parent 10185 7637fe4f525d
child 10187 fcc15ba18c03
child 10188 fd6e9c7cd98c
child 10263 25e572394f5c
--- a/hgext/mq.py	Fri Jan 01 19:53:05 2010 +0100
+++ b/hgext/mq.py	Fri Jan 01 19:53:05 2010 +0100
@@ -264,18 +264,19 @@
             diffopts = self.patchopts(diffopts, patchfn)
         return diffopts
 
-    def patchopts(self, diffopts, patchfn):
+    def patchopts(self, diffopts, *patches):
         """Return a copy of input diff options with git set to true if
         referenced patch is a git patch.
         """
         diffopts = diffopts.copy()
-        patchf = self.opener(patchfn, 'r')
-        # if the patch was a git patch, refresh it as a git patch
-        for line in patchf:
-            if line.startswith('diff --git'):
-                diffopts.git = True
-                break
-        patchf.close()
+        for patchfn in patches:
+            patchf = self.opener(patchfn, 'r')
+            # if the patch was a git patch, refresh it as a git patch
+            for line in patchf:
+                if line.startswith('diff --git'):
+                    diffopts.git = True
+                    break
+            patchf.close()
         return diffopts
 
     def join(self, *p):
@@ -2070,7 +2071,8 @@
     if opts['edit']:
         message = ui.edit(message, user or ui.username())
 
-    q.refresh(repo, msg=message)
+    diffopts = q.patchopts(q.diffopts(), *patches)
+    q.refresh(repo, msg=message, git=diffopts.git)
     q.delete(repo, patches, opts)
     q.save_dirty()