Mercurial > public > mercurial-scm > hg-stable
diff mercurial/localrepo.py @ 9437:1c4e4004f3a6
Improve some docstrings relating to changegroups and prepush().
author | Greg Ward <greg-hg@gerg.ca> |
---|---|
date | Tue, 08 Sep 2009 17:58:59 -0400 |
parents | 6cfea6e4c892 |
children | 4c041f1ee1b4 02c43e8e0835 |
line wrap: on
line diff
--- a/mercurial/localrepo.py Wed Sep 09 11:12:36 2009 +0200 +++ b/mercurial/localrepo.py Tue Sep 08 17:58:59 2009 -0400 @@ -1457,6 +1457,12 @@ return self.push_addchangegroup(remote, force, revs) def prepush(self, remote, force, revs): + '''Analyze the local and remote repositories and determine which + changesets need to be pushed to the remote. Return a tuple + (changegroup, remoteheads). changegroup is a readable file-like + object whose read() returns successive changegroup chunks ready to + be sent over the wire. remoteheads is the list of remote heads. + ''' common = {} remote_heads = remote.heads() inc = self.findincoming(remote, common, remote_heads, force=force) @@ -1601,9 +1607,10 @@ self.ui.debug("%s\n" % hex(node)) def changegroupsubset(self, bases, heads, source, extranodes=None): - """This function generates a changegroup consisting of all the nodes - that are descendents of any of the bases, and ancestors of any of - the heads. + """Compute a changegroup consisting of all the nodes that are + descendents of any of the bases and ancestors of any of the heads. + Return a chunkbuffer object whose read() method will return + successive changegroup chunks. It is fairly complex as determining which filenodes and which manifest nodes need to be included for the changeset to be complete @@ -1902,8 +1909,9 @@ return self.changegroupsubset(basenodes, self.heads(), source) def _changegroup(self, common, source): - """Generate a changegroup of all nodes that we have that a recipient - doesn't. + """Compute the changegroup of all nodes that we have that a recipient + doesn't. Return a chunkbuffer object whose read() method will return + successive changegroup chunks. This is much easier than the previous function as we can assume that the recipient has any changenode we aren't sending them. @@ -1937,6 +1945,7 @@ return lookuprevlink def gengroup(): + '''yield a sequence of changegroup chunks (strings)''' # construct a list of all changed files changedfiles = set()