[PATCH] [Bug 209281] Re: Windows diff apps don't understand symlinks created by Cygwin bzr diff --using

Aaron Bentley aaron at aaronbentley.com
Wed Apr 9 04:16:22 BST 2008


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

Matt McClure wrote:
> On Sun, Apr 6, 2008 at 3:19 AM, Alexander Belchenko <bialix at ukr.net> wrote:
>> Alexander Belchenko has voted tweak.
>>  Status is now: Semi-approved
>>  Comment:
>>
>> I'd like to see test_execute_windows_tool explicitly skipped on other platforms
>> rather than silently succeeds.
> 
> See the attached tweaked patch.

bb:resubmit

I'd like to see this platform detection factored out into an osutils
method.  We shouldn't be repeating ourselves here.  Maybe
osutils.apps_support_symlinks

> +    def test_execute_windows_tool(self):
> +        if (sys.platform != 'windows'
> +            and sys.platform != 'cygwin'):
> +            raise tests.TestSkipped('Platform does not have Windows tools.')

TestSkipped is rather generic.  We usually use UnavailableFeature (via
our requireFeature code) to indicate platform differences.  Though the
"feature" in this case is a deficiency, bringing new meaning to the
phrase "it's not a bug, it's a feature".

> +        output = StringIO()
> +        tree = self.make_branch_and_tree('tree')
> +        self.build_tree_contents([('tree/file', 'content')])
> +        tree.add('file', 'file-id')
> +        tree.commit('old tree', timestamp=0)

^^^ The timestamp value doesn't seem to be required here.

> +        tree.lock_read()
> +        self.addCleanup(tree.unlock)
> +        diff_obj = DiffFromTool(['python', '-c',
> +                                 'print "%(old_path)s %(new_path)s"'],
> +                                tree, tree, output)
> +        diff_obj._prepare_files('file-id', 'file', 'file')
> +        proc = subprocess.Popen(['attrib', 'old/file'],
> +                                stdout=subprocess.PIPE,
> +                                cwd=diff_obj._root)

^^^ err, what are you doing with attrib here?  We do not normally use
subprocesses in our test suite.


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

iD8DBQFH/DUG0F+nu1YWqI0RAgcZAJ4sobcT9xIUymbVqbLU+f+cvUlIjgCff7X6
SwJn9KsErXxHKDfICcLUCQs=
=4+k1
-----END PGP SIGNATURE-----



More information about the bazaar mailing list