2014-08-06 20:43:59 +04:00
|
|
|
#require killdaemons
|
2010-09-26 22:44:49 +04:00
|
|
|
|
|
|
|
$ hg init test
|
|
|
|
$ cd test
|
|
|
|
$ echo a > a
|
|
|
|
$ hg ci -Ama
|
|
|
|
adding a
|
|
|
|
$ cd ..
|
|
|
|
$ hg clone test test2
|
|
|
|
updating to branch default
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ cd test2
|
|
|
|
$ echo a >> a
|
|
|
|
$ hg ci -mb
|
|
|
|
$ req() {
|
2010-10-16 20:09:01 +04:00
|
|
|
> hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
|
|
|
|
> cat hg.pid >> $DAEMON_PIDS
|
|
|
|
> hg --cwd ../test2 push http://localhost:$HGPORT/
|
2012-09-05 18:58:43 +04:00
|
|
|
> exitstatus=$?
|
2015-06-08 22:55:40 +03:00
|
|
|
> killdaemons.py
|
2010-10-16 20:09:01 +04:00
|
|
|
> echo % serve errors
|
|
|
|
> cat errors.log
|
2012-09-05 18:58:43 +04:00
|
|
|
> return $exitstatus
|
2010-09-26 22:44:49 +04:00
|
|
|
> }
|
|
|
|
$ cd ../test
|
|
|
|
|
|
|
|
expect ssl error
|
|
|
|
|
|
|
|
$ req
|
2010-10-09 07:36:11 +04:00
|
|
|
pushing to http://localhost:$HGPORT/
|
2010-09-26 22:44:49 +04:00
|
|
|
searching for changes
|
2012-09-05 18:59:27 +04:00
|
|
|
abort: HTTP Error 403: ssl required
|
2010-09-26 22:44:49 +04:00
|
|
|
% serve errors
|
2012-09-05 18:59:27 +04:00
|
|
|
[255]
|
2010-09-26 22:44:49 +04:00
|
|
|
|
|
|
|
expect authorization error
|
|
|
|
|
|
|
|
$ echo '[web]' > .hg/hgrc
|
|
|
|
$ echo 'push_ssl = false' >> .hg/hgrc
|
|
|
|
$ req
|
2010-10-09 07:36:11 +04:00
|
|
|
pushing to http://localhost:$HGPORT/
|
2010-09-26 22:44:49 +04:00
|
|
|
searching for changes
|
|
|
|
abort: authorization failed
|
|
|
|
% serve errors
|
2012-09-05 18:58:43 +04:00
|
|
|
[255]
|
2010-09-26 22:44:49 +04:00
|
|
|
|
|
|
|
expect authorization error: must have authorized user
|
|
|
|
|
|
|
|
$ echo 'allow_push = unperson' >> .hg/hgrc
|
|
|
|
$ req
|
2010-10-09 07:36:11 +04:00
|
|
|
pushing to http://localhost:$HGPORT/
|
2010-09-26 22:44:49 +04:00
|
|
|
searching for changes
|
|
|
|
abort: authorization failed
|
|
|
|
% serve errors
|
2012-09-05 18:58:43 +04:00
|
|
|
[255]
|
2010-09-26 22:44:49 +04:00
|
|
|
|
|
|
|
expect success
|
|
|
|
|
|
|
|
$ echo 'allow_push = *' >> .hg/hgrc
|
|
|
|
$ echo '[hooks]' >> .hg/hgrc
|
2015-06-08 23:10:15 +03:00
|
|
|
$ echo "changegroup = printenv.py changegroup 0" >> .hg/hgrc
|
|
|
|
$ echo "pushkey = printenv.py pushkey 0" >> .hg/hgrc
|
2010-09-26 22:44:49 +04:00
|
|
|
$ req
|
2010-10-09 07:36:11 +04:00
|
|
|
pushing to http://localhost:$HGPORT/
|
2010-09-26 22:44:49 +04:00
|
|
|
searching for changes
|
|
|
|
remote: adding changesets
|
|
|
|
remote: adding manifests
|
|
|
|
remote: adding file changes
|
|
|
|
remote: added 1 changesets with 1 changes to 1 files
|
2015-05-27 22:55:32 +03:00
|
|
|
remote: pushkey hook: HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 HG_RET=1
|
2016-01-06 04:37:59 +03:00
|
|
|
remote: changegroup hook: HG_BUNDLE2=1 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:http:127.0.0.1: (glob)
|
2010-09-26 22:44:49 +04:00
|
|
|
% serve errors
|
|
|
|
$ hg rollback
|
2011-02-10 11:03:06 +03:00
|
|
|
repository tip rolled back to revision 0 (undo serve)
|
2010-09-26 22:44:49 +04:00
|
|
|
|
2011-04-30 21:04:37 +04:00
|
|
|
expect success, server lacks the httpheader capability
|
|
|
|
|
|
|
|
$ CAP=httpheader
|
|
|
|
$ . "$TESTDIR/notcapable"
|
|
|
|
$ req
|
|
|
|
pushing to http://localhost:$HGPORT/
|
|
|
|
searching for changes
|
|
|
|
remote: adding changesets
|
|
|
|
remote: adding manifests
|
|
|
|
remote: adding file changes
|
|
|
|
remote: added 1 changesets with 1 changes to 1 files
|
2015-05-27 22:55:32 +03:00
|
|
|
remote: pushkey hook: HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 HG_RET=1
|
2016-01-06 04:37:59 +03:00
|
|
|
remote: changegroup hook: HG_BUNDLE2=1 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:http:127.0.0.1: (glob)
|
2011-04-30 21:04:37 +04:00
|
|
|
% serve errors
|
|
|
|
$ hg rollback
|
|
|
|
repository tip rolled back to revision 0 (undo serve)
|
|
|
|
|
2011-04-16 22:15:47 +04:00
|
|
|
expect success, server lacks the unbundlehash capability
|
|
|
|
|
2011-04-25 14:00:30 +04:00
|
|
|
$ CAP=unbundlehash
|
|
|
|
$ . "$TESTDIR/notcapable"
|
2011-04-16 22:15:47 +04:00
|
|
|
$ req
|
|
|
|
pushing to http://localhost:$HGPORT/
|
|
|
|
searching for changes
|
|
|
|
remote: adding changesets
|
|
|
|
remote: adding manifests
|
|
|
|
remote: adding file changes
|
|
|
|
remote: added 1 changesets with 1 changes to 1 files
|
2015-05-27 22:55:32 +03:00
|
|
|
remote: pushkey hook: HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 HG_RET=1
|
2016-01-06 04:37:59 +03:00
|
|
|
remote: changegroup hook: HG_BUNDLE2=1 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:http:127.0.0.1: (glob)
|
2011-04-16 22:15:47 +04:00
|
|
|
% serve errors
|
|
|
|
$ hg rollback
|
|
|
|
repository tip rolled back to revision 0 (undo serve)
|
|
|
|
|
2012-10-16 01:37:34 +04:00
|
|
|
expect push success, phase change failure
|
|
|
|
|
2012-10-19 17:03:35 +04:00
|
|
|
$ cat > .hg/hgrc <<EOF
|
|
|
|
> [web]
|
|
|
|
> push_ssl = false
|
|
|
|
> allow_push = *
|
|
|
|
> [hooks]
|
2015-06-08 23:10:15 +03:00
|
|
|
> prepushkey = printenv.py prepushkey 1
|
2012-10-19 17:03:35 +04:00
|
|
|
> EOF
|
2012-10-16 01:37:34 +04:00
|
|
|
$ req
|
|
|
|
pushing to http://localhost:$HGPORT/
|
|
|
|
searching for changes
|
|
|
|
remote: adding changesets
|
|
|
|
remote: adding manifests
|
|
|
|
remote: adding file changes
|
|
|
|
remote: added 1 changesets with 1 changes to 1 files
|
2016-01-06 04:37:59 +03:00
|
|
|
remote: prepushkey hook: HG_BUNDLE2=1 HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_OLD=1 HG_PENDING=$TESTTMP/test HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:http:127.0.0.1: (glob)
|
2015-05-27 22:55:32 +03:00
|
|
|
remote: pushkey-abort: prepushkey hook exited with status 1
|
2015-05-28 08:25:51 +03:00
|
|
|
remote: transaction abort!
|
|
|
|
remote: rollback completed
|
|
|
|
abort: updating ba677d0156c1 to public failed
|
2012-10-16 01:37:34 +04:00
|
|
|
% serve errors
|
2015-05-28 08:25:51 +03:00
|
|
|
[255]
|
2012-10-16 01:37:34 +04:00
|
|
|
|
|
|
|
expect phase change success
|
|
|
|
|
2015-06-08 23:10:15 +03:00
|
|
|
$ echo "prepushkey = printenv.py prepushkey 0" >> .hg/hgrc
|
2012-10-16 01:37:34 +04:00
|
|
|
$ req
|
|
|
|
pushing to http://localhost:$HGPORT/
|
|
|
|
searching for changes
|
2015-05-28 08:25:51 +03:00
|
|
|
remote: adding changesets
|
|
|
|
remote: adding manifests
|
|
|
|
remote: adding file changes
|
|
|
|
remote: added 1 changesets with 1 changes to 1 files
|
2016-01-06 04:37:59 +03:00
|
|
|
remote: prepushkey hook: HG_BUNDLE2=1 HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_OLD=1 HG_PENDING=$TESTTMP/test HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:http:127.0.0.1: (glob)
|
2012-10-16 01:37:34 +04:00
|
|
|
% serve errors
|
|
|
|
$ hg rollback
|
|
|
|
repository tip rolled back to revision 0 (undo serve)
|
|
|
|
|
2010-09-26 22:44:49 +04:00
|
|
|
expect authorization error: all users denied
|
|
|
|
|
|
|
|
$ echo '[web]' > .hg/hgrc
|
|
|
|
$ echo 'push_ssl = false' >> .hg/hgrc
|
|
|
|
$ echo 'deny_push = *' >> .hg/hgrc
|
|
|
|
$ req
|
2010-10-09 07:36:11 +04:00
|
|
|
pushing to http://localhost:$HGPORT/
|
2010-09-26 22:44:49 +04:00
|
|
|
searching for changes
|
|
|
|
abort: authorization failed
|
|
|
|
% serve errors
|
2012-09-05 18:58:43 +04:00
|
|
|
[255]
|
2010-09-26 22:44:49 +04:00
|
|
|
|
|
|
|
expect authorization error: some users denied, users must be authenticated
|
|
|
|
|
|
|
|
$ echo 'deny_push = unperson' >> .hg/hgrc
|
|
|
|
$ req
|
2010-10-09 07:36:11 +04:00
|
|
|
pushing to http://localhost:$HGPORT/
|
2010-09-26 22:44:49 +04:00
|
|
|
searching for changes
|
|
|
|
abort: authorization failed
|
|
|
|
% serve errors
|
2012-09-05 18:58:43 +04:00
|
|
|
[255]
|
2012-06-11 03:40:51 +04:00
|
|
|
|
|
|
|
$ cd ..
|