hgext/mq.py
changeset 10359 ec02cf8d1628
parent 10282 08a0f04b56bd
child 10360 bcf90e712dc3
equal deleted inserted replaced
10358:d42821cd5c96 10359:ec02cf8d1628
  2605         and not kwargs.get('no_commit', False)):
  2605         and not kwargs.get('no_commit', False)):
  2606         repo.abort_if_wdir_patched(_('cannot import over an applied patch'),
  2606         repo.abort_if_wdir_patched(_('cannot import over an applied patch'),
  2607                                    kwargs.get('force'))
  2607                                    kwargs.get('force'))
  2608     return orig(ui, repo, *args, **kwargs)
  2608     return orig(ui, repo, *args, **kwargs)
  2609 
  2609 
       
  2610 def mqcommand(orig, ui, repo, *args, **kwargs):
       
  2611     """Add --mq option to operate on patch repository instead of main"""
       
  2612 
       
  2613     # some commands do not like getting unknown options
       
  2614     mq = kwargs['mq']
       
  2615     del kwargs['mq']
       
  2616 
       
  2617     if not mq:
       
  2618         return orig(ui, repo, *args, **kwargs)
       
  2619 
       
  2620     q = repo.mq
       
  2621     r = q.qrepo()
       
  2622     if not r:
       
  2623         raise util.Abort('no queue repository')
       
  2624     return orig(ui, r, *args, **kwargs)
       
  2625 
  2610 def uisetup(ui):
  2626 def uisetup(ui):
  2611     extensions.wrapcommand(commands.table, 'import', mqimport)
  2627     extensions.wrapcommand(commands.table, 'import', mqimport)
       
  2628     for cmd in ('commit', 'export', 'incoming', 'log', 'outgoing', 'pull',
       
  2629                 'push', 'status', 'tag', 'tags', 'tip', 'update'):
       
  2630         entry = extensions.wrapcommand(commands.table, cmd, mqcommand)
       
  2631         entry[1].extend([('Q', 'mq', None, _("operate on patch repository"))])
  2612 
  2632 
  2613 seriesopts = [('s', 'summary', None, _('print first line of patch header'))]
  2633 seriesopts = [('s', 'summary', None, _('print first line of patch header'))]
  2614 
  2634 
  2615 cmdtable = {
  2635 cmdtable = {
  2616     "qapplied":
  2636     "qapplied":