mq: bail out if a patch appears more than once in the series file.
authorBrendan Cully <brendan@kublai.com>
Wed, 27 Sep 2006 14:32:53 -0700
changeset 3177 87b7ae306d54
parent 3176 0e6b58c7beea
child 3178 b3e103c388fc
mq: bail out if a patch appears more than once in the series file. Closes: #379.
hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -114,6 +114,9 @@ class queue:
                 comment = l[h:]
             patch = patch.strip()
             if patch:
+                if patch in self.series:
+                    raise util.Abort(_('%s appears more than once in %s') %
+                                     (patch, self.join(self.series_path)))
                 self.series.append(patch)
                 self.series_guards.append(self.guard_re.findall(comment))