Monotonically increasing bazaar trunk revision numbers

扶醉桌前 提交于 2019-12-11 08:52:57

问题


I'm still figuring out how bazaar's revision numbering works. The workflow our team uses is basically:

bzr branch lp:project/trunk
# code,code,code
bzr commit ...
# code,code,code
bzr commit ...
bzr merge
# resolve, resolve, resolve
bzr push lp:project/trunk

I'd prefer it if the trunk revision numbering was stable and increased monotonically with each push. However, as I understand it, whoever does bzr merge; bzr push lp:project/trunk ends up renumbering the revision history of the trunk to whatever their local branch revision numbering was. This makes things very confusing for the team, because "trunk, revision 705" may change over time.

We could use global ids, but it's a little awkward to work with a long string like foo@example.com-20110224160420-nnob0vg2vdk0yjow.

Is there any way to arrange our workflow so that the trunk revision numbering scheme is stable and increases monotonically?


回答1:


On the trunk on your central server, edit <yourbranch>/.bzr/branch/branch.conf or ~/.bazaar/locations.conf or ~/.bazaar/bazaar.conf

add append_revisions_only=True

This branch's existing revision order will not change any more.

http://doc.bazaar.canonical.com/beta/en/user-reference/configuration-help.html#append-revisions-only

Edit: For launchpad you can try the following as John Arbash Meinel said:

At the moment, the only way to get a branch with that option is during "bzr init".

bzr init --append-revisions-only

So you could:

1) have launchpad delete the existing branch

2) bzr init --append-revisions-only lp:...

3) bzr push lp:...

Not exactly optimal.

The other way to do it is to use sftp and do:

sftp bazaar.launchpad.net

cd ~user/project/branch/.bzr/branch get branch.conf

Then outside of sftp, edit the file to add append_revisions_only = True

put branch.conf

https://lists.ubuntu.com/archives/bazaar/2008q3/046797.html



来源:https://stackoverflow.com/questions/5413602/monotonically-increasing-bazaar-trunk-revision-numbers

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!