Patchwork [09,of,11] lfs: strip the response headers from the Batch API before printing

login
register
mail settings
Submitter Matt Harbison
Date Jan. 28, 2019, 5:20 a.m.
Message ID <fa54bec6b7c74114cfe1.1548652855@Envy>
Download mbox | patch
Permalink /patch/38135/
State Accepted
Headers show

Comments

Matt Harbison - Jan. 28, 2019, 5:20 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1548640252 18000
#      Sun Jan 27 20:50:52 2019 -0500
# Node ID fa54bec6b7c74114cfe1d59abdf429fff5c3dd22
# Parent  2db104a67b26ee9ff2f2b9ba8bb98d52bada7bb9
lfs: strip the response headers from the Batch API before printing

For reasons unknown, py3 is adding an extra '\n' before the headers print out.
This makes the output the same as py2.

Patch

diff --git a/hgext/lfs/blobstore.py b/hgext/lfs/blobstore.py
--- a/hgext/lfs/blobstore.py
+++ b/hgext/lfs/blobstore.py
@@ -329,7 +329,7 @@  class _gitlfsremote(object):
         if self.ui.debugflag:
             self.ui.debug(b'Status: %d\n' % rsp.status)
             # lfs-test-server and hg serve return headers in different order
-            headers = pycompat.bytestr(rsp.info())
+            headers = pycompat.bytestr(rsp.info()).strip()
             self.ui.debug(b'%s\n'
                           % b'\n'.join(sorted(headers.splitlines())))
 
@@ -440,7 +440,7 @@  class _gitlfsremote(object):
                     ui.debug(b'Status: %d\n' % req.status)
                     # lfs-test-server and hg serve return headers in different
                     # order
-                    headers = pycompat.bytestr(req.info())
+                    headers = pycompat.bytestr(req.info()).strip()
                     ui.debug(b'%s\n'
                              % b'\n'.join(sorted(headers.splitlines())))