Clarify peeropts in hg.cone(...)?

Kevin Bullock kbullock+mercurial at ringworld.org
Mon Apr 8 16:38:10 UTC 2013


On Apr 7, 2013, at 10:48 PM, John Wong wrote:

> Hi,
> 
> I asked this on IRC but I was told I would get better answer via the mailing list. Thanks.
> 
> clone(ui, peeropts, source, dest=None, pull=False, rev=None, update=True, stream=False, branch=None)
> 
> But I don't see peeropts mentioned in the docstring. I figured out by reading the source code carefully.

The first question is: why does it matter to you? Mercurial's documented, stable API is its command-line interface. Its internals are subject to change between versions, and we do not list these changes in release notes. See also <http://mercurial.selenic.com/wiki/MercurialApi>, particularly everything thru section 1.

That being said, the best place to start when reading the source to figure out how a command works is mercurial/commands.py.

> I am guessing the key 'ssh' you can pass in a string of all ssh commands.
> What's remotecmd then?

Both of these are command-line options documented in `hg help clone`.

> I also see "peer" being used extensively throughout the codebase. What exactly is it?

Essentially, it's a class that encapsulates the interface of a "remote repo", regardless of how we're talking to that repo (local filesystem, HTTP, SSH).

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock




More information about the Mercurial mailing list