Mercurial > hg-stable
view tests/test-diff-subdir.t @ 36884:ccb70a77f746
hgweb: refactor 304 handling code
We had generic code in wsgirequest for handling HTTP 304 responses.
We also had a special case for it in the catch all exception handler
in the WSGI application.
We only ever raise 304 in one place. So, we don't need to treat it
specially in the catch all exception handler.
But it is useful to validate behavior of 304 responses. We port the
code that sends a 304 to use the new response API. We then move the
code for screening 304 sanity into the new response API.
As part of doing so, we discovered that we would send
Content-Length: 0. This is not allowed. So, we fix our response code
to not emit that header for empty response bodies.
Differential Revision: https://phab.mercurial-scm.org/D2794
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sat, 10 Mar 2018 18:42:00 -0800 |
parents | 16961d43dc89 |
children |
line wrap: on
line source
$ hg init $ mkdir alpha $ touch alpha/one $ mkdir beta $ touch beta/two $ hg add alpha/one beta/two $ hg ci -m "start" $ echo 1 > alpha/one $ echo 2 > beta/two everything $ hg diff --nodates diff -r 7d5ef1aea329 alpha/one --- a/alpha/one +++ b/alpha/one @@ -0,0 +1,1 @@ +1 diff -r 7d5ef1aea329 beta/two --- a/beta/two +++ b/beta/two @@ -0,0 +1,1 @@ +2 beta only $ hg diff --nodates beta diff -r 7d5ef1aea329 beta/two --- a/beta/two +++ b/beta/two @@ -0,0 +1,1 @@ +2 inside beta $ cd beta $ hg diff --nodates . diff -r 7d5ef1aea329 beta/two --- a/beta/two +++ b/beta/two @@ -0,0 +1,1 @@ +2 relative to beta $ cd .. $ hg diff --nodates --root beta diff -r 7d5ef1aea329 two --- a/two +++ b/two @@ -0,0 +1,1 @@ +2 inside beta $ cd beta $ hg diff --nodates --root . diff -r 7d5ef1aea329 two --- a/two +++ b/two @@ -0,0 +1,1 @@ +2 $ cd ..