Show More
@@ -506,20 +506,27 b' class queue:' | |||
|
506 | 506 | tr.close() |
|
507 | 507 | return (err, n) |
|
508 | 508 | |
|
509 | def delete(self, repo, patch, keep=False): | |
|
509 | def delete(self, repo, patches, keep=False): | |
|
510 | realpatches = [] | |
|
511 | for patch in patches: | |
|
510 | 512 | patch = self.lookup(patch, strict=True) |
|
511 | 513 | info = self.isapplied(patch) |
|
512 | 514 | if info: |
|
513 | 515 | raise util.Abort(_("cannot delete applied patch %s") % patch) |
|
514 | 516 | if patch not in self.series: |
|
515 | 517 | raise util.Abort(_("patch %s not in series file") % patch) |
|
518 | realpatches.append(patch) | |
|
519 | ||
|
516 | 520 | if not keep: |
|
517 | 521 | r = self.qrepo() |
|
518 | 522 | if r: |
|
519 |
r.remove( |
|
|
523 | r.remove(realpatches, True) | |
|
520 | 524 | else: |
|
521 | 525 | os.unlink(self.join(patch)) |
|
522 | i = self.find_series(patch) | |
|
526 | ||
|
527 | indices = [self.find_series(p) for p in realpatches] | |
|
528 | indices.sort() | |
|
529 | for i in indices[-1::-1]: | |
|
523 | 530 | del self.full_series[i] |
|
524 | 531 | self.parse_series() |
|
525 | 532 | self.series_dirty = 1 |
@@ -1300,13 +1307,13 b' class queue:' | |||
|
1300 | 1307 | if qrepo: |
|
1301 | 1308 | qrepo.add(added) |
|
1302 | 1309 | |
|
1303 | def delete(ui, repo, patch, **opts): | |
|
1304 |
"""remove |
|
|
1310 | def delete(ui, repo, patch, *patches, **opts): | |
|
1311 | """remove patches from queue | |
|
1305 | 1312 | |
|
1306 | The patch must not be applied. | |
|
1307 |
With -k, the patch file |
|
|
1313 | The patches must not be applied. | |
|
1314 | With -k, the patch files are preserved in the patch directory.""" | |
|
1308 | 1315 | q = repo.mq |
|
1309 | q.delete(repo, patch, keep=opts.get('keep')) | |
|
1316 | q.delete(repo, (patch,) + patches, keep=opts.get('keep')) | |
|
1310 | 1317 | q.save_dirty() |
|
1311 | 1318 | return 0 |
|
1312 | 1319 |
General Comments 0
You need to be logged in to leave comments.
Login now