[PATCH 1 of 2 V2] shelve: changes getting opts values by get method

Yuya Nishihara yuya at tcha.org
Sat Mar 5 00:38:48 EST 2016


On Tue, 01 Mar 2016 21:10:31 +0100, liscju wrote:
> # HG changeset patch
> # User liscju <piotr.listkiewicz at gmail.com>
> # Date 1456100939 -3600
> #      Mon Feb 22 01:28:59 2016 +0100
> # Node ID 46461ba496c9fd763f6e47217ba8b6de8b8ca1d1
> # Parent  c7f89ad87baef87f00c507545dfd4cc824bc3131
> shelve: changes getting opts values by get method

Could you describe why you need it. (I can get the reason from the next patch
right now, but it would be lost in future.)

> --- a/hgext/shelve.py	Mon Feb 29 17:52:17 2016 -0600
> +++ b/hgext/shelve.py	Mon Feb 22 01:28:59 2016 +0100
> @@ -269,10 +269,10 @@ def _docreatecmd(ui, repo, pats, opts):
>      else:
>          desc = '(changes in empty repository)'
>  
> -    if not opts['message']:
> +    if not opts.get('message', None):
>          opts['message'] = desc

dict.get('foo') returns None by default.


More information about the Mercurial-devel mailing list