diff mercurial/util.py @ 15392:d7bfbc92a1c0 stable

util: add a doctest for empty sha() calls
author Matt Mackall <mpm@selenic.com>
date Mon, 31 Oct 2011 15:41:39 -0500
parents fffe49886a51
children de7e2fba4326 6eff984d8e76
line wrap: on
line diff
--- a/mercurial/util.py	Thu Oct 20 17:24:59 2011 -0400
+++ b/mercurial/util.py	Mon Oct 31 15:41:39 2011 -0500
@@ -74,6 +74,16 @@
 # Python compatibility
 
 def sha1(s=''):
+    '''
+    Low-overhead wrapper around Python's SHA support
+
+    >>> f = _fastsha1
+    >>> a = sha1()
+    >>> a = f()
+    >>> a.hexdigest()
+    'da39a3ee5e6b4b0d3255bfef95601890afd80709'
+    '''
+
     return _fastsha1(s)
 
 _notset = object()