Merge with crew
authorBrendan Cully <brendan@kublai.com>
Sat, 18 Oct 2008 13:22:46 -0700
changeset 7143 2bbdae4f39d1
parent 7142 88f1b8081f1c (current diff)
parent 7141 8d1bdaf842de (diff)
child 7146 266324983681
Merge with crew
--- a/mercurial/util.py	Sat Oct 18 13:22:29 2008 -0700
+++ b/mercurial/util.py	Sat Oct 18 13:22:46 2008 -0700
@@ -865,7 +865,9 @@
                 # handle directory not found in Python version prior to 2.5
                 # Python <= 2.4 returns native Windows code 3 in errno
                 # Python >= 2.5 returns ENOENT and adds winerror field
-                if err.errno not in (3, errno.ENOENT, errno.ENOTDIR):
+                # EINVAL is raised if dir is not a directory.
+                if err.errno not in (3, errno.ENOENT, errno.EINVAL,
+                                     errno.ENOTDIR):
                     raise
                 dmap = {}
             cache = dircache.setdefault(dir, dmap)
--- a/mercurial/verify.py	Sat Oct 18 13:22:29 2008 -0700
+++ b/mercurial/verify.py	Sat Oct 18 13:22:46 2008 -0700
@@ -28,6 +28,9 @@
     cl = repo.changelog
     mf = repo.manifest
 
+    if not repo.cancopy():
+        raise util.Abort(_("cannot verify bundle or remote repos"))
+
     def err(linkrev, msg, filename=None):
         if linkrev != None:
             badrevs[linkrev] = True
--- a/tests/run-tests.py	Sat Oct 18 13:22:29 2008 -0700
+++ b/tests/run-tests.py	Sat Oct 18 13:22:46 2008 -0700
@@ -176,7 +176,7 @@
     # Run installer in hg root
     os.chdir(os.path.join(os.path.dirname(sys.argv[0]), '..'))
     cmd = ('%s setup.py clean --all'
-           ' install --force --home="%s" --install-lib="%s"'
+           ' install --force --prefix="%s" --install-lib="%s"'
            ' --install-scripts="%s" >%s 2>&1'
            % (sys.executable, INST, PYTHONDIR, BINDIR, installerrs))
     vlog("# Running", cmd)
--- a/tests/test-bundle	Sat Oct 18 13:22:29 2008 -0700
+++ b/tests/test-bundle	Sat Oct 18 13:22:46 2008 -0700
@@ -129,3 +129,14 @@
 cd ../orig
 hg incoming ../bundle.hg
 cd ..
+
+# test for http://www.selenic.com/mercurial/bts/issue1144
+echo "===== test that verify bundle does not traceback"
+# partial history bundle, fails w/ unkown parent
+hg -R bundle.hg verify
+# full history bundle, refuses to verify non-local repo
+hg -R all.hg verify
+# but, regular verify must continue to work
+hg -R orig verify
+
+
--- a/tests/test-bundle.out	Sat Oct 18 13:22:29 2008 -0700
+++ b/tests/test-bundle.out	Sat Oct 18 13:22:46 2008 -0700
@@ -309,3 +309,11 @@
 date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     change foo
 
+===== test that verify bundle does not traceback
+abort: 00changelog.i@bbd179dfa0a7: unknown parent!
+abort: cannot verify bundle or remote repos
+checking changesets
+checking manifests
+crosschecking files in changesets and manifests
+checking files
+2 files, 2 changesets, 2 total revisions
--- a/tests/test-permissions	Sat Oct 18 13:22:29 2008 -0700
+++ b/tests/test-permissions	Sat Oct 18 13:22:46 2008 -0700
@@ -23,3 +23,5 @@
 hg status
 chmod -rx dir
 hg status
+# reenable perm to allow deletion
+chmod +rx dir