[PATCH V2] templatefilters: inline hbisect.shortlabel()

2018-03-10 Thread Yuya Nishihara
# HG changeset patch # User Yuya Nishihara # Date 1520342101 21600 # Tue Mar 06 07:15:01 2018 -0600 # Node ID 7463bb17ee1a9a5cdc5dbbf6ec370e15dac5b20b # Parent 61f2121cac167752acc5014ac7f4c4da100a2097 templatefilters: inline hbisect.shortlabel() It's pretty simple. I don't

D2718: wireproto: declare permissions requirements in @wireprotocommand (API)

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg added inline comments. INLINE COMMENTS > yuja wrote in wireproto.py:711 > Perhaps ProgrammingError is preferred here because it shouldn't > be a user-facing error. I agree. I'll send a follow-up (unless we want to amend hg-committed). REPOSITORY rHG Mercurial REVISION DETAIL

D2734: hgweb: parse WSGI request into a data structure

2018-03-10 Thread yuja (Yuya Nishihara)
yuja added inline comments. INLINE COMMENTS > hgwebdir_mod.py:232 > def _runwsgi(self, wsgireq): > +req = requestmod.parserequestfromenv(wsgireq.env) > + We'll need something to silence pyflakes saying "local variable 'req' is assigned to but never used." > request.py:125 > +

D2057: rust implementation of hg status

2018-03-10 Thread yuja (Yuya Nishihara)
yuja added a comment. > I am looking at Mozilla's rust winapi bindings, let me see if I can directly wrap around winapi::um::fileapi::FindFirstFileA That's probably a hard way. I was thinking of

D2718: wireproto: declare permissions requirements in @wireprotocommand (API)

2018-03-10 Thread yuja (Yuya Nishihara)
yuja added inline comments. INLINE COMMENTS > wireproto.py:711 > +if permission not in ('push', 'pull'): > +raise error.Abort(_('invalid wire protocol permission; got %s; ' > +'expected "push" or "pull"') % permission) Perhaps ProgrammingError is

[PATCH 5 of 5] py3: fix slicing of bisect label in templatefilters.shortbisect()

2018-03-10 Thread Yuya Nishihara
# HG changeset patch # User Yuya Nishihara # Date 1520342201 21600 # Tue Mar 06 07:16:41 2018 -0600 # Node ID af33c19550e40f5b13088f1737d9781e07bca548 # Parent 50008d6c32bf2eba12b13bd2ed34149b653ef004 py3: fix slicing of bisect label in templatefilters.shortbisect() diff

[PATCH 2 of 5] py3: fix integer formatting in bisect error

2018-03-10 Thread Yuya Nishihara
# HG changeset patch # User Yuya Nishihara # Date 1520341850 21600 # Tue Mar 06 07:10:50 2018 -0600 # Node ID f4f4de07f3d1cd9c9bf3ca94adce78e8b4ae446e # Parent 7742cc1155b78a819ee1ecce7783c36bec42548e py3: fix integer formatting in bisect error diff --git

[PATCH 4 of 5] templatefilters: inline hbisect.shortlabel()

2018-03-10 Thread Yuya Nishihara
# HG changeset patch # User Yuya Nishihara # Date 1520342101 21600 # Tue Mar 06 07:15:01 2018 -0600 # Node ID 50008d6c32bf2eba12b13bd2ed34149b653ef004 # Parent 61f2121cac167752acc5014ac7f4c4da100a2097 templatefilters: inline hbisect.shortlabel() It's pretty simple. I don't

[PATCH 3 of 5] py3: make test-bisect.t bytes-safe

2018-03-10 Thread Yuya Nishihara
# HG changeset patch # User Yuya Nishihara # Date 1520341884 21600 # Tue Mar 06 07:11:24 2018 -0600 # Node ID 61f2121cac167752acc5014ac7f4c4da100a2097 # Parent f4f4de07f3d1cd9c9bf3ca94adce78e8b4ae446e py3: make test-bisect.t bytes-safe diff --git a/contrib/python3-whitelist

