[RFC] revision id "pseudonyms" and converted-from revision property

Jelmer Vernooij jelmer at samba.org
Mon Oct 19 10:32:48 BST 2009

On Wed, 2009-10-07 at 21:30 +0200, Jelmer Vernooij wrote:
> Different revisions in Bazaar created from the same foreign revision
> might have different revision ids, because the mapping between semantics
> in the foreign VCS and Bazaar that was used was different. 
> There are several situations in which it is useful to be able to tell
> that multiple Bazaar revisions with different revision ids were created
> from the same original foreign revision.
> For example, it is useful to be able to rebase an existing branch based
> on a Launchpad-cscvs import onto an import of the same Subversion branch
> made with bzr-svn.  Or to rebase an existing branch created with git-svn
> onto an import of the same branch made with "hg convert".
> We have the (unimplemented) concept of "revision id aliases" for
> revisions that have the exact same contents - their only difference are
> their revision ids. However, this is an unnecessarily strict requirement
> for these use cases - there might be different file ids or slight
> differences in history.
> Instead, it might be more useful to consider revisions that are for most
> purposes equivalent because they are based on the same foreign revision
> - their revision ids being "pseudonyms" rather than aliases.
> To be able to prove what revisions are pseudonyms, I propose all
> conversion tools append a foreign revision id to a revision property
> called "converted-from". 
> E.g. for a revision that was imported from svn into git and later into
> bzr the property's contents could look like this:
> svn 71d39326-ef09-db11-b2a4-00e04c779ad1:trunk:1526
> git 4a1327ff6cd05227f8ac2bc2490f8a809fc8c7d9
> This should provide enough information for tools like bzr-rewrite to
> prove what revisions' ids are pseudonyms later. 
> If this sounds reasonable, I'll work on providing patches for the
> various conversion tools. For any conversion tools that use
> deterministic revision ids this change will have to wait until the next
> mapping version bump, but we should already have other ways to determine
> the original foreign revision id for them until then.

bzr-rewrite now has code to determine pseudonyms, it looks for
semi-equivalent foreign revision ids in Bazaar revisions in the
following ways:

 * 'converted-from' revision property
 * parsing the bzr revision id (e.g.
 * 'cscvs-svn-{uuid,revnum,branch-path}' revision property

The hidden command "bzr pseudonyms" will print the revision pseudonyms
found in a repository.

The command "bzr rebase-foreign" can do rebases using these pseudonyms.
For example, to rebase a branch that is currently based on the launchpad
import onto a bzr-svn import:

$ bzr branch lp:gsql gsql-lp
$ cd gsq-lp
$ echo Foo > gsql.anjuta 
$ bzr ci -m a\ change
$ bzr rebase-foreign http://gsql.googlecode.com/svn/trunk

(no magic options required)

Rebases are deterministic: revision ids generated are based on the
original revision id and a hash of the new parent revids. 



Jelmer Vernooij <jelmer at samba.org> - http://samba.org/~jelmer/
Jabber: jelmer at jabber.fsfe.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20091019/9ae3c937/attachment.pgp 

More information about the bazaar mailing list