Newer
Older
$ hg clone http://localhost:$HGPORT/ copy
abort: * (glob)
[100]
$ test -d copy
[1]
This server doesn't do range requests so it's basically only good for
one pull
$ "$PYTHON" "$TESTDIR/dumbhttp.py" -p $HGPORT --pid dumb.pid \
> --logfile server.log
$ echo c2 > '.dotfile with spaces'
$ hg add
adding .dotfile with spaces
adding bar
changeset: 0:02770d679fb8
tag: tip
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: test
$ cd ..
$ hg clone static-http://localhost:$HGPORT/remote local
requesting all changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 2 changes to 2 files
Denis Laxalde
committed
new changesets 02770d679fb8
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cat server.log
$LOCALIP - - [$LOGDATE$] "GET /remote/.hg/requires HTTP/1.1" 200 - (glob)
$LOCALIP - - [$LOGDATE$] "GET /remote/.hg/store/requires HTTP/1.1" 200 - (glob)
$LOCALIP - - [$LOGDATE$] "GET /remote/.hg/store/00manifest.i HTTP/1.1" 200 - (glob)
$LOCALIP - - [$LOGDATE$] "GET /remote/.hg/store/00changelog.i HTTP/1.1" 200 - (glob)
$LOCALIP - - [$LOGDATE$] "GET /remote/.hg/dirstate HTTP/1.1" 200 - (glob)
$LOCALIP - - [$LOGDATE$] "GET /remote/.hg/store/00changelog.i HTTP/1.1" 200 - (glob)
$LOCALIP - - [*] code 404, message File not found (glob)
$LOCALIP - - [$LOGDATE$] "GET /remote/.hg/bookmarks HTTP/1.1" 404 - (glob)
$LOCALIP - - [*] code 404, message File not found (glob)
$LOCALIP - - [$LOGDATE$] "GET /remote/.hg/bookmarks.current HTTP/1.1" 404 - (glob)
$LOCALIP - - [*] code 404, message File not found (glob)
$LOCALIP - - [$LOGDATE$] "GET /remote/.hg/cache/hgtagsfnodes1 HTTP/1.1" 404 - (glob)
$LOCALIP - - [$LOGDATE$] "GET /remote/.hg/store/00changelog.d HTTP/1.1" 200 - (glob)
$LOCALIP - - [$LOGDATE$] "GET /remote/.hg/store/data/~2edotfile%20with%20spaces.i HTTP/1.1" 200 - (glob)
$LOCALIP - - [$LOGDATE$] "GET /remote/.hg/store/data/bar.i HTTP/1.1" 200 - (glob)
$ cat bar
foo
$ cd ../remote
$ echo baz > quux
$ hg commit -A -mtest2
adding quux
check for HTTP opener failures when cachefile does not exist
$ rm .hg/cache/*
$ cat >> .hg/hgrc <<EOF
> [hooks]
> changegroup = sh -c "printenv.py --line changegroup"
pulling from static-http://localhost:$HGPORT/remote
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
Denis Laxalde
committed
new changesets 4ac2e3648604
changegroup hook: HG_HOOKNAME=changegroup
HG_HOOKTYPE=changegroup
HG_NODE=4ac2e3648604439c580c69b09ec9d93a88d93432
HG_NODE_LAST=4ac2e3648604439c580c69b09ec9d93a88d93432
HG_SOURCE=pull
HG_TXNID=TXN:$ID$
HG_TXNNAME=pull
http://localhost:$HGPORT/remote
HG_URL=http://localhost:$HGPORT/remote
(run 'hg update' to get a working copy)
trying to push
$ hg update
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo more foo >> bar
$ hg commit -m"test"
$ hg push
pushing to static-http://localhost:$HGPORT/remote
abort: destination does not support push
[255]
trying clone -r
$ cd ..
$ hg clone -r doesnotexist static-http://localhost:$HGPORT/remote local0

Martin von Zweigbergk
committed
abort: unknown revision 'doesnotexist'
$ hg clone -r 0 static-http://localhost:$HGPORT/remote local0
adding changesets
adding manifests
adding file changes
added 1 changesets with 2 changes to 2 files
Denis Laxalde
committed
new changesets 02770d679fb8
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
test with "/" URI (issue747) and subrepo
$ touch sub/test
$ hg -R sub commit -A -m "test"
adding test
$ hg -R sub tag not-empty
$ echo sub=sub > .hgsub
$ hg add a .hgsub
$ hg -q ci -ma
$ hg clone static-http://localhost:$HGPORT/ local2
requesting all changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 3 changes to 3 files
Denis Laxalde
committed
new changesets a9ebfbe8e587
cloning subrepo sub from static-http://localhost:$HGPORT/sub
requesting all changes
adding changesets
adding manifests
adding file changes
added 2 changesets with 2 changes to 2 files
Denis Laxalde
committed
new changesets be090ea66256:322ea90975df
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
default = static-http://localhost:$HGPORT/
test with empty repo (issue965)
$ cd ..
$ hg init remotempty
$ hg clone static-http://localhost:$HGPORT/remotempty local3
no changes found
updating to branch default
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd local3
default = static-http://localhost:$HGPORT/remotempty
test autodetecting static-http: scheme (issue6833)
$ cd ..
$ hg init actually-static
$ hg clone http://localhost:$HGPORT/actually-static local4
no changes found
updating to branch default
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
test with non-repo
$ mkdir notarepo
$ hg clone static-http://localhost:$HGPORT/notarepo local3

Martin von Zweigbergk
committed
abort: 'http://localhost:$HGPORT/notarepo' does not appear to be an hg repository
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
Clone with tags and branches works
$ hg init remote-with-names
$ cd remote-with-names
$ echo 0 > foo
$ hg -q commit -A -m initial
$ echo 1 > foo
$ hg commit -m 'commit 1'
$ hg -q up 0
$ hg branch mybranch
marked working directory as branch mybranch
(branches are permanent and global, did you want a bookmark?)
$ echo 2 > foo
$ hg commit -m 'commit 2 (mybranch)'
$ hg tag -r 1 'default-tag'
$ hg tag -r 2 'branch-tag'
$ cd ..
$ hg clone static-http://localhost:$HGPORT/remote-with-names local-with-names
requesting all changes
adding changesets
adding manifests
adding file changes
added 5 changesets with 5 changes to 2 files (+1 heads)
Denis Laxalde
committed
new changesets 68986213bd44:0c325bd2b5a7
updating to branch default
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
Clone a specific branch works
$ hg clone -r mybranch static-http://localhost:$HGPORT/remote-with-names local-with-names-branch
adding changesets
adding manifests
adding file changes
added 4 changesets with 4 changes to 2 files
Denis Laxalde
committed
new changesets 68986213bd44:0c325bd2b5a7
updating to branch mybranch
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
Clone a specific tag works
$ hg clone -r default-tag static-http://localhost:$HGPORT/remote-with-names local-with-names-tag
adding changesets
adding manifests
adding file changes
added 2 changesets with 2 changes to 1 files
Denis Laxalde
committed
new changesets 68986213bd44:4ee3fcef1c80
updating to branch default
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
List of files accessed over HTTP:
$ cat server.log | sed -n -e 's|.*GET \(/[^ ]*\).*|\1|p' | sort -u
/.hg/bookmarks
/.hg/bookmarks.current
/.hg/cache/hgtagsfnodes1

Pierre-Yves David
committed
/.hg/dirstate
/.hg/store/00changelog.i
/.hg/store/00manifest.i
/.hg/store/data/a.i
/.hg/store/data/~2ehgsub.i
/.hg/store/data/~2ehgsubstate.i
/actually-static/.hg/bookmarks
/actually-static/.hg/bookmarks.current
/actually-static/.hg/dirstate
/actually-static/.hg/requires
/actually-static/.hg/store/00changelog.i
/actually-static/.hg/store/00manifest.i
/actually-static/.hg/store/requires
/actually-static/?cmd=capabilities
/actually-static?cmd=capabilities
/notarepo/.hg/00changelog.i
/notarepo/.hg/requires
/remote-with-names/.hg/bookmarks
/remote-with-names/.hg/bookmarks.current
/remote-with-names/.hg/cache/branch2-served
/remote-with-names/.hg/cache/hgtagsfnodes1
/remote-with-names/.hg/cache/tags2-served

Pierre-Yves David
committed
/remote-with-names/.hg/dirstate
/remote-with-names/.hg/localtags
/remote-with-names/.hg/requires
/remote-with-names/.hg/store/00changelog.d
/remote-with-names/.hg/store/00changelog.i
/remote-with-names/.hg/store/00manifest.i
/remote-with-names/.hg/store/data/foo.i
/remote-with-names/.hg/store/data/~2ehgtags.i
/remote-with-names/.hg/store/obsstore
/remote-with-names/.hg/store/requires
/remote/.hg/bookmarks
/remote/.hg/bookmarks.current
/remote/.hg/cache/branch2-base
/remote/.hg/cache/branch2-immutable
/remote/.hg/cache/branch2-served
/remote/.hg/cache/hgtagsfnodes1
/remote/.hg/cache/rbc-names-v1
/remote/.hg/cache/rbc-names-v2
/remote/.hg/cache/tags2-served

Pierre-Yves David
committed
/remote/.hg/dirstate
/remote/.hg/localtags
/remote/.hg/requires
/remote/.hg/store/00changelog.i
/remote/.hg/store/00manifest.i
/remote/.hg/store/data/bar.i
/remote/.hg/store/data/quux.i
/remote/.hg/store/data/~2edotfile%20with%20spaces.i
/remote/.hg/store/data/~2ehgtags.i
/remote/.hg/store/obsstore
/remotempty/.hg/bookmarks
/remotempty/.hg/bookmarks.current

Pierre-Yves David
committed
/remotempty/.hg/dirstate
/remotempty/.hg/requires
/remotempty/.hg/store/00changelog.i
/remotempty/.hg/store/00manifest.i
/sub/.hg/bookmarks
/sub/.hg/bookmarks.current
/sub/.hg/cache/hgtagsfnodes1

Pierre-Yves David
committed
/sub/.hg/dirstate
/sub/.hg/store/00changelog.i
/sub/.hg/store/00manifest.i
/sub/.hg/store/data/test.i
/sub/.hg/store/data/~2ehgtags.i