diff mercurial/changegroup.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 f48454a279b9
children 25e572394f5c
line wrap: on
line diff
--- a/mercurial/changegroup.py	Wed Sep 09 11:12:36 2009 +0200
+++ b/mercurial/changegroup.py	Tue Sep 08 17:58:59 2009 -0400
@@ -10,7 +10,7 @@
 import struct, os, bz2, zlib, tempfile
 
 def getchunk(source):
-    """get a chunk from a changegroup"""
+    """return the next chunk from changegroup 'source' as a string"""
     d = source.read(4)
     if not d:
         return ""
@@ -25,7 +25,8 @@
     return d
 
 def chunkiter(source):
-    """iterate through the chunks in source"""
+    """iterate through the chunks in source, yielding a sequence of chunks
+    (strings)"""
     while 1:
         c = getchunk(source)
         if not c:
@@ -33,10 +34,11 @@
         yield c
 
 def chunkheader(length):
-    """build a changegroup chunk header"""
+    """return a changegroup chunk header (string)"""
     return struct.pack(">l", length + 4)
 
 def closechunk():
+    """return a changegroup chunk header (string) for a zero-length chunk"""
     return struct.pack(">l", 0)
 
 class nocompress(object):