2.3 upgrade notes: remote repository API

Matt Mackall mpm at selenic.com
Mon Sep 17 13:36:24 CDT 2012


On Mon, 2012-09-17 at 10:10 +0200, Dirkjan Ochtman wrote:
> I have some scripts at work that help make backups of Mercurial
> repositories. I was using mercurial.hg.repository(ui, url) to get a
> remote (HTTP, in this case) repository. In 2.3+, this is apparently no
> longer allowed, but the alternative mercurial.hg.peer(uiorrepo, opts,
> path) requires the additional opts (which seems to be a bit of a
> kludge to help me pass in a dict with ssh/remotecmd configuration).

It isn't, insofar as we will always want the ability to pass remote
connection options when creating a remote peer.

> There's also a _peerorrepo() function in mercurial.hg that seems
> attractive from where I sit, but is supposedly even more volatile than
> the rest of the API, since it's underscore-prefixed.

Yep.

>  So:
> 
> - Perhaps add an UpgradeNote about this issue?

http://mercurial.selenic.com/wiki/MercurialApi#Why_you_shouldn.27t_use_Mercurial.27s_internal_API

..more or less sums up why this is out of scope for UpgradeNotes.

I think the next step I'm going to take is to start actively denying the
import of Mercurial modules unless you set:

iacknowledgethatmercurialisnotalibraryandishouldntdependonitsinternals =
True

That said, we do have a place for such notes:

http://mercurial.selenic.com/wiki/ApiChanges

> - Would it make sense to unprefix _peerorrepo() in 2.4?

Nope. It's transitional.

> - Some docstring about what opts should be would help.

Sure.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list