diff hgext/mq.py @ 4182:ba51a8225a60

Merge with crew-stable
author Brendan Cully <brendan@kublai.com>
date Sat, 10 Mar 2007 17:45:32 -0800
parents 9dc64c8414ca 7307d2e98b32
children 65aabd9f16f0
line wrap: on
line diff
--- a/hgext/mq.py	Fri Mar 09 20:08:13 2007 +0100
+++ b/hgext/mq.py	Sat Mar 10 17:45:32 2007 -0800
@@ -1031,10 +1031,10 @@
             m = util.unique(mm)
             r = util.unique(dd)
             a = util.unique(aa)
-            filelist = filter(matchfn, util.unique(m + r + a))
+            c = [filter(matchfn, l) for l in (m, a, r, [], u)]
+            filelist = util.unique(c[0] + c[1] + c[2])
             patch.diff(repo, patchparent, files=filelist, match=matchfn,
-                       fp=patchf, changes=(m, a, r, [], u),
-                       opts=self.diffopts())
+                       fp=patchf, changes=c, opts=self.diffopts())
             patchf.close()
 
             repo.dirstate.setparents(*cparents)
@@ -1082,7 +1082,8 @@
                 message = msg
 
             self.strip(repo, top, update=False, backup='strip', wlock=wlock)
-            n = repo.commit(filelist, message, changes[1], force=1, wlock=wlock)
+            n = repo.commit(filelist, message, changes[1], match=matchfn,
+                            force=1, wlock=wlock)
             self.applied[-1] = statusentry(revlog.hex(n), patchfn)
             self.applied_dirty = 1
         else:
@@ -1527,7 +1528,11 @@
         if sr.mq.applied:
             qbase = revlog.bin(sr.mq.applied[0].rev)
             if not hg.islocal(dest):
-                destrev = sr.parents(qbase)[0]
+                heads = dict.fromkeys(sr.heads())
+                for h in sr.heads(qbase):
+                    del heads[h]
+                destrev = heads.keys()
+                destrev.append(sr.changelog.parents(qbase)[0])
     ui.note(_('cloning main repo\n'))
     sr, dr = hg.clone(ui, sr, dest,
                       pull=opts['pull'],