Merge with stable
authorBryan O'Sullivan <bryano@fb.com>
Mon, 22 Oct 2012 21:56:13 -0700
changeset 17853 653d2afdaf88
parent 17838 d51364b318ea (current diff)
parent 17852 1f34b57ca319 (diff)
child 17856 917a37b76845
Merge with stable
--- a/.hgsigs	Thu Jul 26 21:29:39 2012 +0200
+++ b/.hgsigs	Mon Oct 22 21:56:13 2012 -0700
@@ -59,3 +59,4 @@
 7f5094bb3f423fc799e471aac2aee81a7ce57a0b 0 iD8DBQBQGiL8ywK+sNU5EO8RAq5oAJ4rMMCPx6O+OuzNXVOexogedWz/QgCeIiIxLd76I4pXO48tdXhr0hQcBuM=
 072209ae4ddb654eb2d5fd35bff358c738414432 0 iD8DBQBQQkq0ywK+sNU5EO8RArDTAJ9nk5CySnNAjAXYvqvx4uWCw9ThZwCgqmFRehH/l+oTwj3f8nw8u8qTCdc=
 b3f0f9a39c4e1d0250048cd803ab03542d6f140a 0 iD8DBQBQamltywK+sNU5EO8RAlsqAJ4qF/m6aFu4mJCOKTiAP5RvZFK02ACfawYShUZO6OXEFfveU0aAxDR0M1k=
+d118a4f4fd16d9b558ec3f3e87bfee772861d2b7 0 iD8DBQBQgPV5ywK+sNU5EO8RArylAJ0abcx5NlDjyv3ZDWpAfRIHyRsJtQCgn4TMuEayqgxzrvadQZHdTEU2g38=
--- a/.hgtags	Thu Jul 26 21:29:39 2012 +0200
+++ b/.hgtags	Mon Oct 22 21:56:13 2012 -0700
@@ -72,3 +72,4 @@
 7f5094bb3f423fc799e471aac2aee81a7ce57a0b 2.3
 072209ae4ddb654eb2d5fd35bff358c738414432 2.3.1
 b3f0f9a39c4e1d0250048cd803ab03542d6f140a 2.3.2
+d118a4f4fd16d9b558ec3f3e87bfee772861d2b7 2.4-rc
--- a/mercurial/hg.py	Thu Jul 26 21:29:39 2012 +0200
+++ b/mercurial/hg.py	Mon Oct 22 21:56:13 2012 -0700
@@ -115,7 +115,7 @@
 
 def defaultdest(source):
     '''return default destination of clone if none is given'''
-    return os.path.basename(os.path.normpath(source))
+    return os.path.basename(os.path.normpath(util.url(source).path))
 
 def share(ui, source, dest=None, update=True):
     '''create a shared repository'''
--- a/mercurial/scmutil.py	Thu Jul 26 21:29:39 2012 +0200
+++ b/mercurial/scmutil.py	Mon Oct 22 21:56:13 2012 -0700
@@ -348,21 +348,33 @@
 
 opener = vfs
 
-class filtervfs(abstractvfs):
+class auditvfs(object):
+    def __init__(self, vfs):
+        self.vfs = vfs
+
+    def _getmustaudit(self):
+        return self.vfs.mustaudit
+
+    def _setmustaudit(self, onoff):
+        self.vfs.mustaudit = onoff
+
+    mustaudit = property(_getmustaudit, _setmustaudit)
+
+class filtervfs(abstractvfs, auditvfs):
     '''Wrapper vfs for filtering filenames with a function.'''
 
-    def __init__(self, opener, filter):
+    def __init__(self, vfs, filter):
+        auditvfs.__init__(self, vfs)
         self._filter = filter
-        self._orig = opener
 
     def __call__(self, path, *args, **kwargs):
-        return self._orig(self._filter(path), *args, **kwargs)
+        return self.vfs(self._filter(path), *args, **kwargs)
 
     def join(self, path):
         if path:
-            return self._orig.join(self._filter(path))
+            return self.vfs.join(self._filter(path))
         else:
-            return self._orig.join(path)
+            return self.vfs.join(path)
 
 filteropener = filtervfs
 
--- a/mercurial/store.py	Thu Jul 26 21:29:39 2012 +0200
+++ b/mercurial/store.py	Mon Oct 22 21:56:13 2012 -0700
@@ -436,20 +436,12 @@
             self._load()
         return iter(self.entries)
 
-class _fncachevfs(scmutil.abstractvfs):
+class _fncachevfs(scmutil.abstractvfs, scmutil.auditvfs):
     def __init__(self, vfs, fnc, encode):
-        self.vfs = vfs
+        scmutil.auditvfs.__init__(self, vfs)
         self.fncache = fnc
         self.encode = encode
 
-    def _getmustaudit(self):
-        return self.vfs.mustaudit
-
-    def _setmustaudit(self, onoff):
-        self.vfs.mustaudit = onoff
-
-    mustaudit = property(_getmustaudit, _setmustaudit)
-
     def __call__(self, path, mode='r', *args, **kw):
         if mode not in ('r', 'rb') and path.startswith('data/'):
             self.fncache.add(path)
--- a/mercurial/verify.py	Thu Jul 26 21:29:39 2012 +0200
+++ b/mercurial/verify.py	Mon Oct 22 21:56:13 2012 -0700
@@ -7,7 +7,7 @@
 
 from node import nullid, short
 from i18n import _
-import os
+import os, posixpath
 import revlog, util, error
 
 def verify(repo):
@@ -236,7 +236,12 @@
             try:
                 storefiles.remove(ff)
             except KeyError:
