Branching from just a part of a repository?

Andrew Bennetts andrew at bemusement.org
Thu Aug 30 01:05:49 UTC 2012


Bob Tanner wrote:
> Lets say I have a repo that looks like this:
[snip]
> 
> Is there a way I can just branch everything EXCEPT the tests directory?
> 
> I'd like to open source the code but not release private information
> that is stored in the tests.
> 
> IF bzr cannot do this I was just going to make a new repo, copy the
> a.py to l.py code into that repo, bzr commit it, then push it to
> launchpad.

Short answer: no, bzr cannot do this.  Make a new history, either the
way you suggest or via the fastimport plugin (which can filter out
paths).

The problem is bzr versions trees, not individual files, so doing what
you ask in bzr's model amounts to rewriting history.  So starting fresh
with no history (as you suggest), or rewriting history (using a tool
like bzr-fastimport), are your only good options.

-Andrew.



More information about the bazaar mailing list