brz and symlinks inside branch checkout

Aaron Bentley aaron at aaronbentley.com
Fri Jun 1 14:17:06 UTC 2018


Bazaar is perfectly happy with symlinks, but if you create a symlink to a
directory, you should not "bzr add" any of the files in that directory.
(In fact, I thought we had good check against that).  Bazaar should not be
manipulating files outside its working tree.  Bazaar is supposed to be in
control of the contents of the working tree, so whatever files Bazaar is
manipulating should actually be in the working tree.

os.replace is not a fix for pad.lv/411068: "The operation may fail if src
and dst are on different filesystems".  Even if it behaved more like
shutil.move, I disagree that 411068 should be "fixed" by using shutil.move
or the like.  If you've mounted a directory into your working tree, you've
taken control away from Bazaar because it can't reproduce that state.

Aaron


On Fri, Jun 1, 2018 at 2:58 AM Martin Steigerwald <martin at lichtvoll.de>
wrote:

> Hi Jelmer.
>
> Thanks for your response.
>
> Jelmer Vernooij - 01.06.18, 02:34:
> > On Thu, May 31, 2018 at 09:40:53AM +0200, Martin Steigerwald wrote:
> > > I have a file in a directory inside my home directory that is linked
> > > to ecryptfs encrypted Private directory and thus is in a different
> > > filesystem than ~.
> > >
> > > brz 3.0.0~bzr6964-1 does not work with this:
> > >
> > > %> brz revert .symlink-to-directory-in-Private/somefile
> > >
> > >  M  Private/.symlink-to-directory-in-Private/somefile
> > >
> > > brz: ERROR: Unprintable exception TransformRenameFailed:
> > > dict={'errno': 18, 'from_path':
> > > u'/home/someuser/Private/.symlink-to-directory-in-
> > > Private/somefile', 'to_path': u'/home/someuser/.bzr/checkout/limbo/
> > > new-1', 'why': '[Errno 18] Ung\xc3\xbcltiger Link \xc3\xbcber Ger
> > > \xc3\xa4tegrenzen hinweg'}, fmt='Failed to rename %(from_path)s to
> > > % (to_path)s: %(why)s', error=UnicodeDecodeError('ascii', '[Errno
> > > 18] Ung \xc3\xbcltiger Link \xc3\xbcber Ger\xc3\xa4tegrenzen
> > > hinweg', 14, 15, 'ordinal not in range(128)')
> > >
> > > (german text means "invalid cross-device link")
> > >
> > > %> LANG=C brz revert .symlink-to-directory-in-Private/somefile
> > >
> > >  M  Private/.symlink-to-directory-in-Private/somefile
> > >
> > > brz: ERROR: Failed to rename /home/someuser/Private/.symlink-to-
> > > directory-in-Private/somefile to /home/someuser/.bzr/checkout/limbo/
> > > new-1: [Errno 18] Invalid cross-device link
> > >
> > > Is there any way around this limitation that a repository needs to
> > > reside on one and the same filesystem, any way to handle sym links
> > > transparently?
> >
> > There appear to be two issues here:
> >
> > * String type inconsistency; this should be fixed as part of the
> >   Python3 porting effort
>
> This is a minor thing I seem to be able to work-around by using LANG=en
> or so.
>
> > * http://pad.lv/411068; It looks like on Python3, we could
> >   switch over to using os.replace rather than os.rename to address
> >   pad.lv/411068.
> >
> >   On Python2.7, we could just add a osutils.replace that provides the
> >   same functionality as os.replace does in python3 ?
>
> On Debian Sid brz 3.0.0~bzr6964-1 still depends on python 2.7:
>
> % head -1 /usr/bin/brz
> #! /usr/bin/python
> % /usr/bin/python --version
> Python 2.7.15
>
> Thanks,
> --
> Martin
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/bazaar/attachments/20180601/14519d6a/attachment.html>


More information about the bazaar mailing list