Ending a (Feature) Branch

Scott Aubrey scottaubrey at capuk.org
Wed Apr 7 07:28:06 BST 2010


  Hi Brendon

I think that you're over thinking the model a bit too much.

A branch in bazaar is represented by a filesystem directory, whether 
shared or not. if you've merged the feature branch into parent branch 
(as defined by /your/ workflow), and you no longer require the branch to 
be available separately, then just blow it away like any other directory 
(rm -r featurebranch). In bazaar 2.2, there is a new remove-branch 
coming too, but that's in beta at the moment (and I'm not sure if it's 
in the current beta or not).

Some other comments:

On 07/04/2010 06:15, Eric Berry wrote:
>
>
> On Tue, Apr 6, 2010 at 9:32 PM, Brendan Simon (eTRIX) 
> <brendan.simon at etrix.com.au <mailto:brendan.simon at etrix.com.au>> wrote:
>
>
>     I was thinking of standalone versus shared, but maybe I am
>     confused about branches and repositories ??
>
>
> I apologize if I'm not correct in this. I'm not an expert, just a 
> happy user of Bazaar. From my understanding, a standalone branch is 
> sort of like a repository in that it contains all the history of that 
> branch and any other branches that have been merged into it (not 
> considering rebasing). There is a Bazaar repository which keep track 
> of common history between branches - very useful when have a lot of 
> separate lines of development, and want to save some space.
The repository is the bucket of revisions/changesets. if two branches 
are configured to use the same shared repository, then ALL revisions, 
not just common ones, are stored in the shared repository.
>
>
>     I also noticed that branches can be stacked.  I haven't used a
>     stacked branch so I don't know how they really work, except that
>     they depend on the availability of the source branch (must be
>     local ?? or can be remote ??).  My guess is blowing away a stacked
>     branch would not affect the parent branch so it has the same
>     affect as a non-stacked branch.
>
>
> I've never used stacked branches before, so I'm not sure how best to 
> use them.
I too have never used stacked branches, but from what I gather there's 
an outstanding bug with commiting under certain circumstances, so there 
pretty much a broken feature. I'm not sure of the details on this, but 
it had been brought up here before, maybe check out the archives or bug 
tracker for details if you're interested.
>
>
>     So the rule is just delete your local branches when not needed any
>     more -- must merge to parent branch if the changes are to be kept.
>
>
> I'm not sure if it's a "rule", but that's what I do with them once I'm 
> done working on the features and I've merged them back into the main line.
I mostly do the same here. Again, this is dependant on your workflow. 
For example, you may need to merge it into another branch representing a 
different release (released vs unreleased versions). Some of my branches 
get pull onto a test server to be tested in isolation for other features 
I'm writing. but as a rul, if you've finished with that branch as a 
separate line of development, then you can delete it.
>
>
>     The only exception seems to be if a feature branch is created in a
>     shared repo, and commits are made, and then the branch removed. 
>     The result the feature branch is still in the history of the
>     shared repo.
>
>
> Again, I'm not an expert, but I don't think that's how it works. From 
> my understanding, the repo only keeps the common history (I'm sure it 
> does a lot more than just that though), all commits made only to that 
> branch should exist only in that branch.
The OP is right here. All revisions for all branches using a shared repo 
get stored there. Within a shared repository you can even get back a 
branch that has been deleted and NOT merged using `bzr heads` from 
bzrtools plugin.
>
>
>     So is there a 'bzr rmdir' or 'bzr branch --delete' command that
>     would do the 'right thing' ... if the repository is shared or not ??
>
>
> 'bzr rm' will remove directories and files from version control. If 
> the branch is a lightweight checkout, there's a 'bzr zap' command 
> provided by the bzrtools plugin which removes it, but I'm not sure how 
> it's different than just deleting the branch directory.
>
>
> -- 
> Learn from the past. Live in the present. Plan for the future.
> Blog: http://www.townsfolkdesigns.com/blogs/elberry
> jEdit <http://www.jedit.org> - Programmer's Text Editor
> Bazaar <http://bazaar.canonical.com> - Version Control for Humans

- Scott
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/bazaar/attachments/20100407/13eeaff8/attachment-0001.htm 


More information about the bazaar mailing list