##// END OF EJS Templates
hgweb: support constructing URLs from an alternate base URL...
hgweb: support constructing URLs from an alternate base URL The web.baseurl config option allows server operators to define a custom URL for hosted content. The way it works today is that hgwebdir parses this config option into URL components then updates the appropriate WSGI environment variables so the request "lies" about its details. For example, SERVER_NAME is updated to reflect the alternate base URL's hostname. The WSGI environment should not be modified because WSGI applications may want to know the original request details (for debugging, etc). This commit teaches our request parser about the existence of an alternate base URL. If defined, the advertised URL and other self-reflected paths will take the alternate base URL into account. The hgweb WSGI application didn't use web.baseurl. But hgwebdir did. We update hgwebdir to alter the environment parsing accordingly. The old code around environment manipulation has been removed. With this change, parserequestfromenv() has grown to a bit unwieldy. Now that practically everyone is using it, it is obvious that there is some unused features that can be trimmed. So look for this in follow-up commits. Differential Revision: https://phab.mercurial-scm.org/D2822

File last commit:

r26736:143b52fc default
r36916:219b2335 default
Show More
test-mq-qdelete.t
197 lines | 3.5 KiB | text/troff | Tads3Lexer
/ tests / test-mq-qdelete.t
Adrian Buehlmann
tests: unify some of test-mq*
r12324 $ echo "[extensions]" >> $HGRCPATH
$ echo "mq=" >> $HGRCPATH
$ hg init a
$ cd a
$ echo 'base' > base
$ hg ci -Ambase -d '1 0'
adding base
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 $ hg qnew -d '1 0' pa
$ hg qnew -d '1 0' pb
$ hg qnew -d '1 0' pc
Adrian Buehlmann
tests: unify some of test-mq*
r12324
$ hg qdel
abort: qdelete requires at least one revision or patch name
[255]
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 $ hg qdel pc
abort: cannot delete applied patch pc
Adrian Buehlmann
tests: unify some of test-mq*
r12324 [255]
$ hg qpop
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 popping pc
now at: pb
Adrian Buehlmann
tests: unify some of test-mq*
r12324
Dan Villiom Podlaski Christiansen
mq: handle deleting the same patch twice in one command (issue2427)
r12655 Delete the same patch twice in one command (issue2427)
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 $ hg qdel pc pc
Adrian Buehlmann
tests: unify some of test-mq*
r12324
$ hg qseries
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 pa
pb
Adrian Buehlmann
tests: unify some of test-mq*
r12324
$ ls .hg/patches
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 pa
pb
Adrian Buehlmann
tests: unify some of test-mq*
r12324 series
status
$ hg qpop
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 popping pb
now at: pa
Adrian Buehlmann
tests: unify some of test-mq*
r12324
$ hg qdel -k 1
$ ls .hg/patches
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 pa
pb
Adrian Buehlmann
tests: unify some of test-mq*
r12324 series
status
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 $ hg qdel -r pa
patch pa finalized without changeset message
Adrian Buehlmann
tests: unify some of test-mq*
r12324
$ hg qapplied
$ hg log --template '{rev} {desc}\n'
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 1 [mq]: pa
Adrian Buehlmann
tests: unify some of test-mq*
r12324 0 base
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 $ hg qnew pd
$ hg qnew pe
$ hg qnew pf
Adrian Buehlmann
tests: unify some of test-mq*
r12324
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 $ hg qdel -r pe
Adrian Buehlmann
tests: unify some of test-mq*
r12324 abort: cannot delete revision 3 above applied patches
[255]
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 $ hg qdel -r qbase:pe
patch pd finalized without changeset message
patch pe finalized without changeset message
Adrian Buehlmann
tests: unify some of test-mq*
r12324
$ hg qapplied
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 pf
Adrian Buehlmann
tests: unify some of test-mq*
r12324
$ hg log --template '{rev} {desc}\n'
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 4 [mq]: pf
3 [mq]: pe
2 [mq]: pd
1 [mq]: pa
Adrian Buehlmann
tests: unify some of test-mq*
r12324 0 base
$ cd ..
$ hg init b
$ cd b
$ echo 'base' > base
$ hg ci -Ambase -d '1 0'
adding base
$ hg qfinish
abort: no revisions specified
[255]
$ hg qfinish -a
no patches applied
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 $ hg qnew -d '1 0' pa
$ hg qnew -d '1 0' pb
$ hg qnew pc # XXX fails to apply by /usr/bin/patch if we put a date
Adrian Buehlmann
tests: unify some of test-mq*
r12324
$ hg qfinish 0
abort: revision 0 is not managed
[255]
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 $ hg qfinish pb
Adrian Buehlmann
tests: unify some of test-mq*
r12324 abort: cannot delete revision 2 above applied patches
[255]
$ hg qpop
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 popping pc
now at: pb
Adrian Buehlmann
tests: unify some of test-mq*
r12324
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 $ hg qfinish -a pc
abort: unknown revision 'pc'!
Adrian Buehlmann
tests: unify some of test-mq*
r12324 [255]
$ hg qpush
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 applying pc
patch pc is empty
now at: pc
Adrian Buehlmann
tests: unify some of test-mq*
r12324
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 $ hg qfinish qbase:pb
patch pa finalized without changeset message
patch pb finalized without changeset message
Adrian Buehlmann
tests: unify some of test-mq*
r12324
$ hg qapplied
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 pc
Adrian Buehlmann
tests: unify some of test-mq*
r12324
$ hg log --template '{rev} {desc}\n'
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 3 imported patch pc
2 [mq]: pb
1 [mq]: pa
Adrian Buehlmann
tests: unify some of test-mq*
r12324 0 base
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 $ hg qfinish -a pc
patch pc finalized without changeset message
Adrian Buehlmann
tests: unify some of test-mq*
r12324
$ hg qapplied
$ hg log --template '{rev} {desc}\n'
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 3 imported patch pc
2 [mq]: pb
1 [mq]: pa
Adrian Buehlmann
tests: unify some of test-mq*
r12324 0 base
$ ls .hg/patches
series
status
Dan Villiom Podlaski Christiansen
mq: silence spurious output....
r12658 qdel -k X && hg qimp -e X used to trigger spurious output with versioned queues
$ hg init --mq
$ hg qimport -r 3
$ hg qpop
Mads Kiilerich
mq: generate patch names from first line of description...
r26736 popping imported_patch_pc
Dan Villiom Podlaski Christiansen
mq: silence spurious output....
r12658 patch queue now empty
Mads Kiilerich
mq: generate patch names from first line of description...
r26736 $ hg qdel -k imported_patch_pc
$ hg qimp -e imported_patch_pc
adding imported_patch_pc to series file
Dan Villiom Podlaski Christiansen
mq: silence spurious output....
r12658 $ hg qfinish -a
no patches applied
Pierre-Yves David
mq: prevent traceback when qfinish patches not in series....
r14010
resilience to inconsistency: qfinish -a with applied patches not in series
$ hg qser
Mads Kiilerich
mq: generate patch names from first line of description...
r26736 imported_patch_pc
Pierre-Yves David
mq: prevent traceback when qfinish patches not in series....
r14010 $ hg qapplied
$ hg qpush
Mads Kiilerich
mq: generate patch names from first line of description...
r26736 applying imported_patch_pc
patch imported_patch_pc is empty
now at: imported_patch_pc
Pierre-Yves David
mq: prevent traceback when qfinish patches not in series....
r14010 $ echo next >> base
$ hg qrefresh -d '1 0'
$ echo > .hg/patches/series # remove 3.diff from series to confuse mq
$ hg qfinish -a
Mads Kiilerich
mq: generate patch names from first line of description...
r26736 revision 47dfa8501675 refers to unknown patches: imported_patch_pc
Pierre-Yves David
mq: prevent traceback when qfinish patches not in series....
r14010
more complex state 'both known and unknown patches
$ echo hip >> base
$ hg qnew -f -d '1 0' -m 4 4.diff
$ echo hop >> base
$ hg qnew -f -d '1 0' -m 5 5.diff
$ echo > .hg/patches/series # remove 4.diff and 5.diff from series to confuse mq
$ echo hup >> base
$ hg qnew -f -d '1 0' -m 6 6.diff
Matt Mackall
mq: add a warning about uncommitted changes for qfinish
r15476 $ echo pup > base
Pierre-Yves David
mq: prevent traceback when qfinish patches not in series....
r14010 $ hg qfinish -a
Matt Mackall
mq: add a warning about uncommitted changes for qfinish
r15476 warning: uncommitted changes in the working directory
Peter Arrenbrecht
localrepo: reuse parent manifest in commitctx if no files have changed...
r14162 revision 2b1c98802260 refers to unknown patches: 5.diff
revision 33a6861311c0 refers to unknown patches: 4.diff
Pierre-Yves David
mq: prevent traceback when qfinish patches not in series....
r14010
Mads Kiilerich
tests: add missing trailing 'cd ..'...
r16913 $ cd ..