##// 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:

r35386:469b06b4 default
r36916:219b2335 default
Show More
test-rebase-partial.t
95 lines | 1.8 KiB | text/troff | Tads3Lexer
/ tests / test-rebase-partial.t
Martin von Zweigbergk
rebase: allow rebase even if some revisions need no rebase (BC) (issue5422)...
r32272 Tests rebasing with part of the rebase set already in the
destination (issue5422)
$ cat >> $HGRCPATH <<EOF
> [extensions]
> rebase=
> drawdag=$TESTDIR/drawdag.py
>
> [experimental]
Boris Feld
config: use 'experimental.evolution.create-markers'...
r34867 > evolution.createmarkers=True
Boris Feld
config: use 'experimental.evolution.allowunstable'...
r34868 > evolution.allowunstable=True
Martin von Zweigbergk
rebase: allow rebase even if some revisions need no rebase (BC) (issue5422)...
r32272 >
> [alias]
Phil Cohen
tests: add commit hashes to log commands in rebase tests...
r35386 > tglog = log -G --template "{rev}: {node|short} {desc}"
Martin von Zweigbergk
rebase: allow rebase even if some revisions need no rebase (BC) (issue5422)...
r32272 > EOF
$ rebasewithdag() {
> N=`$PYTHON -c "print($N+1)"`
> hg init repo$N && cd repo$N
> hg debugdrawdag
> hg rebase "$@" > _rebasetmp
> r=$?
> grep -v 'saved backup bundle' _rebasetmp
> [ $r -eq 0 ] && hg tglog
> cd ..
> return $r
> }
Rebase two commits, of which one is already in the right place
$ rebasewithdag -r C+D -d B <<EOF
> C
> |
> B D
> |/
> A
> EOF
rebasing 2:b18e25de2cf5 "D" (D)
already rebased 3:26805aba1e60 "C" (C tip)
Phil Cohen
tests: add commit hashes to log commands in rebase tests...
r35386 o 4: fe3b4c6498fa D
Martin von Zweigbergk
rebase: allow rebase even if some revisions need no rebase (BC) (issue5422)...
r32272 |
Phil Cohen
tests: add commit hashes to log commands in rebase tests...
r35386 | o 3: 26805aba1e60 C
Martin von Zweigbergk
rebase: allow rebase even if some revisions need no rebase (BC) (issue5422)...
r32272 |/
Phil Cohen
tests: add commit hashes to log commands in rebase tests...
r35386 | x 2: b18e25de2cf5 D
Martin von Zweigbergk
rebase: allow rebase even if some revisions need no rebase (BC) (issue5422)...
r32272 | |
Phil Cohen
tests: add commit hashes to log commands in rebase tests...
r35386 o | 1: 112478962961 B
Martin von Zweigbergk
rebase: allow rebase even if some revisions need no rebase (BC) (issue5422)...
r32272 |/
Phil Cohen
tests: add commit hashes to log commands in rebase tests...
r35386 o 0: 426bada5c675 A
Martin von Zweigbergk
rebase: allow rebase even if some revisions need no rebase (BC) (issue5422)...
r32272
Can collapse commits even if one is already in the right place
$ rebasewithdag --collapse -r C+D -d B <<EOF
> C
> |
> B D
> |/
> A
> EOF
rebasing 2:b18e25de2cf5 "D" (D)
rebasing 3:26805aba1e60 "C" (C tip)
Phil Cohen
tests: add commit hashes to log commands in rebase tests...
r35386 o 4: a2493f4ace65 Collapsed revision
Martin von Zweigbergk
rebase: allow rebase even if some revisions need no rebase (BC) (issue5422)...
r32272 | * D
| * C
Phil Cohen
tests: add commit hashes to log commands in rebase tests...
r35386 | x 3: 26805aba1e60 C
Martin von Zweigbergk
rebase: allow rebase even if some revisions need no rebase (BC) (issue5422)...
r32272 |/
Phil Cohen
tests: add commit hashes to log commands in rebase tests...
r35386 | x 2: b18e25de2cf5 D
Martin von Zweigbergk
rebase: allow rebase even if some revisions need no rebase (BC) (issue5422)...
r32272 | |
Phil Cohen
tests: add commit hashes to log commands in rebase tests...
r35386 o | 1: 112478962961 B
Martin von Zweigbergk
rebase: allow rebase even if some revisions need no rebase (BC) (issue5422)...
r32272 |/
Phil Cohen
tests: add commit hashes to log commands in rebase tests...
r35386 o 0: 426bada5c675 A
Martin von Zweigbergk
rebase: allow rebase even if some revisions need no rebase (BC) (issue5422)...
r32272
Rebase with "holes". The commits after the hole should end up on the parent of
the hole (B below), not on top of the destination (A).
$ rebasewithdag -r B+D -d A <<EOF
> D
> |
> C
> |
> B
> |
> A
> EOF
already rebased 1:112478962961 "B" (B)
rebasing 3:f585351a92f8 "D" (D tip)
Phil Cohen
tests: add commit hashes to log commands in rebase tests...
r35386 o 4: 1e6da8103bc7 D
Martin von Zweigbergk
rebase: allow rebase even if some revisions need no rebase (BC) (issue5422)...
r32272 |
Phil Cohen
tests: add commit hashes to log commands in rebase tests...
r35386 | x 3: f585351a92f8 D
Martin von Zweigbergk
rebase: allow rebase even if some revisions need no rebase (BC) (issue5422)...
r32272 | |
Phil Cohen
tests: add commit hashes to log commands in rebase tests...
r35386 | o 2: 26805aba1e60 C
Martin von Zweigbergk
rebase: allow rebase even if some revisions need no rebase (BC) (issue5422)...
r32272 |/
Phil Cohen
tests: add commit hashes to log commands in rebase tests...
r35386 o 1: 112478962961 B
Martin von Zweigbergk
rebase: allow rebase even if some revisions need no rebase (BC) (issue5422)...
r32272 |
Phil Cohen
tests: add commit hashes to log commands in rebase tests...
r35386 o 0: 426bada5c675 A
Martin von Zweigbergk
rebase: allow rebase even if some revisions need no rebase (BC) (issue5422)...
r32272