[merge] win32- all tests pass but 1

Aaron Bentley aaron.bentley at utoronto.ca
Sat Jul 1 01:45:56 BST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

John Arbash Meinel wrote:
> The attached patch is the rest of the cleanups that get win32 so that
> almost all tests are passing.


     def __init__(self, transport, filename, mode, create=False,
file_mode=None):
         _KnitComponentFile.__init__(self, transport, filename, mode)
- -        self._file = None
         self._checked = False
         if create:
             self._transport.put(self._filename, StringIO(''),
mode=file_mode)
@@ -1286,12 +1292,11 @@
         pass

     def _open_file(self):
- -        if self._file is None:
- -            try:
- -                self._file = self._transport.get(self._filename)
- -            except NoSuchFile:
- -                pass
- -        return self._file
+        try:
+            return self._transport.get(self._filename)
+        except NoSuchFile:
+            pass
+        return None


This is so that you can require callers to do close()?


@@ -134,6 +136,11 @@
         self.branch = main_branch

     def test_fileids_altered_between_two_revs(self):
+        if self.branch is None:
+            # Could not create the branching structure
+            # for this repository format
+            return

Still don't agree with this.  If Martin or Rob say it's okay, then fine,
but I think we shouldn't pass unless we run to completion successfully.

@@ -20,8 +20,8 @@


- -class MergeTest(TestCase):
+class MergeTest(TestCaseWithTransport):

     def test_change_name(self):
         """Test renames"""
- -        builder = MergeBuilder()
+        builder = MergeBuilder(getcwd())

Are these changes for win32 compatibility or just general neatness?  (By
the way, these test cases are weird because they came in with the
original merge implementation from BaZing.)


=== modified file
'bzrlib/tests/workingtree_implementations/test_workingtree.py'
- --- bzrlib/tests/workingtree_implementations/test_workingtree.py
2006-06-27 08:47:32 +0000
+++ bzrlib/tests/workingtree_implementations/test_workingtree.py
2006-06-30 16:56:52 +0000
@@ -17,6 +17,7 @@

 from cStringIO import StringIO
 import os
+import sys

 import bzrlib
 from bzrlib import branch, bzrdir, errors, urlutils, workingtree
@@ -30,6 +31,7 @@
                                 WorkingTree)
 from bzrlib.conflicts import ConflictList

+
 class TestWorkingTree(TestCaseWithWorkingTree):

     def test_list_files(self):
@@ -80,7 +82,10 @@
         wt, relpath = WorkingTree.open_containing('./foo')
         self.assertEqual('foo', relpath)
         self.assertEqual(wt.basedir + '/',
urlutils.local_path_from_url(branch.base))
- -        wt, relpath = WorkingTree.open_containing('file://' + getcwd()
+ '/foo')
+        if sys.platform == 'win32':
+            wt, relpath = WorkingTree.open_containing('file:///' +
getcwd() + '/foo')

This code looks like it could fail because it's joining a url and a
local filesystem path.  Am I wrong about that?

So I'm +0.9 on this right now.  The TestSkipped thing needs to be
resolved one way or another, and I'd also like to know about this
'file://' + getcwd thing.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEpcXD0F+nu1YWqI0RAkFUAJ9rceYBUMbDnNgjC6V99yfJhq5wPgCcDBCR
hqyvMjKXqDlchVHGICNu2yE=
=en78
-----END PGP SIGNATURE-----




More information about the bazaar mailing list