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

r33089:9e0d222f default
r36916:219b2335 default
Show More
test-merge-default.t
175 lines | 3.9 KiB | text/troff | Tads3Lexer
/ tests / test-merge-default.t
Adrian Buehlmann
tests: unify test-merge-default
r12255 $ hg init
$ echo a > a
$ hg commit -A -ma
adding a
$ echo b >> a
$ hg commit -mb
$ echo c >> a
$ hg commit -mc
$ hg up 1
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo d >> a
$ hg commit -md
created new head
$ hg up 1
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo e >> a
$ hg commit -me
created new head
$ hg up 1
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
Should fail because not at a head:
$ hg merge
Pierre-Yves David
merge: give priority to "not at head" failures for bare 'hg merge'...
r28103 abort: working directory not at a head revision
(use 'hg update' or merge with an explicit revision)
Matt Mackall
tests: add exit codes to unified tests
r12316 [255]
Adrian Buehlmann
tests: unify test-merge-default
r12255
$ hg up
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
Pulkit Goyal
update: show the commit to which we updated in case of multiple heads (BC)...
r32698 updated to "f25cbe84d8b3: e"
Pierre-Yves David
update: warn about other topological heads on bare update...
r28029 2 other heads for branch "default"
Adrian Buehlmann
tests: unify test-merge-default
r12255
Should fail because > 2 heads:
$ HGMERGE=internal:other; export HGMERGE
$ hg merge
abort: branch 'default' has 3 heads - please merge with an explicit rev
(run 'hg heads .' to see heads)
Matt Mackall
tests: add exit codes to unified tests
r12316 [255]
Adrian Buehlmann
tests: unify test-merge-default
r12255
Should succeed:
$ hg merge 2
0 files updated, 1 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
Matt Harbison
identify: add template support...
r33051 $ hg id -Tjson
[
{
"bookmarks": [],
"branch": "default",
Matt Harbison
identify: rename 'changed' keyword -> 'dirty'...
r33054 "dirty": "+",
Matt Harbison
identify: add template support...
r33051 "id": "f25cbe84d8b3+2d95304fed5d+",
"node": "ffffffffffffffffffffffffffffffffffffffff",
Yuya Nishihara
identify: change p1/p2 to a list of parents...
r33089 "parents": [{"node": "f25cbe84d8b320e298e7703f18a25a3959518c23", "rev": 4}, {"node": "2d95304fed5d89bc9d70b2a0d02f0d567469c3ab", "rev": 2}],
Matt Harbison
identify: add template support...
r33051 "tags": ["tip"]
}
]
Adrian Buehlmann
tests: unify test-merge-default
r12255 $ hg commit -mm1
Should succeed - 2 heads:
$ hg merge -P
changeset: 3:ea9ff125ff88
parent: 1:1846eede8b68
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: d
$ hg merge
0 files updated, 1 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ hg commit -mm2
Matt Harbison
identify: add template support...
r33051 $ hg id -r 1 -Tjson
[
{
"bookmarks": [],
"branch": "default",
"id": "1846eede8b68",
"node": "1846eede8b6886d8cc8a88c96a687b7fe8f3b9d1",
"tags": []
}
]
Adrian Buehlmann
tests: unify test-merge-default
r12255 Should fail because at tip:
$ hg merge
Kevin Bullock
merge: make 'nothing to merge' aborts consistent...
r15619 abort: nothing to merge
Matt Mackall
tests: add exit codes to unified tests
r12316 [255]
Adrian Buehlmann
tests: unify test-merge-default
r12255
$ hg up 0
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
Should fail because there is only one head:
$ hg merge
Kevin Bullock
merge: make 'nothing to merge' aborts consistent...
r15619 abort: nothing to merge
(use 'hg update' instead)
Matt Mackall
tests: add exit codes to unified tests
r12316 [255]
Adrian Buehlmann
tests: unify test-merge-default
r12255
$ hg up 3
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo f >> a
$ hg branch foobranch
marked working directory as branch foobranch
Matt Mackall
branch: warn on branching
r15615 (branches are permanent and global, did you want a bookmark?)
Adrian Buehlmann
tests: unify test-merge-default
r12255 $ hg commit -mf
Should fail because merge with other branch:
$ hg merge
abort: branch 'foobranch' has one head - please merge with an explicit rev
(run 'hg heads' to see all heads)
Matt Mackall
tests: add exit codes to unified tests
r12316 [255]
Adrian Buehlmann
tests: unify test-merge-default
r12255
Test for issue2043: ensure that 'merge -P' shows ancestors of 6 that
Mads Kiilerich
comments: describe ancestor consistently - avoid 'least common ancestor'...
r22389 are not ancestors of 7, regardless of where their common ancestors are.
Adrian Buehlmann
tests: unify test-merge-default
r12255
Merge preview not affected by common ancestor:
$ hg up -q 7
$ hg merge -q -P 6
2:2d95304fed5d
4:f25cbe84d8b3
5:a431fabd6039
6:e88e33f3bf62
Pierre-Yves David
revset: rename and test '_destmerge'...
r26716 Test experimental destination revset
$ hg log -r '_destmerge()'
abort: branch 'foobranch' has one head - please merge with an explicit rev
(run 'hg heads' to see all heads)
[255]
Pierre-Yves David
destutil: allow to specify an explicit source for the merge...
r28139 (on a branch with a two heads)
$ hg up 5
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo f >> a
$ hg commit -mf
created new head
$ hg log -r '_destmerge()'
changeset: 6:e88e33f3bf62
parent: 5:a431fabd6039
parent: 3:ea9ff125ff88
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: m2
(from the other head)
$ hg log -r '_destmerge(e88e33f3bf62)'
changeset: 8:b613918999e2
tag: tip
parent: 5:a431fabd6039
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: f
(from unrelated branch)
$ hg log -r '_destmerge(foobranch)'
abort: branch 'foobranch' has one head - please merge with an explicit rev
(run 'hg heads' to see all heads)
[255]