Subversion branch support for Bazaar

treats expanded svn keywords as changes

Reported by Wouter van Heyst on 2007-01-25
8
Affects Status Importance Assigned to Milestone
Bazaar
Wishlist
Ian Clatworthy
Bazaar Subversion Plugin
Medium
Jelmer Vernooij

Bug Description

I just did a fresh svn checkout, and then tried to see if bzr would work with a native svn checkout. A `bzr status` fetched some revision info and a fileid map as expected, but it confused me when it said there were modified files. This was a new checkout!

It turns out all the changes are of a nature $Id$ -> $Id: file rev date name$ etc.

On Thu, 2007-01-25 at 13:33 +0000, Wouter van Heyst wrote:
> Public bug reported:
>
> I just did a fresh svn checkout, and then tried to see if bzr would work
> with a native svn checkout. A `bzr status` fetched some revision info
> and a fileid map as expected, but it confused me when it said there were
> modified files. This was a new checkout!
>
> It turns out all the changes are of a nature $Id$ -> $Id: file rev date
> name$ etc.
This can only be fixed by either adding keyword support to Bazaar (fuzzy
diffs) or by modifying the bazaar working copy file access functions to
replace $Id foo$ -> $Id$. Since the latter is rather ugly, I'd rather
wait for keyword support.

Cheers,

Jelmer
--
Jelmer Vernooij <email address hidden> - http://samba.org/~jelmer/

Wouter van Heyst (larstiq) wrote :

On Thu, Jan 25, 2007 at 10:58:35PM -0000, Jelmer Vernooij wrote:
> On Thu, 2007-01-25 at 13:33 +0000, Wouter van Heyst wrote:
> > Public bug reported:
> >
> > I just did a fresh svn checkout, and then tried to see if bzr would work
> > with a native svn checkout. A `bzr status` fetched some revision info
> > and a fileid map as expected, but it confused me when it said there were
> > modified files. This was a new checkout!
> >
> > It turns out all the changes are of a nature $Id$ -> $Id: file rev date
> > name$ etc.
>
> This can only be fixed by either adding keyword support to Bazaar (fuzzy
> diffs) or by modifying the bazaar working copy file access functions to
> replace $Id foo$ -> $Id$. Since the latter is rather ugly, I'd rather
> wait for keyword support.

Yeah, I was afraid of the complications, but imho it does need to be
tracked. I'd give keyword support in core a very small chance.

Wouter van Heyst

Jelmer Vernooij (jelmer) wrote :

On Thu, 2007-01-25 at 23:10 +0000, Wouter van Heyst wrote:
> On Thu, Jan 25, 2007 at 10:58:35PM -0000, Jelmer Vernooij wrote:
> > On Thu, 2007-01-25 at 13:33 +0000, Wouter van Heyst wrote:
> > > It turns out all the changes are of a nature $Id$ -> $Id: file rev date
> > > name$ etc.
> > This can only be fixed by either adding keyword support to Bazaar (fuzzy
> > diffs) or by modifying the bazaar working copy file access functions to
> > replace $Id foo$ -> $Id$. Since the latter is rather ugly, I'd rather
> > wait for keyword support.
> Yeah, I was afraid of the complications, but imho it does need to be
> tracked. I'd give keyword support in core a very small chance.
There is a spec for it, see
https://blueprints.launchpad.net/bzr/+spec/bzr-keyword-expansion

I can understand why you'd like it fixed, though I'd rather invest time
in proper support in bzr core than an ugly workaround in bzr-svn. Same
situation applies to svn:ignore.

  status confirmed

Cheers,

Jelmer

--
Jelmer Vernooij <email address hidden> - http://samba.org/~jelmer/

Changed in bzr-svn:
status: Unconfirmed → Confirmed
Jelmer Vernooij (jelmer) on 2007-01-28
Changed in bzr-svn:
assignee: nobody → jelmer
importance: Undecided → Medium
Jelmer Vernooij (jelmer) on 2007-07-20
Changed in bzr-svn:
status: Confirmed → Triaged
Jelmer Vernooij (jelmer) wrote :

This needs to be fixed in bzr first.

Changed in bzr-svn:
milestone: 0.5.0 → none

Could you enlarge on what is needed in bzr?

Jelmer Vernooij (jelmer) on 2008-07-25
Changed in bzr-svn:
assignee: jelmer → nobody
Jelmer Vernooij (jelmer) wrote :

well, afaik only "rules" are supported at the moment, there's no keywords plugin yet.

Other than that, the problems mentioned in bug 145155 seem appropriate here as well since it's a similar issue.

