Patchwork store: add comment in _hashencode with reason for skipping the first 5 chars

login
register
mail settings
Submitter Adrian Buehlmann
Date May 13, 2015, 6:43 p.m.
Message ID <27ba2f5ec24f4aca6554.1431542596@kork>
Download mbox | patch
Permalink /patch/9059/
State Accepted
Headers show

Comments

Adrian Buehlmann - May 13, 2015, 6:43 p.m.
# HG changeset patch
# User Adrian Buehlmann <adrian@cadifra.com>
# Date 1431542216 -7200
# Node ID 27ba2f5ec24f4aca655433eb7185a9aa12e4c575
# Parent  297ea0df75d0f7ab552fc8986d04c8196de8d9dd
store: add comment in _hashencode with reason for skipping the first 5 chars
Pierre-Yves David - May 13, 2015, 11:33 p.m.
On 05/13/2015 11:43 AM, Adrian Buehlmann wrote:
> # HG changeset patch
> # User Adrian Buehlmann <adrian@cadifra.com>
> # Date 1431542216 -7200
> # Node ID 27ba2f5ec24f4aca655433eb7185a9aa12e4c575
> # Parent  297ea0df75d0f7ab552fc8986d04c8196de8d9dd
> store: add comment in _hashencode with reason for skipping the first 5 chars

Sure.
Pushed to the clowncopter.
Thanks.

Patch

diff --git a/mercurial/store.py b/mercurial/store.py
--- a/mercurial/store.py
+++ b/mercurial/store.py
@@ -187,7 +187,7 @@ 
 
 def _hashencode(path, dotencode):
     digest = _sha(path).hexdigest()
-    le = lowerencode(path[5:]).split('/')
+    le = lowerencode(path[5:]).split('/') # skips prefix 'data/'
     parts = _auxencode(le, dotencode)
     basename = parts[-1]
     _root, ext = os.path.splitext(basename)