Are squashed commits and discarded branches possible in bzr?

Todd A. Jacobs nospam at codegnome.org
Mon May 10 20:18:02 BST 2010


On Mon, May 10, 2010 at 03:59:23PM +0900, Stephen J. Turnbull wrote:

> If you mean GC of dangling revisions, IIUC this happens when a branch
> is repacked, and certainly when it is cloned.

I'm not sure this is right. Let's say I have a shared respository with
trunk, feature-one, and feature-two. I do:

    cd trunk
    bzr merge ../feature-one
    bzr revert --forget-merges
    bzr commit -m 'Some squashed commit msg.'
    rm -rf ../feature-one
    cd /tmp/foo
    bzr clone /path/to/trunk

and I will get a history that wasn't going to include feature-one
anyway, since it wasn't actually merged in any real sense. But if I do:

    cd trunk
    bzr merge ../feature-one
    bzr commit -m 'Some commit msg.'
    rm -rf ../feature-one
    cd /tmp/foo
    bzr clone /path/to/trunk

I would expect that the DAG still references the feature-one branch,
since that's where the merge came from. Simply removing the branch
working directory from a shared repository won't actually delete the
branch within the respository itself, right?

But if that's actually what I want (e.g. to discard a local branch that
hasn't been pushed elsewhere), is there actually any way to do that
within a shared repository?

-- 
"Oh, look: rocks!"
	-- Doctor Who, "Destiny of the Daleks"




More information about the bazaar mailing list