comparison hgext/mq.py @ 7772:88887054d277

fancyopts: Parse options that occur after arguments. This changes the behavior of qguard in the case of setting negative guards, as -- will now always be required. Fixes issue1402. Doc fixes for mq by mpm.
author Augie Fackler <durin42@gmail.com>
date Tue, 10 Feb 2009 13:26:00 -0600
parents dd08e1e0cea1
children 140429276b63
comparison
equal deleted inserted replaced
7771:09d0fe02988d 7772:88887054d277
1991 a negative guard ("-foo") is never pushed if the qselect command 1991 a negative guard ("-foo") is never pushed if the qselect command
1992 has activated it. 1992 has activated it.
1993 1993
1994 With no arguments, print the currently active guards. 1994 With no arguments, print the currently active guards.
1995 With arguments, set guards for the named patch. 1995 With arguments, set guards for the named patch.
1996 1996 NOTE: Specifying negative guards now requires '--'.
1997 To set a negative guard "-foo" on topmost patch ("--" is needed so
1998 hg will not interpret "-foo" as an option):
1999 hg qguard -- -foo
2000 1997
2001 To set guards on another patch: 1998 To set guards on another patch:
2002 hg qguard other.patch +2.6.17 -stable 1999 hg qguard -- other.patch +2.6.17 -stable
2003 ''' 2000 '''
2004 def status(idx): 2001 def status(idx):
2005 guards = q.series_guards[idx] or ['unguarded'] 2002 guards = q.series_guards[idx] or ['unguarded']
2006 ui.write('%s: %s\n' % (q.series[idx], ' '.join(guards))) 2003 ui.write('%s: %s\n' % (q.series[idx], ' '.join(guards)))
2007 q = repo.mq 2004 q = repo.mq
2497 _('hg qgoto [OPTION]... PATCH')), 2494 _('hg qgoto [OPTION]... PATCH')),
2498 'qguard': 2495 'qguard':
2499 (guard, 2496 (guard,
2500 [('l', 'list', None, _('list all patches and guards')), 2497 [('l', 'list', None, _('list all patches and guards')),
2501 ('n', 'none', None, _('drop all guards'))], 2498 ('n', 'none', None, _('drop all guards'))],
2502 _('hg qguard [-l] [-n] [PATCH] [+GUARD]... [-GUARD]...')), 2499 _('hg qguard [-l] [-n] -- [PATCH] [+GUARD]... [-GUARD]...')),
2503 'qheader': (header, [], _('hg qheader [PATCH]')), 2500 'qheader': (header, [], _('hg qheader [PATCH]')),
2504 "^qimport": 2501 "^qimport":
2505 (qimport, 2502 (qimport,
2506 [('e', 'existing', None, _('import file in patch dir')), 2503 [('e', 'existing', None, _('import file in patch dir')),
2507 ('n', 'name', '', _('patch file name')), 2504 ('n', 'name', '', _('patch file name')),