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

r34490:270e344a default
r36916:219b2335 default
Show More
test-histedit-outgoing.t
156 lines | 4.1 KiB | text/troff | Tads3Lexer
/ tests / test-histedit-outgoing.t
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 $ cat >> $HGRCPATH <<EOF
> [extensions]
> histedit=
> EOF
$ initrepos ()
> {
> hg init r
> cd r
> for x in a b c ; do
> echo $x > $x
> hg add $x
> hg ci -m $x
> done
> cd ..
> hg clone r r2 | grep -v updating
> cd r2
> for x in d e f ; do
> echo $x > $x
> hg add $x
> hg ci -m $x
> done
> cd ..
> hg init r3
> cd r3
> for x in g h i ; do
> echo $x > $x
> hg add $x
> hg ci -m $x
> done
> cd ..
> }
$ initrepos
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
show the edit commands offered by outgoing
$ cd r2
$ HGEDITOR=cat hg histedit --outgoing ../r | grep -v comparing | grep -v searching
pick 055a42cdd887 3 d
pick e860deea161a 4 e
pick 652413bf663e 5 f
# Edit history between 055a42cdd887 and 652413bf663e
#
Adrian Zgorzałek
histedit: clarify description of fold command...
r20503 # Commits are listed from least to most recent
#
liscju
histedit: adds hint how to reorder changesets at editor (issue3766)
r28396 # You can reorder changesets by reordering the lines
#
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 # Commands:
timeless
histedit: prefer edit commit, edit message, use commit...
r27674 #
# e, edit = use commit, but stop for amending
# m, mess = edit commit message without changing commit content
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 # p, pick = use commit
Saurabh Singh
histedit: removing the experimental config 'histeditng'...
r34490 # b, base = checkout changeset and apply further changesets from there
timeless
histedit: prefer edit commit, edit message, use commit...
r27674 # d, drop = remove commit from history
Matt Mackall
histedit: shorten new fold message...
r20511 # f, fold = use commit, but combine it with the one above
Ben Schmidt
histedit: modify rollup to discard date from the rollup commit (issue4820)...
r31056 # r, roll = like fold, but discard this commit's description and date
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 #
$ cd ..
show the error from unrelated repos
$ cd r3
$ HGEDITOR=cat hg histedit --outgoing ../r | grep -v comparing | grep -v searching
abort: repository is unrelated
[1]
$ cd ..
show the error from unrelated repos
$ cd r3
$ HGEDITOR=cat hg histedit --force --outgoing ../r
comparing with ../r
searching for changes
warning: repository is unrelated
pick 2a4042b45417 0 g
pick 68c46b4927ce 1 h
pick 51281e65ba79 2 i
# Edit history between 2a4042b45417 and 51281e65ba79
#
Adrian Zgorzałek
histedit: clarify description of fold command...
r20503 # Commits are listed from least to most recent
#
liscju
histedit: adds hint how to reorder changesets at editor (issue3766)
r28396 # You can reorder changesets by reordering the lines
#
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 # Commands:
timeless
histedit: prefer edit commit, edit message, use commit...
r27674 #
# e, edit = use commit, but stop for amending
# m, mess = edit commit message without changing commit content
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 # p, pick = use commit
Saurabh Singh
histedit: removing the experimental config 'histeditng'...
r34490 # b, base = checkout changeset and apply further changesets from there
timeless
histedit: prefer edit commit, edit message, use commit...
r27674 # d, drop = remove commit from history
Matt Mackall
histedit: shorten new fold message...
r20511 # f, fold = use commit, but combine it with the one above
Ben Schmidt
histedit: modify rollup to discard date from the rollup commit (issue4820)...
r31056 # r, roll = like fold, but discard this commit's description and date
Mads Kiilerich
tests: convert histedit tests to .t...
r17085 #
$ cd ..
FUJIWARA Katsunori
histedit: make "hg histedit" sensitive to branch in URL...
r18995
test sensitivity to branch in URL:
$ cd r2
$ hg -q update 2
$ hg -q branch foo
$ hg commit -m 'create foo branch'
$ HGEDITOR=cat hg histedit --outgoing '../r#foo' | grep -v comparing | grep -v searching
pick f26599ee3441 6 create foo branch
# Edit history between f26599ee3441 and f26599ee3441
#
Adrian Zgorzałek
histedit: clarify description of fold command...
r20503 # Commits are listed from least to most recent
#
liscju
histedit: adds hint how to reorder changesets at editor (issue3766)
r28396 # You can reorder changesets by reordering the lines
#
FUJIWARA Katsunori
histedit: make "hg histedit" sensitive to branch in URL...
r18995 # Commands:
timeless
histedit: prefer edit commit, edit message, use commit...
r27674 #
# e, edit = use commit, but stop for amending
# m, mess = edit commit message without changing commit content
FUJIWARA Katsunori
histedit: make "hg histedit" sensitive to branch in URL...
r18995 # p, pick = use commit
Saurabh Singh
histedit: removing the experimental config 'histeditng'...
r34490 # b, base = checkout changeset and apply further changesets from there
timeless
histedit: prefer edit commit, edit message, use commit...
r27674 # d, drop = remove commit from history
Matt Mackall
histedit: shorten new fold message...
r20511 # f, fold = use commit, but combine it with the one above
Ben Schmidt
histedit: modify rollup to discard date from the rollup commit (issue4820)...
r31056 # r, roll = like fold, but discard this commit's description and date
FUJIWARA Katsunori
histedit: make "hg histedit" sensitive to branch in URL...
r18995 #
FUJIWARA Katsunori
histedit: abort if there are multiple roots in "--outgoing" revisions...
r19835
test to check number of roots in outgoing revisions
$ hg -q outgoing -G --template '{node|short}({branch})' '../r'
@ f26599ee3441(foo)
o 652413bf663e(default)
|
o e860deea161a(default)
|
o 055a42cdd887(default)
$ HGEDITOR=cat hg -q histedit --outgoing '../r'
abort: there are ambiguous outgoing revisions
timeless
histedit: use single quotes in use warning
r29970 (see 'hg help histedit' for more detail)
FUJIWARA Katsunori
histedit: abort if there are multiple roots in "--outgoing" revisions...
r19835 [255]
$ hg -q update -C 2
$ echo aa >> a
$ hg -q commit -m 'another head on default'
$ hg -q outgoing -G --template '{node|short}({branch})' '../r#default'
@ 3879dc049647(default)
o 652413bf663e(default)
|
o e860deea161a(default)
|
o 055a42cdd887(default)
$ HGEDITOR=cat hg -q histedit --outgoing '../r#default'
abort: there are ambiguous outgoing revisions
timeless
histedit: use single quotes in use warning
r29970 (see 'hg help histedit' for more detail)
FUJIWARA Katsunori
histedit: abort if there are multiple roots in "--outgoing" revisions...
r19835 [255]
FUJIWARA Katsunori
histedit: make "hg histedit" sensitive to branch in URL...
r18995 $ cd ..