D1694: debugcommands: replace opts.get('foo') by opts['foo']

lothiraldan (Boris Feld) phabricator at mercurial-scm.org
Sat Dec 1 12:15:16 UTC 2018


lothiraldan added a comment.


  In https://phab.mercurial-scm.org/D1694#79416, @pulkit wrote:
  
  > In https://phab.mercurial-scm.org/D1694#29072, @yuja wrote:
  >
  > >   Sometimes we do the reverse change for ease of calling command function as a plain function.
  >
  >
  > Just for record, today I hit the problem where some command is using `opts['']` instead of `opts.get()` and I was calling command function as plain function leading me to KeyError.
  
  
  It would be nice to have some official API to call a command as a function. Such function would do the same processing as the dispatch logic to validate input and install default value.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1694

To: martinvonz, #hg-reviewers
Cc: lothiraldan, pulkit, durin42, yuja, mercurial-devel


More information about the Mercurial-devel mailing list