diff hgext/mq.py @ 7160:1b7b21b634f2

mq: make qimport -f work properly. Closes issue1255. From Bernhard Leiner.
author Brendan Cully <brendan@kublai.com>
date Sat, 18 Oct 2008 17:29:45 -0700
parents d1d011accf94
children b420ef2c812b
line wrap: on
line diff
--- a/hgext/mq.py	Sat Oct 18 16:53:44 2008 -0700
+++ b/hgext/mq.py	Sat Oct 18 17:29:45 2008 -0700
@@ -1511,9 +1511,11 @@
                 checkfile(patchname)
                 patchf = self.opener(patchname, "w")
                 patchf.write(text)
-            checkseries(patchname)
-            index = self.full_series_end() + i
-            self.full_series[index:index] = [patchname]
+            if not force:
+                checkseries(patchname)
+            if patchname not in self.series:
+                index = self.full_series_end() + i
+                self.full_series[index:index] = [patchname]
             self.parse_series()
             self.ui.warn("adding %s to series file\n" % patchname)
             i += 1