BzrSync

Tool to automatically synchronize Bazaar repositories between multiple nodes
Download

BzrSync Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL
  • Publisher Name:
  • Marco Pantaleoni
  • Publisher web site:
  • http://www.softwarefabrica.org

BzrSync Tags


BzrSync Description

Tool to automatically synchronize Bazaar repositories between multiple nodes BzrSync is an utility to help a developer using Bazaar on multiple machines. It automatically keeps selected repositories and branches synchronized across the machines. Bazaar itself is used for the synchronization (with "bzr pull"), ensuring consistency at all times.InstallationTo install the latest stable version of BzrSync, using pip:pip install bzrsyncor using setuptools:easy_install bzrsyncOtherwise, if neither pip nor setuptools are available, it is possible to download (eg. from PyPI) the source package, extract it and run the usual setup.py commands:python setup.py installUsageLet's suppose you work from three different workstations, and their hostnames are alpha, beta and gamma. You want to keep your Bazaar repositories and branches synchronized between all three nodes using BzrSync. BzrSync is meant to be used with shared repositories, so if you are not using these, you should re-organize your branches to use shared repositories. It's easier to keep all the repositories inside the same directory. In our example our repositories will reside in ~/bzr and their names will end in ".bzr". In each shared repository, at the top level there should be a directory for each node. In our case alpha, beta and gamma. For example, let's imagine we have a repository named "project-foo.bzr". We are working on alpha, and have created a trunk and a feature-1 branch. We'll have:~/bzr/project-foo.bzr/~/bzr/project-foo.bzr/alpha~/bzr/project-foo.bzr/alpha/trunk~/bzr/project-foo.bzr/alpha/feature-1~/bzr/project-foo.bzr/beta~/bzr/project-foo.bzr/gammaLet's suppose we also have a local.bzr repository we don't want to synchronize, in either direction.BzrSync needs a YAML config file, by default ~/.bazaar/bzrsync.yaml, listing the repositories and the branches we. In this example its contents will be:# remote nodes# (a host can be specified with an optional port as HOST:PORT)hosts:- alpha- beta- gamma# where repositories specified with a relative path/pattern are locatedroot: ~/bzr# *all* repositoriesrepositories: "*.bzr"# specific repositories to exclude from 'repositories'exclude:- local.bzr# repositories to export to remote nodesexport: "*.bzr"# specific repositories excluded from exportexport_exclude:- local.bzr# repositories to sync from remotessync: "*.bzr"# specific repositories excluded from syncsync_exclude:- local.bzrWe can use exactly this same configuration file on all three nodes.BzrSync won't create the shared repositories for you, so before proceeding, do so now on all the nodes, remembering to create also the node subdirectories.Then launch the BzrSync daemon on all the nodes:alpha$ bzrsync servebeta$ bzrsync servegamma$ bzrsync serveNow let's sync project-foo.bzr from alpha to beta: beta$ bzrsync sync ~/bzr/project-foo.bzrThis will pull to beta all the branches from ~/bzr/project-foo.bzr/alpha/ on alpha, and all the branches from ~/bzr/project-foo.bzr/gamma/ on gamma. In our case, only alpha has branches right now, so in practice we'll get the branches alpha/trunk and alpha/feature-1 from alpha to beta, keeping them as alpha/trunk and alpha/feature-1.If you want to work on beta, now branch from the newly synchronized branches to their counterparts inside the beta/ subdirectory:beta$ bzr branch ~/bzr/project-foo.bzr/alpha/feature-1 ~/bzr/project-foo.bzr/beta/feature-1beta$ bzr co ~/bzr/project-foo.bzr/beta/feature-1 foo-feature-1beta$ cd foo-feature-1...hack hack hack...beta$ commitNow on beta we'll have:~/bzr/project-foo.bzr/~/bzr/project-foo.bzr/alpha~/bzr/project-foo.bzr/alpha/trunk~/bzr/project-foo.bzr/alpha/feature-1~/bzr/project-foo.bzr/beta~/bzr/project-foo.bzr/beta/feature-1~/bzr/project-foo.bzr/gammaWhen you have finished working on beta, you can sync from alpha: alpha$ bzrsync sync ~/bzr/project-foo.bzrand this will create beta/feature-1 on alpha too, which you can pull onto alpha/feature-1 if not diverged, or merge it otherwise, and start working from alpha again.Please see the example bzrsync.yaml file for a more complete example, which includes also branch sets.


BzrSync Related Software