Repository Layout
Frits Jalvingh
jal at etc.to
Fri Jan 25 01:19:22 GMT 2008
Hi Ian,
Sorry for the late reaction; I was away on holiday.
I have not had any reaction to my question yet; I have started to
experiment but that takes lots of time. If you can give me some tips, or
some advice on pitfalls to avoid it would be great!
I am trying to work with the nested trees stuff but either I do not
understand it or it doesn't work very well yet: lots of errors on the
way. What I did was the following:
I started to create a base repositories for every subproject in itself:
mkdir ~/bzr
cd ~/bzr
bzr init --rich-root to.etc.alg
(copy source there, bzr add, commit)
bzr init --rich-root to.etc.db
(copy source there, bzr add, commit)
bzr init --rich-root mainproject
(copy etc)
So far so good. Now I want to create a "compound repository" called
"workspace" which contains those projects as "nested trees"; the idea is
that by getting a copy of "workspace" (by branching) I would get a new
branch/working directory containing the subprojects, I hope.
The subprojects need to retain their independence; I need to be able to
merge with other branches of each subproject. I should also be able to
push changes I make in a subproject back to some master for that
subproject.
The "workspace" project should keep track of the relative states of all
of the subprojects beneath it, so that when I checkout a given revision
of the "workspace" project it retrieves the correct revisions of the
subprojects - the revisions they were in at the time the workspace
project was commited at that time.
Would this be a correct assumption?
Anyway, creating the compound project "workspace" does not work by
default. I created it as follows:
cd ~/bzr
bzr init --rich-root workspace
cd workspace
bzr branch ~/bzr/to.etc.alg
bzr branch ~/bzr/to.etc.db
bzr branch ~/bzr/viewpoint
Now: since I need the projects to be independent I join them using
--reference:
bzr join --reference to.etc.alg
bzr join --reference to.etc.db
At this point bzr dies with:
bzr: ERROR: exceptions.AssertionError: repository of <WorkingTree4
of /home/jal/bzr/workspace> doesn't support tree references required by
entry 'to.etc.alg'
Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 806,
in run_bzr_catch_errors
return run_bzr(argv)
File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 762,
in run_bzr
ret = run(*run_argv)
File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 492,
in run_argv_aliases
return self.run(**all_cmd_args)
File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 3803,
in run
containing_tree.add_reference(sub_tree)
File "/usr/lib/python2.5/site-packages/bzrlib/mutabletree.py", line
51, in tree_write_locked
return unbound(self, *args, **kwargs)
File "/usr/lib/python2.5/site-packages/bzrlib/workingtree_4.py", line
192, in add_reference
self._add_reference(sub_tree)
File "/usr/lib/python2.5/site-packages/bzrlib/mutabletree.py", line
142, in _add_reference
if sub_tree_id in self.inventory:
File "/usr/lib/python2.5/site-packages/bzrlib/workingtree_4.py", line
425, in _get_inventory
self._generate_inventory()
File "/usr/lib/python2.5/site-packages/bzrlib/workingtree_4.py", line
363, in _generate_inventory
% (self, name)
AssertionError: repository of <WorkingTree4 of /home/jal/bzr/workspace>
doesn't support tree references required by entry 'to.etc.alg'
bzr 1.1.0 on python 2.5.1.final.0 (linux2)
arguments: ['/usr/bin/bzr', 'join', '--reference', 'to.etc.db']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
bzrtools /usr/lib/python2.5/site-packages/bzrlib/plugins/bzrtools [1.0.0]
launchpad /usr/lib/python2.5/site-packages/bzrlib/plugins/launchpad [unknown]
multiparent /usr/lib/python2.5/site-packages/bzrlib/plugins/multiparent.pyc [unknown]
svn /usr/lib/python2.5/site-packages/bzrlib/plugins/svn
[0.4.6]
*** Bazaar has encountered an internal error.
Please report a bug at https://bugs.launchpad.net/bzr/+filebug
including this traceback, and a description of what you
were doing when the error occurred.
Whatever. Doing a bzr commit works though:
bzr commit -m "bla"
After that I can join the others:
bzr join --reference to.etc.db
After all this I would have hoped that a branch/checkout of "workspace"
now would contain the subprojects but alas- it only contains empty
directories for those. A bzr status in the original workspace looks
troubling:
unknown:
to.etc.alg/.bzr/
to.etc.alg/autobuild.properties
to.etc.alg/build.xml
to.etc.alg/c/
to.etc.alg/doc/
to.etc.alg/examples/
to.etc.alg/make-sf.sh
to.etc.alg/perftimer.dll
to.etc.alg/src/
to.etc.db/.bzr/
to.etc.db/autobuild.properties
to.etc.db/build.xml
to.etc.db/changelist.txt
to.etc.db/pool.jsp
to.etc.db/src/
to.etc.db/to.etc.db.jar
viewpoint/.bzr/
viewpoint/Oracle/
viewpoint/WebContent/
viewpoint/applet-src/
viewpoint/beheer/
viewpoint/build.xml
viewpoint/conf/
viewpoint/log/
viewpoint/removed/
viewpoint/runserver-src/
viewpoint/src/
After some googling I tried the above again, but this time I created the
workspace repository with:
bzr init --dirstate-with-subtree workspace
After this creating the compound worked, and branching it did deliver me
the specified subprojects, appearently still as separate trees....
I'll now go and experiment some more with all this...
Thanks for your time,
Frits Jalvingh
More information about the bazaar
mailing list