Commit Graph

15 Commits

Author SHA1 Message Date
Augie Fackler
9f876f6c89 cleanup: move stdlib imports to their own import statement
There are a few warnings still produced by my import checker, but
those are false positives produced by modules that share a name with
stdlib modules.
2013-11-06 16:48:06 -05:00
Mads Kiilerich
520076e707 delete some dead comments and docstrings 2012-08-21 02:41:20 +02:00
Mads Kiilerich
2f4504e446 fix trivial spelling errors 2012-08-15 22:38:42 +02:00
Pierre-Yves David
ae5abd69f4 localpeer: return only visible heads and branchmap
Now that we have localpeer, we can apply filtering on heads and branchmap the
same way it's done for wireprotocol peer.
2012-07-17 01:04:45 +02:00
Sune Foldager
ffe56435bf peer: introduce peer methods to prepare for peer classes
This introduces a peer method into all repository classes, which currently
simply returns self. It also changes hg.repository so it now raises an
exception if the supplied paths does not resolve to a localrepo or descendant.

Finally, all call sites are changed to use the peer and local methods as
appropriate, where peer is used whenever the code is dealing with a remote
repository (even if it's on local disk).
2012-07-13 21:46:53 +02:00
Bryan O'Sullivan
abdf4a8227 util: subclass deque for Python 2.4 backwards compatibility
It turns out that Python 2.4's deque type is lacking a remove method.
We can't implement remove in terms of find, because it doesn't have
find either.
2012-06-01 17:05:31 -07:00
Brodie Rao
d6a6abf2b0 cleanup: eradicate long lines 2012-05-12 15:54:54 +02:00
Pierre-Yves David
8abd0aa7c9 phases: do not exchange secret changesets
Any secret changesets will be excluded from pull and push. Phase data are
properly synchronized on pull and push if a changeset is seen as secret locally
but is non-secret remote side.

This patch does not handle the case of a changeset secret on remote but known
locally.
2011-12-22 00:42:25 +01:00
Mads Kiilerich
065de91b14 add missing localization markup 2011-11-11 01:07:10 +01:00
Peter Arrenbrecht
83352215f8 setdiscovery: fix hang when #heads>200 (issue2971)
When setting up the next sample, we always add all of the heads, regardless
of the desired max sample size. But if the number of heads exceeds this
size, then we don't add any more nodes from the still undecided set.
(This is debatable per se, and I'll investigate it, but it's how we designed
it at the moment.)

The bug was that we always added the overall heads, not the heads of the
remaining undecided set. Thus, if #heads>200 (desired sample size), we
did not make progress any longer.
2011-08-25 21:25:14 +02:00
Andrew Pritchard
f23118834a setdiscovery: return anyincoming=False when remote's only head is nullid
This fixes (issue2907) a crash when using 'hg incoming --bundle' with an empty
remote repo and a non-empty local repo.

This also fixes an unreported bug that 'hg summary --remote' erroneously
reports incoming changes when the remote repo is empty and the local is not.

Also, add a test to make sure issue2907 stays fixed
2011-07-27 18:32:54 -04:00
Matt Mackall
b06b887ee8 discovery: quiet note about heads
This was changing output on in/out -v for no good reason.
2011-07-05 14:30:42 -05:00
Peter Arrenbrecht
9a2d2f747c setdiscovery: batch heads and known(ownheads)
This means that we now discover both subset conditions (local<remote and
remote<local) in a single roundtrip without ever constructing an actual
sample (which takes a bit of client CPU).
2011-06-14 22:58:00 +02:00
Steven Brown
411d547af4 setdiscovery: limit lines to 80 characters 2011-05-05 23:21:37 +08:00
Peter Arrenbrecht
75fa0e5ea9 discovery: add new set-based discovery
Adds a new discovery method based on repeatedly sampling the still
undecided subset of the local node graph to determine the set of nodes
common to both the client and the server.

For small differences between client and server, it uses about the same
or slightly fewer roundtrips than the old tree-based discovery. For
larger differences, it typically reduces the number of roundtrips
drastically (from 150 to 4, for instance).

The old discovery code now lives in treediscovery.py, the new code is
in setdiscovery.py.

Still missing is a hook for extensions to contribute nodes to the
initial sample. For instance, Augie's remotebranches could contribute
the last known state of the server's heads.

Credits for the actual sampler and computing common heads instead of
bases go to Benoit Boissinot.
2011-05-02 19:21:30 +02:00