hgext3rd/evolve/__init__.py
changeset 4749 cdafbd01d0bf
parent 4747 fa6aafa2857d
child 4761 2c3fd1bb2752
equal deleted inserted replaced
4748:d04be27dcce9 4749:cdafbd01d0bf
   427         for cmd in evolvecommands:
   427         for cmd in evolvecommands:
   428             matchingevolvecommands = [e for e in cmdtable.keys() if cmd in e]
   428             matchingevolvecommands = [e for e in cmdtable.keys() if cmd in e]
   429             if not matchingevolvecommands:
   429             if not matchingevolvecommands:
   430                 raise error.Abort(_('unknown command: %s') % cmd)
   430                 raise error.Abort(_('unknown command: %s') % cmd)
   431             elif len(matchingevolvecommands) > 1:
   431             elif len(matchingevolvecommands) > 1:
   432                 msg = _('ambiguous command specification: "%s" matches %r')
   432                 matchstr = ', '.join(matchingevolvecommands)
   433                 raise error.Abort(msg % (cmd, matchingevolvecommands))
   433                 msg = _("ambiguous command specification: '%s' matches [%s]")
       
   434                 raise error.Abort(msg % (cmd, matchstr))
   434             else:
   435             else:
   435                 whitelist.add(matchingevolvecommands[0])
   436                 whitelist.add(matchingevolvecommands[0])
   436         for disabledcmd in set(cmdtable) - whitelist:
   437         for disabledcmd in set(cmdtable) - whitelist:
   437             del cmdtable[disabledcmd]
   438             del cmdtable[disabledcmd]
   438 
   439