Branching with a Central Repository
John Arbash Meinel
john at arbash-meinel.com
Tue Oct 6 16:52:00 BST 2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
...
> However, I'm not clear from the documentation how to actually work
> with this. We have a very thorough backup régime on the repository
> and are very keen to use this as the commit destination. The closest
> thing I've come up with (which seems especially convoluted in the
> GUIs, which most of my colleagues will use) is something like (I may
> have made mistakes here):
>
> # Get the project
> bzr co f:\root\ProjectGroup\Project1
> cd Project1
>
> # Do some editing (e.g. go to revision 10)
> bzr ci -m "Done some editing"
>
> # Now branch: it'd be nicer to just do
> # "bzr branch feature-gui" and automatically
> # handle the relationship to the current checkout
> bzr branch f:\root\ProjectGroup\Project1
> f:\root\ProjectGroup\Project1\feature-gui
>
> # Bind to the new feature
> bzr bind f:\root\ProjectGroup\Project1\feature-gui
generally "bzr switch" rather than "bzr bind" at this point.
>
> # Do some editing (e.g. go to revision 11)
> bzr ci -m "Added GUI template files"
> # Do some more editing (e.g. go to revision 12)
> bzr ci -m "Added GUI"
>
> # Now we need to merge it back into the mainline
> # (so we get 10.1.2 or whatever [2]) and switch back.
> # How do we do this cleanly?
>
> # Guess (this is nasty):
>
> # Bind to the original project path (this could get messy as
> # we've got the changes already made!)
> bzr bind f:\root\ProjectGroup\Project1\
Again 'switch'. As this will revert any changes that have been
committed, preparing you for the merge.
> # Merge in the changes
> bzr merge f:\root\ProjectGroup\Project1\feature-gui
>
And, of course, "bzr commit "when you are done.
>
> Is there a better way to do this? I've been reading the
> documentation, but most of the branching/merging discussion focuses on
> the distributed development workflow.
>
> Thanks in advance,
>
> Al
>
> [1] http://doc.bazaar-vcs.org/current/en/user-guide/index.html#centralized
> [2] http://doc.bazaar-vcs.org/current/en/user-guide/index.html#hierarchical-history-is-good
>
What you've written seems fine. And is certainly exposed in "Bazaar
Explorer." Switch is under the "Work" category if you are looking for it.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkrLZ6AACgkQJdeBCYSNAAPhRwCfcwj/pjFudRbNlB7hzBcfY+aw
QnMAn0oFUnYgfbkhcNTko7G7jh6K8GKi
=gufx
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list