Mercurial > public > mercurial-scm > hg
diff hgext/largefiles/lfutil.py @ 18999:c1b5f9c4d989
largefiles: refactoring - return hex from _getfile and copyandhash
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Mon, 15 Apr 2013 23:35:18 +0200 |
parents | d035c3902111 |
children | 2a35296a6304 |
line wrap: on
line diff
--- a/hgext/largefiles/lfutil.py Mon Apr 15 23:32:33 2013 +0200 +++ b/hgext/largefiles/lfutil.py Mon Apr 15 23:35:18 2013 +0200 @@ -290,7 +290,7 @@ def copyandhash(instream, outfile): '''Read bytes from instream (iterable) and write them to outfile, computing the SHA-1 hash of the data along the way. Close outfile - when done and return the binary hash.''' + when done and return the hash.''' hasher = util.sha1('') for data in instream: hasher.update(data) @@ -301,7 +301,7 @@ # outfile was opened just to copy and hash. outfile.close() - return hasher.digest() + return hasher.hexdigest() def hashrepofile(repo, file): return hashfile(repo.wjoin(file))