Rev 422: Don't spin if target directory does not exist. (#80223) in http://people.samba.org/bzr/jelmer/bzr-svn/bzr.dev
Jelmer Vernooij
jelmer at samba.org
Fri Feb 2 11:40:27 GMT 2007
At http://people.samba.org/bzr/jelmer/bzr-svn/bzr.dev
------------------------------------------------------------
revno: 422
revision-id: jelmer at samba.org-20070202113947-vbxhka9gzhvff6lg
parent: jelmer at samba.org-20070201103709-z4xm1j5cwaezzxt0
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: main
timestamp: Fri 2007-02-02 12:39:47 +0100
message:
Don't spin if target directory does not exist. (#80223)
modified:
NEWS news-20061231030336-h9fhq245ie0de8bs-1
convert.py svn2bzr.py-20051018015439-cb4563bff29e632d
tests/test_convert.py test_convert.py-20060705203611-b1l0bapeku6foco0-1
=== modified file 'NEWS'
--- a/NEWS 2007-02-01 10:37:09 +0000
+++ b/NEWS 2007-02-02 11:39:47 +0000
@@ -10,6 +10,9 @@
* Implemented Repository.get_revision_graph(None)
+ * svn-import will no longer spin using CPU if the target directory
+ did not exist (#80223).
+
IMPROVEMENTS
* A proper warning will now be printed if no sqlite implementation is
=== modified file 'convert.py'
--- a/convert.py 2007-01-29 18:50:19 +0000
+++ b/convert.py 2007-02-02 11:39:47 +0000
@@ -87,6 +87,7 @@
dirs = {}
to_transport = get_transport(output_url)
+ to_transport.stat('.')
def get_dir(path):
if dirs.has_key(path):
return dirs[path]
=== modified file 'tests/test_convert.py'
--- a/tests/test_convert.py 2007-01-10 05:24:56 +0000
+++ b/tests/test_convert.py 2007-02-02 11:39:47 +0000
@@ -16,7 +16,7 @@
from bzrlib.branch import Branch
from bzrlib.bzrdir import BzrDir
-from bzrlib.errors import NotBranchError
+from bzrlib.errors import NotBranchError, NoSuchFile
from bzrlib.repository import Repository
from bzrlib.tests import TestCase, TestCaseInTempDir
from bzrlib.trace import mutter
@@ -169,6 +169,9 @@
self.assertTrue(os.path.isdir(os.path.join(self.test_dir, "e", "trunk")))
self.assertTrue(os.path.isdir(os.path.join(self.test_dir, "e", "branches", "abranch")))
+ def test_convert_to_nonexistant(self):
+ self.assertRaises(NoSuchFile, convert_repository,"svn+"+self.repos_url, os.path.join(self.test_dir, "e", "foo", "bar"), TrunkBranchingScheme())
+
def test_notshared_import(self):
convert_repository("svn+"+self.repos_url, "e", TrunkBranchingScheme(),
False)
@@ -284,3 +287,5 @@
branch = Branch.open(os.path.join(self.test_dir, "e", "trunk"))
self.assertEqual("file://%s/e/trunk" % self.test_dir, branch.base.rstrip("/"))
self.assertEqual(generate_svn_revision_id("6987ef2d-cd6b-461f-9991-6f1abef3bd59", 1, 'trunk'), branch.last_revision())
+
+
More information about the bazaar-commits
mailing list