Q: Keeping the repository elsewhere via a symlink for .bzr

John Arbash Meinel john at arbash-meinel.com
Tue Mar 15 12:46:37 UTC 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 3/15/2011 12:43 PM, Tim Meadowcroft wrote:
> 
> I've been using bzr happily for my s/w development work, but now thought I'd 
> look at using it to keep track of the changes I make to system folders such as 
> /etc and /boot (yes, I've seen etckeeper and similar).
> 
> I think I know much of what's involved (files that need ignoring etc) but I'd 
> prefer NOT to have the repositories storing the files in the folders themselves 
> - /boot for example is a small partition and /etc may become it's own small 
> partition too. So I was considering putting the repositories somewhere else (say 
> under /var) and tried a small experiment... started a branch in a test folder 
> and added files, then moved the .bzr folder elsewhere and replaced it with a 
> symlink pointing at the new location.
> 
> This seemed to work fine, bzr commands worked happily, my text folder now has 
> just 2 extra files (.bzr symlink and .bzrignore, which I may symlink too), all 
> seems joy and light, and such a setup would mean I could now centralise my local 
> repositories for further sys-admin (eg a cron job that then each night does a 
> "bzr push" of these to another machine)... but am I doing something very wrong? 
> 
> I've scoured various docs and forums and can't find any mention of such a 
> practice either for or against - is it so wrong that no one even thinks of it, 
> or so trivial that it's not worth mentioning ? Or is there a much better way to 
> achieve my aims - a bzr record of a tree which doesn't have the repository files 
> in the same filesystem as the tree itself ?
> 
> Cheers
> 
> --
> Tim

if you are symlinking '.bzr/' then it has to point to a location on the
same filesystem (I believe). bzr creates temporary files in
.bzr/checkout/limbo/* and then renames them into place, assuming an
atomic "os.rename()". if it crosses filesystems, then it is not
guaranteed to work.

If you just want the actual repository in another location, you can use
a lightweight checkout.

bzr init-repo /srv/my-repo
bzr init /srv/my-repo/a-branch
cd /boot
bzr co --lightweight /srv/my-repo/a-branch .
(not sure if the last command works exactly as you want, but you can
always just 'mv' the .bzr directory in some other lightweight checkout.)

Then when you 'bzr commit' it will put the data into /srv/my-repo, but
temporary files, etc, will all be created in /boot/.bzr/checkout/limbo
so we can be sure it will work.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1/X60ACgkQJdeBCYSNAAPj5wCgzajS5n2Q9cLp8CrW2kWAyiG5
fBsAoLvQRPHG8S3Ak+/Cd7RJN21rT1P0
=g5dh
-----END PGP SIGNATURE-----



More information about the bazaar mailing list