Ian Clatworthy (ian-clatworthy) wrote :

A keywords plugin does not exist though it needs a branch supporting content filtering. See https://launchpad.net/bzr-keywords.

Let me know if there's things the keywords plugin needs to do to better support svn interoperability. Note that it doesn't support the same keywords as Subversion - it supports one that make sense for Bazaar. Perhaps it should contract *all* keyword expansions though in nominated files, whether it knows about the keyword or not?

Ian Clatworthy (ian-clatworthy) wrote :

That's was meant to read ... does *now* exist.

Ian Clatworthy (ian-clatworthy) wrote :

Checking the help and code for bzr-keywords, it does indeed compress all detected keywords. So if subversion expands a keyword, Bazaar should do the right thing and store the $Keyword$ form regardless of whether Bazaar supports that keyword or not.

I've just tweaked the expansion logic in the keywords plugin as well. It will now replace keywords it knows about and ignore the expansion for the keywords it doesn't (rather than replace them with an empty string). I think that should imporve interoperability with Subversion IIUIC.

Jelmer Vernooij (jelmer) wrote :

Hi Ian,

Cool, I hadn't seen the keywords plugin yet ! I'll give it a try.

The problematic thing for bzr-svn at the moment is the fact that .bzrrules is versioned as part of the revision tree.

This causes two lists of rules to end up in subversion and that makes pulling in changes from svn hard because the two would have to be merged.

The .bzrrules files would end up in Subversion, potentially annoying other Subversion users like bzr-svn file properties have done in the past.

.bzrrules describes the whole tree, and that will affect the performance of per-file access since generating .bzrrules on the fly requires bzr-svn to query every single file in the tree in svn.

Jelmer Vernooij wrote:

> The problematic thing for bzr-svn at the moment is the fact that
> .bzrrules is versioned as part of the revision tree.

OTOH, access to it is isolated by a new API that I've got a
patch up for - get_special_file. bzr-svn *could* reimplement that
to load/save the data somewhere more private I guess. Keep in mind
though that the driving reason for putting it in the tree is to
ease merging, etc.

> The .bzrrules files would end up in Subversion, potentially annoying
> other Subversion users like bzr-svn file properties have done in the
> past.

Maybe. A simply workaround is to add .bzrrules to .svnignore?

> .bzrrules describes the whole tree, and that will affect the performance
> of per-file access since generating .bzrrules on the fly requires bzr-
> svn to query every single file in the tree in svn.

I'd strongly recommend against generating this on the fly each and every
time. Instead, I'd suggest a workflow where a new command generates it
once and it is manually maintained after that. It's not perfect but it's
the sort of compromise necessary using multiple tools on the one tree IMO.

Ian C.

Jelmer Vernooij (jelmer) wrote :

It's not the access to this file that's the problem - it's the fact that it lives in the revision tree. This means it has to be pushed into Subversion, otherwise we hit problems when round-tripping.

Appending the file to svn:ignore doesn't help since svn:ignore is only evaluated at the working tree level, not when fetching between branches.

If .bzrrules isn't generated on the fly it means keywords won't work out of the box, and it becomes impossible to easily track a subversion branch that uses keywords (since the local branch will diverge because it has to have .bzrrules added to it).

It also means that there are two lists of ignores to keep up to date, and thus that pushing files with keywords into Subversion becomes impossible without manually patching things up afterwards using the svn client.

I understand that having .bzrrules in the working tree at the same level of .bzr is useful for merging and the like, but would rather see it be a checkout of a versioned file that isn't part of the inventory.

Robert Collins (lifeless) wrote :

On Fri, 2008-07-25 at 17:40 +0000, Jelmer Vernooij wrote:

> I understand that having .bzrrules in the working tree at the same level
> of .bzr is useful for merging and the like, but would rather see it be a
> checkout of a versioned file that isn't part of the inventory.

FWIW so would I - its precisely this sort of problem that we had
with .bzrignore that had me arguing against it being a user visible
file.

-Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.

Jelmer Vernooij (jelmer) on 2008-07-28
Changed in bzr-svn:
milestone: none → 0.5.0
John A Meinel (jameinel) on 2008-09-04
Changed in bzr:
assignee: nobody → ian-clatworthy
importance: Undecided → Wishlist
status: New → In Progress
Jelmer Vernooij (jelmer) on 2008-12-09
Changed in bzr-svn:
milestone: 0.5.0 → 0.6.0
Jelmer Vernooij (jelmer) on 2009-04-04
Changed in bzr-svn:
assignee: nobody → jelmer
status: Triaged → Fix Released
Changed in bzr:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers