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

login
register
mail settings
Submitter Gregory Szorc
Date April 1, 2017, 7:29 a.m.
Message ID <4cec8e88d09775ee6478.1491031747@ubuntu-vm-main>
Download mbox | patch
Permalink /patch/19889/
State Accepted
Headers show

Comments

Gregory Szorc - April 1, 2017, 7:29 a.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@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.
Augie Fackler - April 3, 2017, 7:42 p.m.
On Sat, Apr 01, 2017 at 12:29:07AM -0700, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc@gmail.com>
> # Date 1491031312 25200
> #      Sat Apr 01 00:21:52 2017 -0700
> # Node ID 4cec8e88d09775ee6478e307e9dde94af5b9fcfd
> # Parent  d20811d936ba24bcfab04ed28d06365b52784ae6
> tests: store ETag when using --headeronly

Took patches 1-3. 4 feels like its only plausible consumer is 5, and I
want others to think about patch 5 some. I'll send some comments there
as well.

>
> 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
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

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