[PATCH 1 of 5] py3: silence f.write() in test-annotate.t

2018-03-10 Thread Yuya Nishihara
# HG changeset patch # User Yuya Nishihara # Date 1520668554 -32400 # Sat Mar 10 16:55:54 2018 +0900 # Node ID 7742cc1155b78a819ee1ecce7783c36bec42548e # Parent a20a3f5171d4eacc6a2f801f0ce39516fb9fd444 py3: silence f.write() in test-annotate.t diff --git

D2394: histedit: make histedit's commands accept revsets (issue5746)

2018-03-10 Thread pulkit (Pulkit Goyal)
pulkit added a comment. In https://phab.mercurial-scm.org/D2394#44294, @sangeet259 wrote: > @durin42 Should I make any changes? Yep, you should try fixing the failures you mentioned. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2394 To:

mercurial@36788: 2 new changesets

2018-03-10 Thread Mercurial Commits
2 new changesets in mercurial: https://www.mercurial-scm.org/repo/hg/rev/4397909f82d3 changeset: 36787:4397909f82d3 user:Tom Prince date:Sat Jan 20 02:41:10 2018 -0700 summary: phabricator: specify API tokens per host, rather than per repo

D2734: hgweb: parse WSGI request into a data structure

2018-03-10 Thread pulkit (Pulkit Goyal)
pulkit added inline comments. INLINE COMMENTS > request.py:14 > import socket > +#import wsgiref.validate > Chunk from your wip? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2734 To: indygreg, #hg-reviewers, durin42 Cc: pulkit, yuja, mercurial-devel

D2394: histedit: make histedit's commands accept revsets (issue5746)

2018-03-10 Thread sangeet259 (Sangeet Kumar Mishra)
sangeet259 added a comment. @pulkit It is not failing as of now. It's failing on the changes proposed by @durin42, which he assumed wont fail, but that's not the case! REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2394 To: sangeet259, durin42, #hg-reviewers

D2409: graft: add no-commit mode (issue5631)

2018-03-10 Thread pulkit (Pulkit Goyal)
pulkit added a comment. In https://phab.mercurial-scm.org/D2409#43891, @khanchi97 wrote: > pulkit: Can you please review it? I have made the requested changes. I am sorry but I will like this to wait before we land the new state format thing. I don't want to put more information

[PATCH 2 of 5] py3: drop b'' from debug message "moving bookmarks"

2018-03-10 Thread Yuya Nishihara
# HG changeset patch # User Yuya Nishihara # Date 1520342652 21600 # Tue Mar 06 07:24:12 2018 -0600 # Node ID 6c476e5b05b821b9e6b8da9de807ca45940b6fad # Parent fca950cc0de8a69d23bf37521e43cc5310009aad py3: drop b'' from debug message "moving bookmarks" diff --git

[PATCH 1 of 5] py3: use r'' instead of sysstr('') to get around code transformer

2018-03-10 Thread Yuya Nishihara
# HG changeset patch # User Yuya Nishihara # Date 1520665036 -32400 # Sat Mar 10 15:57:16 2018 +0900 # Node ID fca950cc0de8a69d23bf37521e43cc5310009aad # Parent ebabfc339ee4fe88ae7ff96bc925d66512066da0 py3: use r'' instead of sysstr('') to get around code transformer Fewer

[PATCH 3 of 5] py3: wrap file object to write patch in native eol preserving byte-ness

2018-03-10 Thread Yuya Nishihara
# HG changeset patch # User Yuya Nishihara # Date 1520343957 21600 # Tue Mar 06 07:45:57 2018 -0600 # Node ID d472860cb611fb3f268ae48bd2870432387eca5b # Parent 6c476e5b05b821b9e6b8da9de807ca45940b6fad py3: wrap file object to write patch in native eol preserving byte-ness

