diff hgext/largefiles/proto.py @ 28576:33bd95443e7f

largefiles: add some docstrings
author Mads Kiilerich <madski@unity3d.com>
date Sat, 19 Mar 2016 08:28:24 -0700
parents 78539633acf3
children 032c4c2f802a
line wrap: on
line diff
--- a/hgext/largefiles/proto.py	Sat Mar 19 08:27:54 2016 -0700
+++ b/hgext/largefiles/proto.py	Sat Mar 19 08:28:24 2016 -0700
@@ -22,8 +22,8 @@
 httpoldcallstream = None
 
 def putlfile(repo, proto, sha):
-    '''Put a largefile into a repository's local store and into the
-    user cache.'''
+    '''Server command for putting a largefile into a repository's local store
+    and into the user cache.'''
     proto.redirect()
 
     path = lfutil.storepath(repo, sha)
@@ -47,8 +47,8 @@
     return wireproto.pushres(0)
 
 def getlfile(repo, proto, sha):
-    '''Retrieve a largefile from the repository-local cache or system
-    cache.'''
+    '''Server command for retrieving a largefile from the repository-local
+    cache or user cache.'''
     filename = lfutil.findfile(repo, sha)
     if not filename:
         raise error.Abort(_('requested largefile %s not present in cache')
@@ -68,8 +68,8 @@
     return wireproto.streamres(generator())
 
 def statlfile(repo, proto, sha):
-    '''Return '2\n' if the largefile is missing, '0\n' if it seems to be in
-    good condition.
+    '''Server command for checking if a largefile is present - returns '2\n' if
+    the largefile is missing, '0\n' if it seems to be in good condition.
 
     The value 1 is reserved for mismatched checksum, but that is too expensive
     to be verified on every stat and must be caught be running 'hg verify'
@@ -151,9 +151,12 @@
 
 # advertise the largefiles=serve capability
 def capabilities(repo, proto):
+    '''Wrap server command to announce largefile server capability'''
     return capabilitiesorig(repo, proto) + ' largefiles=serve'
 
 def heads(repo, proto):
+    '''Wrap server command - largefile capable clients will know to call
+    lheads instead'''
     if lfutil.islfilesrepo(repo):
         return wireproto.ooberror(LARGEFILES_REQUIRED_MSG)
     return wireproto.heads(repo, proto)