From patchwork Mon Mar 27 01:53:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [7, of, 8] largefiles: use strip() instead of slicing to get rid of EOL of standin From: Katsunori FUJIWARA X-Patchwork-Id: 19728 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Mon, 27 Mar 2017 10:53:47 +0900 # HG changeset patch # User FUJIWARA Katsunori # 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)