简体   繁体   English

我可以svn合并而不总是指定第一个修订版?

[英]can I svn merge without always specifying the first revision?

The pickiest question I have ever posted to SO: 我发布给SO的最挑剔的问题:

myproject/tags/production always contains the production-ready version of myproject. myproject / tags / production始终包含myproject的生产就绪版本。 I merge sequential approved revisions from trunk into it like so, where N is the currently live rev, and M is the new desired rev: 我将顺序批准的版本从trunk合并到其中,其中N是当前的实时转速,M是新的期望转速:

cd tags/production cd标签/制作
svn merge -r N:M ^/trunk svn merge -r N:M ^ / trunk
svn ci -m 'merging trunk through rxxxx to production svn ci -m'通过rxxxx将trunk合并到生产中

My question is, why do I always have to specify N? 我的问题是,为什么我总是要指定N? If I just use "-r M" I get "svn: Second revision required". 如果我只使用“-r M”,我会得到“svn:需要第二次修订”。 But N is always the same as my previous M, and I thought the point of merge tracking (we are running svn 1.6) was so that svn remembers the revisions you already merged..? 但是N总是跟我之前的M一样,我认为合并跟踪的点(我们运行svn 1.6)是因为svn记得你已经合并的修订版。

I didn't try it myself but, according to subversion documentation, the merge command is smart enough to include only not previously merged changes . 我自己没有尝试过,但根据subversion文档, merge命令足够智能,只包含以前没有合并的更改

But if you don't want to include all trunk revisions you could try: 但是,如果您不想包含所有主干修订版,您可以尝试:

svn merge -r 0:M ^/trunk

It should merge changes not already merged into your working copy up to revision M . 它应该将尚未合并到工作副本中的更改合并到修订版M中

Theoretically, Subversion could do what you're asking and allow automatic merging up to a specified point. 从理论上讲,Subversion可以做你想要的,并允许自动合并到指定的点。 Probably the problem is that "-r M" means a single revision M, whereas merging is an operation on a range of revisions. 问题可能是“-r M”表示单个修订M,而合并是对一系列修订的操作。 Implicitly converting a single-revision type parameter to a revision-range parameter does not sound like a good idea. 将单修订版类型参数隐式转换为修订范围参数听起来不是一个好主意。

Subversion should do merge tracking just fine if revisions are not specified manually. 如果没有手动指定修订版,Subversion应该合并跟踪。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM