[MERGE] win32-specific fixes for selftest and bzrlib

Alexander Belchenko bialix at ukr.net
Fri Sep 7 13:39:33 BST 2007


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

This patch mainly focused on fixing dumb failures in selftest on windows,
but also fix one windows-specific bug in multiparent.py

There is one place where I'm not sure about what variant is better:

=== modified file 'bzrlib/tests/repository_implementations/test_commit_builder.py'
- --- bzrlib/tests/repository_implementations/test_commit_builder.py	2007-09-04 03:53:07 +0000
+++ bzrlib/tests/repository_implementations/test_commit_builder.py	2007-09-06 13:30:55 +0000
@@ -415,11 +416,20 @@
         path = 'name'
         make_before(path)
         def change_kind():
- -            try:
+            # 'Easier to ask for forgiveness than permission' paradigm
+            # is monstrous here
+            #try:
+            #    os.unlink(path)
+            #except OSError, e:
+            #    if not (e.errno == EISDIR or
+            #        (sys.platform == 'win32' and e.errno == EACCES)):
+            #        raise
+            #    os.rmdir(path)
+            # because it's a test we can do it via direct check
+            # (bialix 20070906)
+            if not os.path.isdir(path):
                 os.unlink(path)
- -            except OSError, e:
- -                if e.errno != EISDIR:
- -                    raise
+            else:
                 os.rmdir(path)
             make_after(path)
         self._add_commit_change_check_changed(tree, path, change_kind)


Error handling looks monstrous for me and I'm leaning towards direct check (isdir).


Selftest result on win32
========================
without this patch (bzr.dev revno.2804)
- ---------------------------------------
Ran 8136 tests in 3543.734s

FAILED (failures=22, errors=53)
818 tests skipped
Missing feature 'strace' skipped 3 tests.
Missing feature 'symlinks' skipped 60 tests.


With patch:
- -----------
Ran 8136 tests in 3608.297s

FAILED (errors=39, known_failure_count=1)
820 tests skipped
Missing feature 'strace' skipped 3 tests.
Missing feature 'symlinks' skipped 66 tests.


80% of remaining errors are locking errors
(my best guess because of exclusive locks behavior on win32).

[µ]


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG4UaFzYr338mxwCURAuBMAJ9mdJV+HjeqBsGhpOn5J5K0DqpVwQCfSM7r
biVvUVqgzbHmqMBfL7pkQ0E=
=eAPm
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: bzr-mail-oynkw6.patch
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20070907/bd78abda/attachment-0001.diff 


More information about the bazaar mailing list