# HG changeset patch # User Matt Mackall # Date 1360017542 21600 # Node ID 1516d5624a2911fcb90ee051c6dc0679b49aef55 # Parent d6fb7bbec16a43f7e2c34a35b50468e9dcea237e# Parent b6b9475c563a3c8ad3b24e2602424a00a7ea2c56 merge with stable diff -r d6fb7bbec16a -r 1516d5624a29 mercurial/hg.py --- a/mercurial/hg.py Sat Feb 02 16:15:22 2013 -0600 +++ b/mercurial/hg.py Mon Feb 04 16:39:02 2013 -0600 @@ -122,7 +122,7 @@ def defaultdest(source): '''return default destination of clone if none is given''' - return os.path.basename(os.path.normpath(util.url(source).path)) + return os.path.basename(os.path.normpath(util.url(source).path or '')) def share(ui, source, dest=None, update=True): '''create a shared repository''' diff -r d6fb7bbec16a -r 1516d5624a29 mercurial/hgweb/wsgicgi.py --- a/mercurial/hgweb/wsgicgi.py Sat Feb 02 16:15:22 2013 -0600 +++ b/mercurial/hgweb/wsgicgi.py Mon Feb 04 16:39:02 2013 -0600 @@ -77,5 +77,7 @@ try: for chunk in content: write(chunk) + if not headers_sent: + write('') # send headers now if body was empty finally: getattr(content, 'close', lambda : None)() diff -r d6fb7bbec16a -r 1516d5624a29 tests/test-clone-cgi.t --- a/tests/test-clone-cgi.t Sat Feb 02 16:15:22 2013 -0600 +++ b/tests/test-clone-cgi.t Mon Feb 04 16:39:02 2013 -0600 @@ -29,3 +29,11 @@ $ python hgweb.cgi >page1 2>&1 $ python "$TESTDIR/md5sum.py" page1 1f424bb22ec05c3c6bc866b6e67efe43 page1 + +make sure headers are sent even when there is no body + + $ QUERY_STRING="cmd=listkeys&namespace=nosuchnamespace" python hgweb.cgi + Status: 200 Script output follows\r (esc) + Content-Type: application/mercurial-0.1\r (esc) + Content-Length: 0\r (esc) + \r (esc) diff -r d6fb7bbec16a -r 1516d5624a29 tests/test-hgweb-commands.t --- a/tests/test-hgweb-commands.t Sat Feb 02 16:15:22 2013 -0600 +++ b/tests/test-hgweb-commands.t Mon Feb 04 16:39:02 2013 -0600 @@ -1376,13 +1376,20 @@ $ . "$TESTDIR/cgienv" $ PATH_INFO=/bookmarks; export PATH_INFO $ QUERY_STRING='style=raw' - $ python hgweb.cgi + $ python hgweb.cgi | grep -v ETag: + Status: 200 Script output follows\r (esc) + Content-Type: text/plain; charset=ascii\r (esc) + \r (esc) listbookmarks hides secret bookmarks $ PATH_INFO=/; export PATH_INFO $ QUERY_STRING='cmd=listkeys&namespace=bookmarks' $ python hgweb.cgi + Status: 200 Script output follows\r (esc) + Content-Type: application/mercurial-0.1\r (esc) + Content-Length: 0\r (esc) + \r (esc) search works with filtering diff -r d6fb7bbec16a -r 1516d5624a29 tests/test-largefiles.t --- a/tests/test-largefiles.t Sat Feb 02 16:15:22 2013 -0600 +++ b/tests/test-largefiles.t Mon Feb 04 16:39:02 2013 -0600 @@ -831,6 +831,8 @@ commit: (clean) update: 8 new changesets (update) +Show computed destination directory: + $ mkdir xyz $ cd xyz $ hg clone ../a @@ -841,6 +843,12 @@ 5 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd .. +Clone URL without path: + + $ hg clone file:// + abort: repository / not found! + [255] + Ensure base clone command argument validation $ hg clone -U -u 0 a a-clone-failure