-                err(lr, _("missing revlog!"), ff)
+                # under hg < 2.4, convert didn't sanitize paths properly,
+                # so a converted repo may contain repeated slashes
+                try:
+                    storefiles.remove(posixpath.normpath(ff))
+                except KeyError:
+                    err(lr, _("missing revlog!"), ff)
 
         checklog(fl, f, lr)
         seen = {}
--- a/tests/test-convert-filemap.t	Thu Jul 26 21:29:39 2012 +0200
+++ b/tests/test-convert-filemap.t	Mon Oct 22 21:56:13 2012 -0700
@@ -226,10 +226,13 @@
   9a7b52012991e4873687192c3e17e61ba3e837a3 644   foo
   $ hg --cwd foo-copied.repo debugrename copied
   copied renamed from foo:2ed2a3912a0b24502043eae84ee4b279c18b90dd
+
+ensure that the filemap contains duplicated slashes (issue3612)
+
   $ cat > renames.fmap <<EOF
   > include dir
   > exclude dir/file2
-  > rename dir dir2//../dir2/
+  > rename dir dir2//dir3
   > include foo
   > include copied
   > rename foo foo2/
@@ -255,12 +258,19 @@
   |
   o  1 "1: add bar quux; copy foo to copied" files: copied2
   |
-  o  0 "0: add foo baz dir/" files: dir2/file dir2/subdir/file3 foo2
+  o  0 "0: add foo baz dir/" files: dir2/dir3/file dir2/dir3/subdir/file3 foo2
   
+  $ hg -R renames.repo verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  4 files, 5 changesets, 7 total revisions
+
   $ hg -R renames.repo manifest --debug
   d43feacba7a4f1f2080dde4a4b985bd8a0236d46 644   copied2
-  3e20847584beff41d7cd16136b7331ab3d754be0 644   dir2/file
-  5fe139720576e18e34bcc9f79174db8897c8afe9 644   dir2/subdir/file3
+  3e20847584beff41d7cd16136b7331ab3d754be0 644   dir2/dir3/file
+  5fe139720576e18e34bcc9f79174db8897c8afe9 644   dir2/dir3/subdir/file3
   9a7b52012991e4873687192c3e17e61ba3e837a3 644   foo2
   $ hg --cwd renames.repo debugrename copied2
   copied2 renamed from foo2:2ed2a3912a0b24502043eae84ee4b279c18b90dd
--- a/tests/test-largefiles.t	Thu Jul 26 21:29:39 2012 +0200
+++ b/tests/test-largefiles.t	Mon Oct 22 21:56:13 2012 -0700
@@ -1663,7 +1663,7 @@
 
   $ hg -q clone src clone2
   $ hg -R clone2 paths | grep default
-  default = $TESTTMP/issue3651/src
+  default = $TESTTMP/issue3651/src (glob)
 
   $ hg -R clone2 summary --large
   parent: 0:fc0bd45326d3 tip
@@ -1674,7 +1674,7 @@
   searching for changes
   largefiles: (no files to upload)
   $ hg -R clone2 outgoing --large
-  comparing with $TESTTMP/issue3651/src
+  comparing with $TESTTMP/issue3651/src (glob)
   searching for changes
   no changes found
   searching for changes
@@ -1697,7 +1697,7 @@
   searching for changes
   largefiles: 1 to upload
   $ hg -R clone2 outgoing --large
-  comparing with $TESTTMP/issue3651/src
+  comparing with $TESTTMP/issue3651/src (glob)
   searching for changes
   changeset:   1:1acbe71ce432
   tag:         tip
--- a/tests/test-push-http.t	Thu Jul 26 21:29:39 2012 +0200
+++ b/tests/test-push-http.t	Mon Oct 22 21:56:13 2012 -0700
@@ -109,11 +109,13 @@
 
 expect push success, phase change failure
 
-  $ echo '[web]' > .hg/hgrc
-  $ echo 'push_ssl = false' >> .hg/hgrc
-  $ echo 'allow_push = *' >> .hg/hgrc
-  $ echo '[hooks]' >> .hg/hgrc
-  $ echo 'prepushkey = python "$TESTDIR/printenv.py" prepushkey 1' >> .hg/hgrc
+  $ cat > .hg/hgrc <<EOF
+  > [web]
+  > push_ssl = false
+  > allow_push = *
+  > [hooks]
+  > prepushkey = python "$TESTDIR/printenv.py" prepushkey 1
+  > EOF
   $ req
   pushing to http://localhost:$HGPORT/
   searching for changes
@@ -127,7 +129,7 @@
 
 expect phase change success
 
-  $ echo 'prepushkey = python "$TESTDIR/printenv.py" prepushkey 0' >> .hg/hgrc
+  $ echo "prepushkey = python \"$TESTDIR/printenv.py\" prepushkey 0" >> .hg/hgrc
   $ req
   pushing to http://localhost:$HGPORT/
   searching for changes
--- a/tests/test-ssh.t	Thu Jul 26 21:29:39 2012 +0200
+++ b/tests/test-ssh.t	Mon Oct 22 21:56:13 2012 -0700
@@ -284,6 +284,13 @@
   $ hg id --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
   73649e48688a
 
+Test (non-)escaping of remote paths with spaces when cloning (issue3145):
+
+  $ hg clone --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
+  destination directory: a repo
+  abort: destination 'a repo' is not empty
+  [255]
+
 Test hg-ssh using a helper script that will restore PYTHONPATH (which might
 have been cleared by a hg.exe wrapper) and invoke hg-ssh with the right
 parameters:
@@ -374,3 +381,4 @@
   Got arguments 1:user@dummy 2:hg init 'a repo'
   Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
   Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
+  Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio