[rfc] Proposal: fake symlinks support on windows
Martin Pool
mbp at canonical.com
Tue May 23 07:11:41 BST 2006
On 19 May 2006, Alexander Belchenko <bialix at ukr.net> wrote:
> >>In attachment you'll find patch for selftest subsystem of bzr. This
> >>changes is not depend on windows nor cygwin. I've add test_symlinks.py
> >>module with tests somewhat specific for my plugin. This tests looks
> >>trivial for unix where I want to keep it separately and independetly in
> >>main bzrlib code with reason to split namespaces.
> >>
> >>I think this patch is worth to include in main bzr.dev.
> >
> >I think this is fine - essentially it makes the tests be skipped if
> >there are no symlinks, rather than just silently passing. That's a
> >useful improvement.
>
> Thanks. Is it means that you give +1 on patch for selftest?
Yes, +1 from me. The patch is reposted below in case anyone else wants
to review it.
> >To bring this into bzr proper I'd rather not patch the os module but
> >rather update all callers to either go through bzrlib.osutils or the
> >workingtree.
>
> Hmmm...
> Some tests explicitly call os.symlink/os.readlink and os.path.islink
> functions so make all symlinks operations go through workingtree is
> caused to make this tests fails on win32 with fake symlinks. Probably in
> this situation is better to provide osutils.* functions but this
> proposal was previously rejected by Aaron. Or may be provide osutils.*
> functions and include symlinks methods inside WorkingTree class and link
> this methods to corresponding osutils functions. In the latter case
> direct usage of os.symlink/os.readlink and os.path.islink functions
> should be vetoed for overall bzrlib code.
I think that second case would be OK: provide functions in osutils that
create the fake symlinks, and then WorkingTree can call them. This
allows some scope for creating fake symlinks even on Unix (though we may
not be able to set the system bit.) But what do Aaron and John think?
--
Martin Pool
More information about the bazaar
mailing list