[PATCH 2 of 6] hg: add opts argument to clone for internal remoteui

Peter Arrenbrecht peter.arrenbrecht at gmail.com
Tue Jun 14 13:44:58 UTC 2011


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/hgext/mq.py b/hgext/mq.py
>> --- a/hgext/mq.py
>> +++ b/hgext/mq.py
>> @@ -2084,13 +2084,13 @@
>>          except error.RepoError:
>>              pass
>>      ui.note(_('cloning main repository\n'))
>> -    sr, dr = hg.clone(ui, sr.url(), dest,
>> +    sr, dr = hg.clone(ui, opts, sr.url(), dest,
>>                        pull=opts.get('pull'),
>>                        rev=destrev,
>>                        update=False,
>>                        stream=opts.get('uncompressed'))
>>      ui.note(_('cloning patch repository\n'))
>> -    hg.clone(ui, opts.get('patches') or patchdir(sr), patchdir(dr),
>> +    hg.clone(ui, opts, opts.get('patches') or patchdir(sr), patchdir(dr),
>>               pull=opts.get('pull'), update=not opts.get('noupdate'),
>>               stream=opts.get('uncompressed'))
>>      if dr.local():
>> diff --git a/mercurial/commands.py b/mercurial/commands.py
>> --- a/mercurial/commands.py
>> +++ b/mercurial/commands.py
>> @@ -1026,7 +1026,7 @@
>>      if opts.get('noupdate') and opts.get('updaterev'):
>>          raise util.Abort(_("cannot specify both --noupdate and --updaterev"))
>>
>> -    r = hg.clone(hg.remoteui(ui, opts), source, dest,
>> +    r = hg.clone(ui, opts, source, dest,
>>                   pull=opts.get('pull'),
>>                   stream=opts.get('uncompressed'),
>>                   rev=opts.get('rev'),
>> 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.
-parren



More information about the Mercurial-devel mailing list