[PATCH 4 of 5] py3: open patch file in binary mode and convert eol manually

2018-03-10 Thread Yuya Nishihara
# HG changeset patch # User Yuya Nishihara # Date 1520678949 -32400 # Sat Mar 10 19:49:09 2018 +0900 # Node ID a984ebd44ac74e7b532963a50e0714d93e4465e3 # Parent d472860cb611fb3f268ae48bd2870432387eca5b py3: open patch file in binary mode and convert eol manually Here we

[PATCH 5 of 5] py3: make test-commit-interactive.t byte-safe

2018-03-10 Thread Yuya Nishihara
# HG changeset patch # User Yuya Nishihara # Date 1520679407 -32400 # Sat Mar 10 19:56:47 2018 +0900 # Node ID e287b170d17027721fa7afee87ad6bce248f0660 # Parent a984ebd44ac74e7b532963a50e0714d93e4465e3 py3: make test-commit-interactive.t byte-safe diff --git

D2720: debugcommands: introduce actions to perform deterministic reads

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg added a comment. See the `contrib/showstack.py` extension for registering SIGQUIT and SIGINFO signals to dump the active stack. Not sure if that works on Windows though. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2720 To: indygreg, #hg-reviewers

[PATCH 1 of 2] util: forward __bool__()/__nonzero__() on fileobjectproxy

2018-03-10 Thread Matt Harbison
# HG changeset patch # User Matt Harbison # Date 1520702528 18000 # Sat Mar 10 12:22:08 2018 -0500 # Node ID e21d0c21f81315d012c4806359bc76aa40c89ad6 # Parent 963b4223d14fa419df2a82fbe47cd55075707b6a util: forward __bool__()/__nonzero__() on fileobjectproxy In

[PATCH 2 of 2] sshpeer: check pipe validity before forwarding output from it

2018-03-10 Thread Matt Harbison
# HG changeset patch # User Matt Harbison # Date 1520703910 18000 # Sat Mar 10 12:45:10 2018 -0500 # Node ID 0e076d66888bff8e3eac166454bb3214c48ff8be # Parent e21d0c21f81315d012c4806359bc76aa40c89ad6 sshpeer: check pipe validity before forwarding output from it

D2734: hgweb: parse WSGI request into a data structure

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg added inline comments. INLINE COMMENTS > pulkit wrote in request.py:14 > Chunk from your wip? Yes. But there is a TODO below to track enabling it. I fully intend to enable this once we can. That will likely require doing away with the REPO_NAME hack in hgwebdir. That will likely

D2734: hgweb: parse WSGI request into a data structure

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg marked 4 inline comments as done. indygreg added a comment. I amended hg-committed with the fixes for the issues @yuja found. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2734 To: indygreg, #hg-reviewers, durin42 Cc: pulkit, yuja, mercurial-devel

Re: [PATCH 1 of 2] util: forward __bool__()/__nonzero__() on fileobjectproxy

2018-03-10 Thread Gregory Szorc
On Sat, Mar 10, 2018 at 10:05 AM, Matt Harbison wrote: > # HG changeset patch > # User Matt Harbison > # Date 1520702528 18000 > # Sat Mar 10 12:22:08 2018 -0500 > # Node ID e21d0c21f81315d012c4806359bc76aa40c89ad6 > # Parent

D2720: debugcommands: introduce actions to perform deterministic reads

2018-03-10 Thread mharbison72 (Matt Harbison)
mharbison72 added a comment. At this point, I've narrowed it down to stderr. I misunderstood the 'noreadstderr', and wondered why we were bothering to pipe stderr if True. So I set it to os.devnull, and the test sails through. (But it does drop all "e>" lines, so that's not an actual

D2769: hgweb: refactor the request draining code

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg updated this revision to Diff 6831. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2769?vs=6813=6831 REVISION DETAIL https://phab.mercurial-scm.org/D2769 AFFECTED FILES mercurial/hgweb/request.py mercurial/wireprotoserver.py CHANGE

