Mercurial > hg
view tests/test-hgwebdir @ 10397:8cb81d75730c
mq: add parent node IDs to MQ patches on qrefresh/qnew
The goal of this patch is to add the IDs of the parents of applied MQ patches
into the patch file headers whenever qnew or qrefresh are run.
This will serve as a reminder of when the patches last applied cleanly and
will let us do more intelligent things in the future, such as:
* Resolve conflicts found when qpushing to a new location by merging
instead of simply showing rejects.
* Display better diffs of versioned MQ patches because we can tell how the
patched files have changed in the meantime.
Here are the new rules this patch introduces. They are checked in this order:
* If a patch currently has old, plain-style patch headers ("From:" and
"Date:") do not change the style or add any new headers.
* If the 'mq.plain' configuration setting is true, only plain-style
headers will be used for all MQ patches.
* qnew will initialize new patches with HG-style headers and fill in the
"# Parent" header with the appropriate parent node.
* qrefresh will refresh the "# Parent" header with the current parent of
the current patch.
author | Steve Losh <steve@stevelosh.com> |
---|---|
date | Sun, 07 Feb 2010 10:47:54 -0500 |
parents | 8635b33eaade |
children | 6d87c20cd7a8 |
line wrap: on
line source
#!/bin/sh # Tests some basic hgwebdir functionality. Tests setting up paths and # collection, different forms of 404s and the subdirectory support. mkdir webdir cd webdir hg init a echo a > a/a hg --cwd a ci -Ama -d'1 0' # create a mercurial queue repository hg --cwd a qinit --config extensions.hgext.mq= -c hg init b echo b > b/b hg --cwd b ci -Amb -d'2 0' # create a nested repository cd b hg init d echo d > d/d hg --cwd d ci -Amd -d'3 0' cd .. hg init c echo c > c/c hg --cwd c ci -Amc -d'3 0' root=`pwd` cd .. cat > paths.conf <<EOF [paths] a=$root/a b=$root/b EOF hg serve -p $HGPORT -d --pid-file=hg.pid --webdir-conf paths.conf \ -A access-paths.log -E error-paths-1.log cat hg.pid >> $DAEMON_PIDS echo % should give a 404 - file does not exist "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/a/file/tip/bork?style=raw' echo % should succeed "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?style=raw' "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/a/file/tip/a?style=raw' "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/b/file/tip/b?style=raw' echo % should give a 404 - repo is not published "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/c/file/tip/c?style=raw' cat > paths.conf <<EOF [paths] t/a/=$root/a b=$root/b coll=$root/* rcoll=$root/** EOF hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \ -A access-paths.log -E error-paths-2.log cat hg.pid >> $DAEMON_PIDS echo % should succeed, slashy names "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/?style=raw' "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/?style=paper' \ | sed "s/[0-9]\{1,\} seconds\{0,1\} ago/seconds ago/" "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t?style=raw' "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/?style=raw' "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/?style=paper' \ | sed "s/[0-9]\{1,\} seconds\{0,1\} ago/seconds ago/" "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/a?style=atom' \ | sed "s/http:\/\/[^/]*\//http:\/\/127.0.0.1\//" "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/a/?style=atom' \ | sed "s/http:\/\/[^/]*\//http:\/\/127.0.0.1\//" "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/a/file/tip/a?style=raw' # Test [paths] '*' extension "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/coll/?style=raw' "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/coll/a/file/tip/a?style=raw' #test [paths] '**' extension "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/rcoll/?style=raw' "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/rcoll/b/d/file/tip/d?style=raw' "$TESTDIR/killdaemons.py" cat > paths.conf <<EOF [paths] t/a = $root/a t/b = $root/b c = $root/c [web] descend=false EOF hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \ -A access-paths.log -E error-paths-3.log cat hg.pid >> $DAEMON_PIDS echo % test descend = False "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/?style=raw' "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/?style=raw' cat > collections.conf <<EOF [collections] $root=$root EOF hg serve --config web.baseurl=http://hg.example.com:8080/ -p $HGPORT2 -d \ --pid-file=hg.pid --webdir-conf collections.conf \ -A access-collections.log -E error-collections.log cat hg.pid >> $DAEMON_PIDS echo % collections: should succeed "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/?style=raw' "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/file/tip/a?style=raw' "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/b/file/tip/b?style=raw' "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/c/file/tip/c?style=raw' echo % paths errors 1 cat error-paths-1.log echo % paths errors 2 cat error-paths-2.log echo % paths errors 3 cat error-paths-3.log echo % collections errors cat error-collections.log