##// END OF EJS Templates
shelve: refactor allowables to specify sets of valid operations...
Tony Tung -
r25103:ce00b2e9 default
parent child Browse files
Show More
@@ -691,21 +691,21 def shelvecmd(ui, repo, *pats, **opts):
691 cmdutil.checkunfinished(repo)
691 cmdutil.checkunfinished(repo)
692
692
693 allowables = [
693 allowables = [
694 ('addremove', 'create'), # 'create' is pseudo action
694 ('addremove', set(['create'])), # 'create' is pseudo action
695 ('cleanup', 'cleanup'),
695 ('cleanup', set(['cleanup'])),
696 # ('date', 'create'), # ignored for passing '--date "0 0"' in tests
696 # ('date', set(['create'])), # ignored for passing '--date "0 0"' in tests
697 ('delete', 'delete'),
697 ('delete', set(['delete'])),
698 ('edit', 'create'),
698 ('edit', set(['create'])),
699 ('list', 'list'),
699 ('list', set(['list'])),
700 ('message', 'create'),
700 ('message', set(['create'])),
701 ('name', 'create'),
701 ('name', set(['create'])),
702 ('patch', 'list'),
702 ('patch', set(['list'])),
703 ('stat', 'list'),
703 ('stat', set(['list'])),
704 ]
704 ]
705 def checkopt(opt):
705 def checkopt(opt):
706 if opts[opt]:
706 if opts[opt]:
707 for i, allowable in allowables:
707 for i, allowable in allowables:
708 if opts[i] and opt != allowable:
708 if opts[i] and opt not in allowable:
709 raise util.Abort(_("options '--%s' and '--%s' may not be "
709 raise util.Abort(_("options '--%s' and '--%s' may not be "
710 "used together") % (opt, i))
710 "used together") % (opt, i))
711 return True
711 return True
General Comments 0
You need to be logged in to leave comments. Login now