D2748: hgweb: remove wsgirequest.read()

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg updated this revision to Diff 6828. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2748?vs=6754=6828 REVISION DETAIL https://phab.mercurial-scm.org/D2748 AFFECTED FILES mercurial/hgweb/request.py mercurial/wireprotoserver.py CHANGE

D2779: hgweb: use our new request object for "style" parameter

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY The "style" parameter is kind of wonky because it is explicitly set and has lookups in random locations. Let's port it to qsparams first because it isn't

D2771: hgweb: expose input stream on parsed WSGI request object

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg updated this revision to Diff 6833. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2771?vs=6815=6833 REVISION DETAIL https://phab.mercurial-scm.org/D2771 AFFECTED FILES mercurial/hgweb/hgwebdir_mod.py mercurial/hgweb/request.py

D2776: hgweb: use a multidict for holding query string parameters

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg updated this revision to Diff 6838. indygreg edited the summary of this revision. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2776?vs=6822=6838 REVISION DETAIL https://phab.mercurial-scm.org/D2776 AFFECTED FILES mercurial/hgweb/request.py

D2778: tests: add test for a wire protocol request to wrong base URL

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY We have code that validates that wire protocol commands (which are specified via query string) must occur at the base URL of a repo. But we have no test

D2749: hgweb: remove wsgirequest.__iter__

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg updated this revision to Diff 6829. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2749?vs=6755=6829 REVISION DETAIL https://phab.mercurial-scm.org/D2749 AFFECTED FILES mercurial/hgweb/request.py CHANGE DETAILS diff --git

D2745: hgweb: store and use request method on parsed request

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg updated this revision to Diff 6825. indygreg edited the summary of this revision. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2745?vs=6751=6825 REVISION DETAIL https://phab.mercurial-scm.org/D2745 AFFECTED FILES mercurial/hgweb/request.py

D2775: hgweb: create dedicated type for WSGI responses

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg updated this revision to Diff 6837. indygreg edited the summary of this revision. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2775?vs=6821=6837 REVISION DETAIL https://phab.mercurial-scm.org/D2775 AFFECTED FILES

D2746: wireprotoserver: remove unused argument from _handlehttperror()

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg updated this revision to Diff 6826. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2746?vs=6752=6826 REVISION DETAIL https://phab.mercurial-scm.org/D2746 AFFECTED FILES mercurial/wireprotoserver.py CHANGE DETAILS diff --git

D2773: hgweb: remove support for short query string based aliases (BC)

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg updated this revision to Diff 6835. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2773?vs=6820=6835 REVISION DETAIL https://phab.mercurial-scm.org/D2773 AFFECTED FILES mercurial/hgweb/request.py tests/test-hgweb-raw.t CHANGE DETAILS

D2744: hgweb: handle CONTENT_LENGTH

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg updated this revision to Diff 6824. indygreg edited the summary of this revision. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2744?vs=6750=6824 REVISION DETAIL https://phab.mercurial-scm.org/D2744 AFFECTED FILES mercurial/hgweb/request.py

D2774: hgweb: remove support for POST form data (BC)

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg updated this revision to Diff 6834. indygreg retitled this revision from "hgweb: remove support for retrieving parameters from POST form data" to "hgweb: remove support for POST form data (BC)". REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE

D2747: hgweb: remove unused methods on wsgirequest

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg updated this revision to Diff 6827. indygreg edited the summary of this revision. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2747?vs=6753=6827 REVISION DETAIL https://phab.mercurial-scm.org/D2747 AFFECTED FILES mercurial/hgweb/request.py

D2770: hgweb: make parsedrequest part of wsgirequest

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg updated this revision to Diff 6832. indygreg edited the summary of this revision. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2770?vs=6814=6832 REVISION DETAIL https://phab.mercurial-scm.org/D2770 AFFECTED FILES

