I thought I’d blog about how I’m actually using Bazaar. As I mentioned earlier, the reason for learning to use Bazaar was a need to be able to manage a set of scripts between several computers that may not have access to each other or a central server. A DRCS solution would allow me to track and manage changes to these scripts across these computers through the use of a "central" branch I’ll keep on a USB memory stick. Here’s how I set this up, and how I use it on a daily basis.
First, we create a new branch on the memory stick.
PS> cd g:\ PS> bzr init scripts
Now, on a central computer in each location I can create a "shared" branch.
PS> cd c:\ PS> bzr branch g:\scripts scripts
Now I can make individual branches on each machine and use them normally.
PS> net use \\machine\scripts PS> bzr co \\machine\scripts scripts
If I make a change on one of these machines, I simply have to commit the changes, which will also commit the changes to the "shared" branch. To push these changes out to machines at this location, all I have to do is run "bzr update". To push the changes to other locations requires a little more work, though it’s simple and straight forward.
PS> cd g:\scripts PS> bzr merge c:\scripts PS> bzr ci -m "Merged changes"
This pushes the changes onto the memory stick. Now at the other locations I can pull the changes off the stick.
PS> cd c:\scripts PS> bzr pull
Now on individual machines at the new location I can simply "bzr update".
This isn’t much different than just copying the scripts around everywhere. However, Bazaar gives me several benefits over the simple copy. First, changes are revision controlled, which is always beneficial for code! Second, because I’m committing and updating to a DRCS instead of just copying files, it’s very difficult to accidentally copy over changes made in one location that I forgot to copy out everywhere else.