Show More
@@ -737,11 +737,29 b' class queue(object):' | |||||
737 | os.unlink(self.join(p)) |
|
737 | os.unlink(self.join(p)) | |
738 |
|
738 | |||
739 | if numrevs: |
|
739 | if numrevs: | |
|
740 | qfinished = self.applied[:numrevs] | |||
740 | del self.applied[:numrevs] |
|
741 | del self.applied[:numrevs] | |
741 | self.applied_dirty = 1 |
|
742 | self.applied_dirty = 1 | |
742 |
|
743 | |||
743 | for i in sorted([self.find_series(p) for p in patches], reverse=True): |
|
744 | unknown = [] | |
744 | del self.full_series[i] |
|
745 | ||
|
746 | for (i, p) in sorted([(self.find_series(p), p) for p in patches], | |||
|
747 | reverse=True): | |||
|
748 | if i is not None: | |||
|
749 | del self.full_series[i] | |||
|
750 | else: | |||
|
751 | unknown.append(p) | |||
|
752 | ||||
|
753 | if unknown: | |||
|
754 | if numrevs: | |||
|
755 | rev = dict((entry.name, entry.node) for entry in qfinished) | |||
|
756 | for p in unknown: | |||
|
757 | msg = _('revision %s refers to unknown patches: %s\n') | |||
|
758 | self.ui.warn(msg % (short(rev[p]), p)) | |||
|
759 | else: | |||
|
760 | msg = _('unknown patches: %s\n') | |||
|
761 | raise util.Abort(''.join(msg % p for p in unknown)) | |||
|
762 | ||||
745 | self.parse_series() |
|
763 | self.parse_series() | |
746 | self.series_dirty = 1 |
|
764 | self.series_dirty = 1 | |
747 |
|
765 |
@@ -162,3 +162,33 b' qdel -k X && hg qimp -e X used to trigge' | |||||
162 | adding 3.diff to series file |
|
162 | adding 3.diff to series file | |
163 | $ hg qfinish -a |
|
163 | $ hg qfinish -a | |
164 | no patches applied |
|
164 | no patches applied | |
|
165 | ||||
|
166 | ||||
|
167 | resilience to inconsistency: qfinish -a with applied patches not in series | |||
|
168 | ||||
|
169 | $ hg qser | |||
|
170 | 3.diff | |||
|
171 | $ hg qapplied | |||
|
172 | $ hg qpush | |||
|
173 | applying 3.diff | |||
|
174 | patch 3.diff is empty | |||
|
175 | now at: 3.diff | |||
|
176 | $ echo next >> base | |||
|
177 | $ hg qrefresh -d '1 0' | |||
|
178 | $ echo > .hg/patches/series # remove 3.diff from series to confuse mq | |||
|
179 | $ hg qfinish -a | |||
|
180 | revision c4dd2b624061 refers to unknown patches: 3.diff | |||
|
181 | ||||
|
182 | more complex state 'both known and unknown patches | |||
|
183 | ||||
|
184 | $ echo hip >> base | |||
|
185 | $ hg qnew -f -d '1 0' -m 4 4.diff | |||
|
186 | $ echo hop >> base | |||
|
187 | $ hg qnew -f -d '1 0' -m 5 5.diff | |||
|
188 | $ echo > .hg/patches/series # remove 4.diff and 5.diff from series to confuse mq | |||
|
189 | $ echo hup >> base | |||
|
190 | $ hg qnew -f -d '1 0' -m 6 6.diff | |||
|
191 | $ hg qfinish -a | |||
|
192 | revision 6fdec4b20ec3 refers to unknown patches: 5.diff | |||
|
193 | revision 2ba51db7ba24 refers to unknown patches: 4.diff | |||
|
194 |
General Comments 0
You need to be logged in to leave comments.
Login now