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

r27902:51b6ce25 default
r36916:219b2335 default
Show More
test-diffdir.t
77 lines | 1.5 KiB | text/troff | Tads3Lexer
Pradeepkumar Gayam
tests: unify test-diffdir
r11921 $ hg init
$ touch a
$ hg add a
Martin Geisler
tests: remove unneeded -d flags...
r12156 $ hg ci -m "a"
Pradeepkumar Gayam
tests: unify test-diffdir
r11921
$ echo 123 > b
$ hg add b
$ hg diff --nodates
Martin Geisler
tests: remove unneeded -d flags...
r12156 diff -r 3903775176ed b
Pradeepkumar Gayam
tests: unify test-diffdir
r11921 --- /dev/null
+++ b/b
@@ -0,0 +1,1 @@
+123
$ hg diff --nodates -r tip
Martin Geisler
tests: remove unneeded -d flags...
r12156 diff -r 3903775176ed b
Pradeepkumar Gayam
tests: unify test-diffdir
r11921 --- /dev/null
+++ b/b
@@ -0,0 +1,1 @@
+123
$ echo foo > a
$ hg diff --nodates
Martin Geisler
tests: remove unneeded -d flags...
r12156 diff -r 3903775176ed a
Pradeepkumar Gayam
tests: unify test-diffdir
r11921 --- a/a
+++ b/a
@@ -0,0 +1,1 @@
+foo
Martin Geisler
tests: remove unneeded -d flags...
r12156 diff -r 3903775176ed b
Pradeepkumar Gayam
tests: unify test-diffdir
r11921 --- /dev/null
+++ b/b
@@ -0,0 +1,1 @@
+123
$ hg diff -r ""
Matt Mackall
revsets: make revpair revsets-aware...
r12617 hg: parse error: empty query
Matt Mackall
tests: add exit codes to unified tests
r12316 [255]
Pradeepkumar Gayam
tests: unify test-diffdir
r11921 $ hg diff -r tip -r ""
Matt Mackall
revsets: make revpair revsets-aware...
r12617 hg: parse error: empty query
Matt Mackall
tests: add exit codes to unified tests
r12316 [255]
Martin von Zweigbergk
diff: don't crash when merged-in addition was removed (issue4786)...
r27901
Remove a file that was added via merge. Since the file is not in parent 1,
it should not be in the diff.
$ hg ci -m 'a=foo' a
$ hg co -Cq null
$ echo 123 > b
$ hg add b
$ hg ci -m "b"
created new head
$ hg merge 1
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ hg rm -f a
$ hg diff --nodates
Rename a file that was added via merge. Since the rename source is not in
parent 1, the diff should be relative to /dev/null
$ hg co -Cq 2
$ hg merge 1
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ hg mv a a2
$ hg diff --nodates
diff -r cf44b38435e5 a2
--- /dev/null
+++ b/a2
@@ -0,0 +1,1 @@
+foo
Martin von Zweigbergk
diff: don't crash when merged-in addition is copied...
r27902 $ hg diff --nodates --git
diff --git a/a2 b/a2
new file mode 100644
--- /dev/null
+++ b/a2
@@ -0,0 +1,1 @@
+foo