[PATCH 3 of 6] tests: store ETag when using --headeronly

Gregory Szorc gregory.szorc at gmail.com
Sat Apr 1 03:29:07 EDT 2017


# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1491031312 25200
#      Sat Apr 01 00:21:52 2017 -0700
# Node ID 4cec8e88d09775ee6478e307e9dde94af5b9fcfd
# Parent  d20811d936ba24bcfab04ed28d06365b52784ae6
tests: store ETag when using --headeronly

Previously, --headeronly would prevent --twice from working
because the ETag wasn't stored when --headeronly was used.
This feels like a bug. That feeling is reaffirmed by the fact
that this change doesn't regress any tests.

diff --git a/tests/get-with-headers.py b/tests/get-with-headers.py
--- a/tests/get-with-headers.py
+++ b/tests/get-with-headers.py
@@ -78,8 +78,8 @@ def request(host, path, show):
         else:
             sys.stdout.write(data)
 
-        if twice and response.getheader('ETag', None):
-            tag = response.getheader('ETag')
+    if twice and response.getheader('ETag', None):
+        tag = response.getheader('ETag')
 
     return response.status
 


More information about the Mercurial-devel mailing list