changeset 18554:1516d5624a29

merge with stable
author Matt Mackall <mpm@selenic.com>
date Mon, 04 Feb 2013 16:39:02 -0600
parents d6fb7bbec16a (current diff) b6b9475c563a (diff)
children 8113077f84e0
files tests/test-largefiles.t
diffstat 5 files changed, 27 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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'''
--- 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)()
--- 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)
--- 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
 
--- 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