有没有办法让CVS在诸如$ Id:$之类的关键字替换上不产生合并冲突 [英] Is there a way to get CVS to not produce merge conflicts on keyword substitutions like $Id: $

查看:85
本文介绍了有没有办法让CVS在诸如$ Id:$之类的关键字替换上不产生合并冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们当前使用CVS,并在合并到主干之前在分支上开发新功能.有时,我们会遇到由CVS关键字替换引起的合并冲突.因此,在查看冲突文件时,我们会看到类似的内容

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

这将是文件中的 only 冲突.

And that will be the only conflict in the file.

我做了一些调查,您可能已经注意到,条目中日期的格式略有不同.这是由于在不同平台上使用了不同的cvs版本(一个在Solaris上,另一个在Linux上),我认为这是引发冲突的原因.

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.

解决方法是简单地对项目进行全新签出,然后从那里进行cvs更新.由于所有关键字都是以相同的格式生成的,因此很高兴进行合并.

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.

我的问题是,您能否命令CVS更好地应对关键字替换的合并.还是最好像我一样通过新鲜的结帐来避免这种情况?

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?

谢谢

彼得

推荐答案

根据update -kk .... 23/cvs_5.html#SEC64"rel =" nofollow>合并和关键字(第5.10节).

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

连接到-kk(关键字替换模式)使CVS仅输出关键字而不是关键字的值.因此,从理论上讲,您的多种日期格式应该不是问题.我还没有检验过这个理论.

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.

这篇关于有没有办法让CVS在诸如$ Id:$之类的关键字替换上不产生合并冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