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
|
|
|
|
|
2011-11-22 22:06:42 +04:00
|
|
|
Cloning with a password in the URL should not save the password in .hg/hgrc:
|
|
|
|
|
2018-02-08 02:18:29 +03:00
|
|
|
$ hg serve -p 0 --port-file $TESTTMP/.port -d --pid-file=hg.pid -E errors.log
|
|
|
|
$ HGPORT=`cat $TESTTMP/.port`
|
2011-11-22 22:06:42 +04:00
|
|
|
$ cat hg.pid >> $DAEMON_PIDS
|
|
|
|
$ hg clone http://foo:xyzzy@localhost:$HGPORT/ test3
|
|
|
|
requesting all changes
|
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 2 changesets with 2 changes to 1 files
|
2017-10-12 10:39:50 +03:00
|
|
|
new changesets cb9a9f314b8b:ba677d0156c1
|
2011-11-22 22:06:42 +04:00
|
|
|
updating to branch default
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ cat test3/.hg/hgrc
|
2016-09-21 02:49:00 +03:00
|
|
|
# example repository config (see 'hg help config' for more info)
|
2011-11-22 22:06:42 +04:00
|
|
|
[paths]
|
2018-02-08 02:18:29 +03:00
|
|
|
default = http://foo@localhost:$HGPORT/ (glob)
|
2014-10-07 00:35:02 +04:00
|
|
|
|
|
|
|
# path aliases to other clones of this repo in URLs or filesystem paths
|
2016-09-21 02:49:00 +03:00
|
|
|
# (see 'hg help config.paths' for more info)
|
2014-10-07 00:35:02 +04:00
|
|
|
#
|
2017-02-25 14:27:21 +03:00
|
|
|
# default:pushurl = ssh://jdoe@example.net/hg/jdoes-fork
|
|
|
|
# my-fork = ssh://jdoe@example.net/hg/jdoes-fork
|
|
|
|
# my-clone = /home/jdoe/jdoes-clone
|
2014-10-07 00:35:02 +04:00
|
|
|
|
|
|
|
[ui]
|
|
|
|
# name and email (local to this repository, optional), e.g.
|
|
|
|
# username = Jane Doe <jdoe@example.com>
|
2015-06-08 22:55:40 +03:00
|
|
|
$ killdaemons.py
|
2011-11-22 22:06:42 +04:00
|
|
|
|
2010-09-26 22:44:49 +04:00
|
|
|
expect error, cloning not allowed
|
|
|
|
|
|
|
|
$ echo '[web]' > .hg/hgrc
|
|
|
|
$ echo 'allowpull = false' >> .hg/hgrc
|
2018-02-08 02:18:29 +03:00
|
|
|
$ hg serve -p 0 --port-file $TESTTMP/.port -d --pid-file=hg.pid -E errors.log
|
|
|
|
$ HGPORT=`cat $TESTTMP/.port`
|
2010-09-26 22:44:49 +04:00
|
|
|
$ cat hg.pid >> $DAEMON_PIDS
|
2016-08-03 16:52:11 +03:00
|
|
|
$ hg clone http://localhost:$HGPORT/ test4 # bundle2+
|
2015-05-27 21:37:11 +03:00
|
|
|
requesting all changes
|
|
|
|
abort: authorization failed
|
|
|
|
[255]
|
2016-08-03 16:39:55 +03:00
|
|
|
$ hg clone http://localhost:$HGPORT/ test4 --config devel.legacy.exchange=bundle1
|
2010-09-26 22:44:49 +04:00
|
|
|
abort: authorization failed
|
|
|
|
[255]
|
2015-06-08 22:55:40 +03:00
|
|
|
$ killdaemons.py
|
2010-09-26 22:44:49 +04:00
|
|
|
|
|
|
|
serve errors
|
|
|
|
|
|
|
|
$ cat errors.log
|
|
|
|
$ req() {
|
2018-02-08 22:19:42 +03:00
|
|
|
> hg serve -p 0 --port-file .p -d --pid-file=hg.pid -E errors.log
|
|
|
|
> HGPORT=`cat .p`
|
|
|
|
> rm .p
|
2010-10-16 20:09:01 +04:00
|
|
|
> cat hg.pid >> $DAEMON_PIDS
|
|
|
|
> hg --cwd ../test pull http://localhost:$HGPORT/
|
2015-06-08 22:44:30 +03:00
|
|
|
> killdaemons.py hg.pid
|
2010-10-16 20:09:01 +04:00
|
|
|
> echo % serve errors
|
|
|
|
> cat errors.log
|
2010-09-26 22:44:49 +04:00
|
|
|
> }
|
|
|
|
|
|
|
|
expect error, pulling not allowed
|
|
|
|
|
|
|
|
$ req
|
2018-02-08 02:18:29 +03:00
|
|
|
pulling from http://localhost:$HGPORT/ (glob)
|
2015-05-30 01:18:49 +03:00
|
|
|
searching for changes
|
2010-09-26 22:44:49 +04:00
|
|
|
abort: authorization failed
|
|
|
|
% serve errors
|
2012-06-11 03:40:51 +04:00
|
|
|
|
|
|
|
$ cd ..
|