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

Matt Harbison mharbison72 at gmail.com
Mon Jan 28 00:20:55 EST 2019


# HG changeset patch
# User Matt Harbison <matt_harbison at 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.

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())))
 


More information about the Mercurial-devel mailing list