Question on svn2bzr

Erik Bågfors zindar at gmail.com
Thu May 4 18:24:45 BST 2006


On 5/3/06, Jelmer Vernooij <jelmer at samba.org> wrote:
> Hi Erik,
>
> On Wed, 2006-05-03 at 00:10 +0200, Erik Bågfors wrote:
> > I tried to convert a old svn repo to bzr using svn2bzr and found that
> > it behaves strangely in my mind.
> >
> > If I have a svn repo with trunk with 4 revisions, then I run
> > "svn copy trunk branches/b1; cd branches/b1; svn ci -m 'new branch"
> > Then I will in svn see revisions 1-4 in trunk, and 5 in b1, if I then
> > commit to trunk again, I will see revno 6 there.
> >
> > If I convert this into bzr branches, I expect to see
> > 1-4 in both trunk and b1
> > 5 in trunk, that corresponds to revno 6 in svn trunk
> > 5 in b1 that corresponds to revno 5 in svn b1
> >
> > Instead, it looks like I get
> > 1-4 in trunk
> > 5 in trunk, that corresponds to revno 6 in svn trunk
> > 1 in b1 that corresponds to revno 5 in svn b1,
> >
> > Where did 1-4 in b1 go?
> >
> > Has anyone used svn2bzr for real use? Am I expecting the wrong thing?
> Which branch are you using? Is the dumpfile available somewhere? I'll
> try to reproduce.

I'm using your branch from http://samba.org/~jelmer/bzr/svn2bzr/ revno:33

I don't have a dump file, but I can show how to reproduce it.  Lot's
of commands below

# Create a svn repo.
$ svnadmin create /tmp/svnrepo
$ svn checkout file:///tmp/svnrepo repocheckout
Checked out revision 0.

# Create a trunk and put some revisions in it
$ cd repocheckout/
$ mkdir trunk
$ svn add trunk/
A         trunk

$ cd trunk/
$ cp /etc/hosts .
$ svn add hosts
A         hosts

$ svn ci -m 'created trunk and added hosts'
Adding         trunk
Adding         trunk/hosts
Transmitting file data .
Committed revision 1.

$ echo hej >> hosts
$ svn ci -m 'rev 2'
Sending        trunk/hosts
Transmitting file data .
Committed revision 2.

$ echo hej >> hosts
$ svn ci -m 'rev 3'
Sending        trunk/hosts
Transmitting file data .
Committed revision 3.

$ echo hej >> hosts
$ svn ci -m 'rev 4'
Sending        trunk/hosts
Transmitting file data .
Committed revision 4.


# Create a branch

$ cd ..
$ mkdir branches

$ svn add branches
A         branches
$ svn ci -m 'added branches'
Adding         branches

Committed revision 5.
$ svn cp trunk/ branches/foobranch
A         branches/foobranch

$ svn ci -m 'added branch foobranch'
Adding         branches/foobranch
Adding         branches/foobranch/hosts

Committed revision 6.


# Create a dump file

$ svnadmin dump /tmp/svnrepo > svnrepo.dump
* Dumped revision 0.
* Dumped revision 1.
* Dumped revision 2.
* Dumped revision 3.
* Dumped revision 4.
* Dumped revision 5.
* Dumped revision 6.

# Run svn2bzr.py

$ ~/usr/src/svn2bzr/svn2bzr.py --scheme=trunk svnrepo.dump svnrepoconv
Revision 0 read
Revision 1 read
Revision 2 read
Revision 3 read
Revision 4 read
Revision 5 read
Revision 6 read
Nothing changed in revision 0
/home/bagfors/usr/src/svn2bzr/svn2bzr.py:531: DeprecationWarning:
bzrlib.branch.initialize was deprecated in version 0.8.
  branch = Branch.initialize(branch_path)
/home/bagfors/usr/src/svn2bzr/svn2bzr.py:90: DeprecationWarning:
bzrlib.branch.BzrBranch5.working_tree was deprecated in version 0.8.
  branch.__wt = branch.working_tree()
Committing revision 1
Committing revision 2
Committing revision 3
Committing revision 4
Nothing changed in revision 5
Committing revision 6

$ cd svnrepoconv/

$ ls
branches/  trunk/

$ cd trunk/
$ bzr revno
4

$ cd ../branches/foobranch/
$ bzr revno
2


Basically, trunk has more revisions than foobranch, eventhough
foobranch is created from trunk and should hold all it's revisions

/Erik




More information about the bazaar mailing list