Is there a way to get CVS to not produce merge conflicts on keyword substitutions like $Id: $

╄→гoц情女王★ 提交于 2019-12-10 19:15:33

问题


We use CVS currently and develop new features on a branch before merging to trunk. Occasionally we get merge conflicts caused by the CVS keyword substitution. So when reviewing the conflict file we see something like this

<<<<<<< collect_logs.conf
# CVS $Id: collect_logs.conf,v 1.6 2010/02/03 16:43:11 peterw Exp $
=======
# CVS $Id: collect_logs.conf,v 1.13 2010-05-07 17:14:43 peterw Exp $
>>>>>>> 1.13

And that will be the only conflict in the file.

I have done a little bit of investigating and as you probably notice there is a slight difference in the formatting of the date in the entry. This is due to different cvs version being used over different platforms (one on Solaris, the other on Linux) I believe that is what's triggering the conflict.

The workaround is to simply do a fresh checkout of the project and then to do the cvs update from there. As all the keywords are generated in the same format it is happy to merge.

My Question is can you command cvs to cope better with merging on the keyword substitutions. Or is it simply better to avoid it with fresh checkouts like I have?

Thanks

Peter


回答1:


You would use update -kk ... as per the CVS documentation on Merging and keywords(section 5.10).

The k attached to the -k (keyword substitution mode) causes CVS to just output the keyword and not the value of the keyword. So in theory your multiple date formats shouldn't be a problem. I haven't tested this theory though.



来源:https://stackoverflow.com/questions/3185741/is-there-a-way-to-get-cvs-to-not-produce-merge-conflicts-on-keyword-substitution

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