[PATCH 2 of 6] hg: add opts argument to clone for internal remoteui
Martin Geisler
mg at aragost.com
Tue Jun 14 08:56:59 CDT 2011
Peter Arrenbrecht <peter.arrenbrecht at gmail.com> writes:
> On Tue, Jun 14, 2011 at 2:46 PM, Martin Geisler <mg at aragost.com> wrote:
>> Peter Arrenbrecht <peter.arrenbrecht at gmail.com> writes:
>>
>>> # HG changeset patch
>>> # User Peter Arrenbrecht <peter.arrenbrecht at gmail.com>
>>> # Date 1307550273 -7200
>>> hg: add opts argument to clone for internal remoteui
>>>
>>> diff --git a/mercurial/hg.py b/mercurial/hg.py
>>> --- a/mercurial/hg.py
>>> +++ b/mercurial/hg.py
>>> @@ -169,7 +169,7 @@
>>> continue
>>> _update(r, uprev)
>>>
>>> -def clone(ui, source, dest=None, pull=False, rev=None, update=True,
>>> +def clone(ui, opts, source, dest=None, pull=False, rev=None, update=True,
>>> stream=False, branch=None):
>>
>> Should the opts dict not replace the existing keyword arguments?
>>
>> From reading the patch, it seems that there is now an implicit
>> coupling between pull/opts['pull'] and update/opts['noupdate'].
>
> Where would this be? Seems to me that passing opts['pull'] or
> opts['noupdate'] to hg.clone has no effect.
Ehm, hg.clone takes a 'pull' and an 'update' argument and I suggest it
should take them from an opts dict. Like
def clone(ui, source, ..., **opts):
# extract old function arguments
update = not opts.get('noupdate')
pull = opts.get('pull')
...
Right now, the caller will specify both pull and have opts['pull'] set
to the same value (hopefully).
--
Martin Geisler
aragost Trifork
Professional Mercurial support
http://mercurial.aragost.com/kick-start/
More information about the Mercurial-devel
mailing list