# HG changeset patch
# User FUJIWARA Katsunori <fo...@lares.dti.ne.jp>
# Date 1490575476 -32400
#      Mon Mar 27 09:44:36 2017 +0900
# Node ID b80768388eb2700a619159447461063983dd5806
# Parent  a26720a7404871d286ac4070710022b448572cb2
largefiles: use strip() instead of slicing to get rid of EOL of standin

This slicing prevents from replacing SHA-1 by another (= longer hash
value) in the future.

diff --git a/hgext/largefiles/basestore.py b/hgext/largefiles/basestore.py
--- a/hgext/largefiles/basestore.py
+++ b/hgext/largefiles/basestore.py
@@ -130,7 +130,7 @@ class basestore(object):
                     key = (filename, fctx.filenode())
                     if key not in verified:
                         verified.add(key)
-                        expectedhash = fctx.data()[0:40]
+                        expectedhash = fctx.data().strip()
                         filestocheck.append((cset, filename, expectedhash))
 
         failed = self._verifyfiles(contents, filestocheck)
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to