Mercurial > hg > hg-git
changeset 925:7c80e9f8131f
init: fix default hg breakage by returning the right type
Originally, I copied the logic for the file scheme which calls
_peerlookup(path) but in mercurial/hg.py they have:
try:
return thing(path)
except TypeError:
return thing
So, our http(s) scheme broke default Mercurial because I tried returning
thing(path) instead of just thing. A test has been added to catch this.
author | Sean Farley <sean@farley.io> |
---|---|
date | Fri, 17 Jul 2015 11:25:00 -0700 |
parents | e28affca64de |
children | 02f69ab61c82 |
files | hggit/__init__.py tests/test-http.t |
diffstat | 2 files changed, 46 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/hggit/__init__.py +++ b/hggit/__init__.py @@ -116,7 +116,8 @@ if uri.endswith('.git'): return gitrepo - return orig(uri) + # the http(s) scheme just returns the _peerlookup + return orig return httpgitscheme
new file mode 100644 --- /dev/null +++ b/tests/test-http.t @@ -0,0 +1,44 @@ +#require serve + + $ hg init test + $ cd test + $ echo foo>foo + $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg + $ echo foo>foo.d/foo + $ echo bar>foo.d/bAr.hg.d/BaR + $ echo bar>foo.d/baR.d.hg/bAR + $ hg commit -A -m 1 + adding foo + adding foo.d/bAr.hg.d/BaR + adding foo.d/baR.d.hg/bAR + adding foo.d/foo + $ hg serve -p $HGPORT -d --pid-file=../hg1.pid -E ../error.log + $ hg --config server.uncompressed=False serve -p $HGPORT1 -d --pid-file=../hg2.pid + +Test server address cannot be reused + +#if windows + $ hg serve -p $HGPORT1 2>&1 + abort: cannot start server at ':$HGPORT1': * (glob) + [255] +#else + $ hg serve -p $HGPORT1 2>&1 + abort: cannot start server at ':$HGPORT1': Address already in use + [255] +#endif + $ cd .. + $ cat hg1.pid hg2.pid >> $DAEMON_PIDS + +Load commonly used test logic + $ . "$TESTDIR/testutil" + +Make sure that clone regular mercurial repos over http doesn't break + + $ hg clone http://localhost:$HGPORT/ copy 2>&1 + requesting all changes + adding changesets + adding manifests + adding file changes + added 1 changesets with 4 changes to 4 files + updating to branch default + 4 files updated, 0 files merged, 0 files removed, 0 files unresolved