You can do this using the fastimport
plugin:
bzr fast-export /path/to/orig/project | \
bzr fast-import-filter -i project1/ | \
bzr fast-import - /path/to/new/project1
(I broke the line for readability)
- The first command dumps the revisions of the branch at the specified path to standard output
- The second command filters the revisions, selecting only the ones that affect the
project1/
directory. The trailing/
is important. - The third command imports the revisions from the standard input to the specified branch. If the branch does not exist,
bzr
will create a shared repository with a branch namedtrunk
in it.
For more details, see the help pages:
bzr help fast-export
bzr help fast-import-filter
bzr help fast-import
The fastimport
plugin is included in the default installation on Windows and Mac OS X. If you have a more exotic setup, I recommend installing it with pip
. I don't remember 100% the package name, maybe bzr-fastimport
. You will also need the fastimport
python library.