hgext/mq.py
changeset 4737 2ececafa5859
parent 4736 04b2c1e27c26
child 4852 cba10652a901
child 4911 fc502517d68d
equal deleted inserted replaced
4736:04b2c1e27c26 4737:2ececafa5859
   531         self.removeundo(repo)
   531         self.removeundo(repo)
   532         return (err, n)
   532         return (err, n)
   533 
   533 
   534     def delete(self, repo, patches, opts):
   534     def delete(self, repo, patches, opts):
   535         if not patches and not opts.get('rev'):
   535         if not patches and not opts.get('rev'):
   536             raise util.Abort(_('missing patch name'))
   536             raise util.Abort(_('qdelete requires at least one revision or '
       
   537                                'patch name'))
   537 
   538 
   538         realpatches = []
   539         realpatches = []
   539         for patch in patches:
   540         for patch in patches:
   540             patch = self.lookup(patch, strict=True)
   541             patch = self.lookup(patch, strict=True)
   541             info = self.isapplied(patch)
   542             info = self.isapplied(patch)
  1381             qrepo.add(added)
  1382             qrepo.add(added)
  1382 
  1383 
  1383 def delete(ui, repo, *patches, **opts):
  1384 def delete(ui, repo, *patches, **opts):
  1384     """remove patches from queue
  1385     """remove patches from queue
  1385 
  1386 
  1386     With --rev, mq will stop managing the named revisions. The
  1387     The patches must not be applied, unless they are arguments to
  1387     patches must be applied and at the base of the stack. This option
  1388     the --rev parameter. At least one patch or revision is required.
  1388     is useful when the patches have been applied upstream.
  1389 
  1389 
  1390     With --rev, mq will stop managing the named revisions (converting
  1390     Otherwise, the patches must not be applied.
  1391     them to regular mercurial changesets). The patches must be applied
       
  1392     and at the base of the stack. This option is useful when the patches
       
  1393     have been applied upstream.
  1391 
  1394 
  1392     With --keep, the patch files are preserved in the patch directory."""
  1395     With --keep, the patch files are preserved in the patch directory."""
  1393     q = repo.mq
  1396     q = repo.mq
  1394     q.delete(repo, patches, opts)
  1397     q.delete(repo, patches, opts)
  1395     q.save_dirty()
  1398     q.save_dirty()
  2107          _('hg qdiff [-I] [-X] [-g] [FILE]...')),
  2110          _('hg qdiff [-I] [-X] [-g] [FILE]...')),
  2108     "qdelete|qremove|qrm":
  2111     "qdelete|qremove|qrm":
  2109         (delete,
  2112         (delete,
  2110          [('k', 'keep', None, _('keep patch file')),
  2113          [('k', 'keep', None, _('keep patch file')),
  2111           ('r', 'rev', [], _('stop managing a revision'))],
  2114           ('r', 'rev', [], _('stop managing a revision'))],
  2112          _('hg qdelete [-k] [-r REV]... PATCH...')),
  2115          _('hg qdelete [-k] [-r REV]... [PATCH]...')),
  2113     'qfold':
  2116     'qfold':
  2114         (fold,
  2117         (fold,
  2115          [('e', 'edit', None, _('edit patch header')),
  2118          [('e', 'edit', None, _('edit patch header')),
  2116           ('k', 'keep', None, _('keep folded patch files')),
  2119           ('k', 'keep', None, _('keep folded patch files')),
  2117          ] + commands.commitopts,
  2120          ] + commands.commitopts,