我要做的是:从一个像你创建的项目开始:
mkdir myProject
cd myProject
bzr init
bzr mkdir src
bzr mkdir data
bzr mkdir foo
....
# (As per your steps above)
bzr add
bzr ci -m "Done stuff"
现在创建一个存储库并将分支推入其中:
# Now make it into a multi-branch project
cd ..
# Make a new repository with no working trees
bzr init-repo --no-trees repo
# Branch the project into the repository
bzr branch myProject repo/trunk
# Get rid of the project (by moving, to keep a backup)
mv myProject myProject_backup
现在开始处理签出(轻量级或其他取决于您的偏好):
# Now get a working copy and put it in a separate folder to the repo
bzr co --lightweight repo/trunk myProject
# Now do stuff
cd myProject
# Hack hack hack
bzr ci -m "Done stuff"
# Time to change branch (-b creates the new branch in the repository):
bzr switch -b testFeature1
# Now it is a lightweight checkout of ../repo/testFeature1, which is branched off trunk
# Hack hack hack
bzr ci -m "Done stuff with testFeature1: seems to work"
并将更改合并回主干:
bzr switch trunk
bzr merge ../repo/testFeature1
bzr ci -m "Merged testFeature1 development."
bzr switch
在链接到存储库时,采用相对于当前目录的绝对路径或相对于存储库的路径,但是
bzr merge
这可能不适合您的工作流程(签出等),但这是实现您想要做的事情的相当有效的方法。希望有帮助。