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

Matt McClure mlm at aya.yale.edu
Wed Apr 9 13:48:47 BST 2008


On Tue, Apr 8, 2008 at 11:16 PM, Aaron Bentley <aaron at aaronbentley.com>
wrote:

> 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
>

Will do.  How about osutils.host_os_can_dereference_symlinks?  ...though the
new method may not apply to the caller below since the test is
Windows-specific.  See my answer regarding 'attrib' below.


> > +    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".
>

Is there an agreement between you and Alexander?


> > +        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.
>

OK, I can remove that.


> > +        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.
>

Verifying that a tool (attrib) in the host OS (Windows) that understands
mixed paths (with '/' rather than '\') can read the files on both sides of
the diff.

I'm using a subprocess because the feature I'm testing is support for diff
subprocesses in the host OS.

Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/bazaar/attachments/20080409/a2638233/attachment-0001.htm 


More information about the bazaar mailing list