The following patch solves the Problem.
Unfortunately, I don't have time for polishing and proper testing during the
next weeks. Maybe somebody else likes to take this as a starting point...
diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -1379,7 +1379,7 @@
def qimport(self, repo, files, patchname=None, rev=None, existing=None,
force=None, git=False):
def checkseries(patchname):
- if patchname in self.series:
+ if not force and patchname in self.series:
raise util.Abort(_('patch %s is already in the series file')
% patchname)
def checkfile(patchname):
@@ -1480,8 +1480,9 @@
patchf = self.opener(patchname, "w")
patchf.write(text)
checkseries(patchname)
- index = self.full_series_end() + i
- self.full_series[index:index] = [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
|