Detecting renames in bzr-svn...

John Szakmeister john at szakmeister.net
Tue Nov 9 10:58:22 GMT 2010


Hey Jelmer,

I've been thinking about this problem for a little while, and it's
bitten us a few times, but I'd like to see renames get detected with
bzr-svn, at least in the common cases.

Most of the time when I see a rename, there is never an additional
copy being done.  So what I'm thinking is this.  Let's say in all
cases path X is being renamed to path Y:
  * If path X is deleted, and then added with history at path Y, and
there are no other references to path X, then call that a rename from
path X to path Y
  * if path X is deleted, and added as path Y, but there is also a
copy done at path Z, call it a rename only if basename(path X) and
basename(path Y) are equal.

I think that will cover the 99% use case.  Log is already presenting
us with the information we need, the real trick is in processing it.
We'll either need to make more than one pass of the changed paths
(which is probably not that terrible), or come up with a scheme to
detect the renames on the fly and somehow fixup the transform.  I'd
like to approach it by making more than one pass over the
changed_paths first.

The million dollar question is would this then break people?  If you
rebranch from svn, some revisions will detect delete and adds with
history as renames rather than removes and adds.  Is that acceptable?

-John



More information about the bazaar mailing list