D2768: hgweb: use a capped reader for WSGI input stream

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg updated this revision to Diff 6830. indygreg edited the summary of this revision. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2768?vs=6812=6830 REVISION DETAIL https://phab.mercurial-scm.org/D2768 AFFECTED FILES mercurial/hgweb/request.py

Re: [PATCH] ui: remove any combinations of CR|LF from prompt response

2018-03-10 Thread Matt Harbison
On Sat, 10 Mar 2018 02:52:00 -0500, Yuya Nishihara wrote: # HG changeset patch # User Yuya Nishihara # Date 1520664609 -32400 # Sat Mar 10 15:50:09 2018 +0900 # Node ID c38b2b364df79a9defc3520f19207ce47abcc7d8 # Parent

[Bug 5812] New: paper theme uses inline javascript, making web.csp far less effective

2018-03-10 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=5812 Bug ID: 5812 Summary: paper theme uses inline javascript, making web.csp far less effective Product: Mercurial Version: 4.5.2 Hardware: All OS: All

D2780: hgweb: set variables in qsparams

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY We currently mutate wsgireq.form in a few places. Since it is independent from req.qsparams, we will need to make changes on req.qsparams as well before

D2776: hgweb: use a multidict for holding query string parameters

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg updated this revision to Diff 6840. indygreg edited the summary of this revision. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2776?vs=6838=6840 REVISION DETAIL https://phab.mercurial-scm.org/D2776 AFFECTED FILES mercurial/hgweb/request.py

D2781: hgweb: perform all parameter lookup via qsparams

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY I think I managed to update all call sites using wsgirequest.form to use parsedrequest.qsparams. Since behavior of qsparams is to retrieve last value,

D2782: hgweb: remove wsgirequest.form (API)

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Now that everything is ported to consume from parsedrequest.qsparams, we no longer have a need for wsgirequest.form. Let's remove all references to it. ..

[PATCH] hook: ensure stderr is flushed when an exception is raised, for test stability

2018-03-10 Thread Matt Harbison
# HG changeset patch # User Matt Harbison # Date 1520737378 18000 # Sat Mar 10 22:02:58 2018 -0500 # Node ID 5dd79bb7e5a3cf33d04c00e7c6c52070f472149d # Parent 7c4e5abd9e7e903e6916b30ccc0d2b26d69a5fca hook: ensure stderr is flushed when an exception is raised, for

[PATCH] wireproto: explicitly flush stdio to prevent stalls on Windows

2018-03-10 Thread Matt Harbison
# HG changeset patch # User Matt Harbison # Date 1520744281 18000 # Sat Mar 10 23:58:01 2018 -0500 # Node ID 1145671119a40e82932f63f83ad4049727416174 # Parent 963b4223d14fa419df2a82fbe47cd55075707b6a wireproto: explicitly flush stdio to prevent stalls on Windows

D2798: hgweb: use web.req instead of req.req

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY We now have access to the modern request type on the requestcontext instance. Let's access it from there. While we're here, remove an unused argument from

D2802: hgweb: pass modern request type into various webutil functions (API)

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Our march towards killing wsgirequest continues. .. api:: Various functions in hgweb.webutil now take a modern request object instead of

D2799: hgweb: add a sendtemplate() helper function

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This pattern is common. Let's make a helper function to reduce boilerplate. We store the "global" template on the requestcontext instance and use it. The

D2793: hgweb: transition permissions hooks to modern request type (API)

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY We're trying to remove ``wsgirequest``. The permissions hooks don't do anything they can't do with our new request type. So let's pass that in. This was

D2803: hgweb: stop passing req and tmpl into @webcommand functions (API)

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY We have effectively removed all consumers of the old wsgirequest type. The templater can be accessed on the requestcontext passed into the @webcommand

D2801: hgweb: don't redundantly pass templater with requestcontext (API)

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY The requestcontenxt has a ``tmpl`` attribute to access the templater. We don't need to pass the templater explicitly when passing a requestcontext instance.

D2791: hgweb: refactor fake file object proxy for archiving

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Python's zip file writer operates on a file object. When doing work, it periodically calls write(), flush(), and tell() on that object. In WSGI contexts,

D2800: hgweb: use templater on requestcontext instance

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY After this commit, all @webcommand function no longer use their "tmpl" argument. Instead, they use the templater attached to the requestcontext. This is

D2796: hgweb: always return iterable from @webcommand functions (API)

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY We had to hack up this function to support our transition to the new response API. Now that we're done with the transition (!!), we can return to returning an

D2805: hgweb: remove some use of wsgireq in hgwebdir

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2805 AFFECTED FILES mercurial/hgweb/hgwebdir_mod.py CHANGE DETAILS diff --git

D2787: hgweb: port most @webcommand to use modern response type

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This only focused on porting the return value. raw file requests are wonky because they go through a separate code path at the dispatch layer. Now that

D2795: hgweb: send errors using new response API

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Our slow march off of wsgirequest continues. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2795 AFFECTED FILES

D2792: hgweb: port archive command to modern response API

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Well, I tried to go with PEP 's recommendations and only allow our WSGI application to emit data via a response generator. Unfortunately, the "archive"

D2786: hgweb: support using new response object for web commands

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY We have a "requestcontext" type for holding state for the current request. Why we pass in the wsgirequest and templater instance to @webcommand functions, I

D2797: hgweb: stop setting headers on wsgirequest

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY All commands now go through the new response API. This is dead code. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2797 AFFECTED

D2804: hgweb: fix a bug due to variable name typo

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY It looks like the "sort" query string parameter was not being honored properly. REPOSITORY rHG Mercurial REVISION DETAIL

Re: [PATCH] ui: remove any combinations of CR|LF from prompt response

2018-03-10 Thread Pulkit Goyal
On Sat, Mar 10, 2018 at 10:37 PM, Matt Harbison wrote: > On Sat, 10 Mar 2018 02:52:00 -0500, Yuya Nishihara wrote: > >> # HG changeset patch >> # User Yuya Nishihara >> # Date 1520664609 -32400 >> # Sat Mar 10 15:50:09 2018 +0900 >> #

D2789: hgweb: port static file handling to new response API

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY hgwebdir_mod hasn't received as much porting effort. So we had to do some minor plumbing to get it to match hgweb_mod and to support the new response object.

D2785: hgweb: inline caching() and port to modern mechanisms

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY We only had one consumer of this simple function. While it could be a generic function, let's not over abstract the code. As part of inlining, we port it

D2783: hgweb: expose URL scheme and REMOTE_* attributes

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY These are consulted by the HTTP wire protocol handler by reading from the env dict. Let's expose them as attributes instead. With the wire protocol handler

D2790: tests: additional test coverage of archive web command

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This command is special in a few ways. First, it is the only command using the write() function from WSGI's start_response() function. Second, it is setting a

D2784: hgweb: expose repo name on parsedrequest

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY I'm not a fan of doing this because I want to find a better solution to the REPO_NAME hack. But this change gets us a few steps closer to eliminating use of

D2794: hgweb: refactor 304 handling code

2018-03-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY 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

Re: [PATCH 1 of 5] py3: use r'' instead of sysstr('') to get around code transformer

2018-03-10 Thread Pulkit Goyal
On Sat, Mar 10, 2018 at 4:58 PM, Yuya Nishihara wrote: > # HG changeset patch > # User Yuya Nishihara > # Date 1520665036 -32400 > # Sat Mar 10 15:57:16 2018 +0900 > # Node ID fca950cc0de8a69d23bf37521e43cc5310009aad > # Parent

D2777: wireproto: raise ProgrammingError instead of Abort

2018-03-10 Thread indygreg (Gregory Szorc)
This revision was automatically updated to reflect the committed changes. Closed by commit rHGef68493d652b: wireproto: raise ProgrammingError instead of Abort (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE