[Pkg-bazaar-commits] ./bzr/unstable r754: - new check for attempting to add a file in an unversioned
Martin Pool
mbp at sourcefrog.net
Fri Apr 10 08:20:56 UTC 2009
------------------------------------------------------------
revno: 754
committer: Martin Pool <mbp at sourcefrog.net>
timestamp: Wed 2005-06-22 18:12:49 +1000
message:
- new check for attempting to add a file in an unversioned
subdirectory
modified:
bzrlib/selftest/versioning.py
-------------- next part --------------
=== modified file 'bzrlib/selftest/versioning.py'
--- a/bzrlib/selftest/versioning.py 2005-06-22 07:56:51 +0000
+++ b/bzrlib/selftest/versioning.py 2005-06-22 08:12:49 +0000
@@ -42,3 +42,25 @@
self.assertEquals(delta.added[0][0], 'foo')
self.failIf(delta.modified)
+
+
+class AddInUnversioned(InTempDir):
+ def runTest(self):
+ """Try to add a file in an unversioned directory.
+
+ smart_add may eventually add the parent as necessary, but simple
+ branch add doesn't do that.
+ """
+ from bzrlib.branch import Branch
+ import os
+ from bzrlib.errors import NotVersionedError
+
+ b = Branch('.', init=True)
+
+ self.build_tree(['foo/',
+ 'foo/hello'])
+
+ self.assertRaises(NotVersionedError,
+ b.add,
+ 'foo/hello')
+
More information about the Pkg-bazaar-commits
mailing list