lfs: strip the response headers from the Batch API before printing
authorMatt Harbison <matt_harbison@yahoo.com>
Sun, 27 Jan 2019 20:50:52 -0500
changeset 41453 0b636d1720a0
parent 41452 52a4a3e7cc6a
child 41454 080a5c83914f
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.
hgext/lfs/blobstore.py
--- a/hgext/lfs/blobstore.py	Sun Jan 27 18:34:17 2019 -0500
+++ b/hgext/lfs/blobstore.py	Sun Jan 27 20:50:52 2019 -0500
@@ -329,7 +329,7 @@
         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 @@
                     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())))