简体   繁体   中英

can I svn merge without always specifying the first revision?

The pickiest question I have ever posted to SO:

myproject/tags/production always contains the production-ready version of 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:

cd tags/production
svn merge -r N:M ^/trunk
svn ci -m 'merging trunk through rxxxx to production

My question is, why do I always have to specify N? If I just use "-r M" I get "svn: Second revision required". 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..?

I didn't try it myself but, according to subversion documentation, the merge command is smart enough to include only not previously merged changes .

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 .

Theoretically, Subversion could do what you're asking and allow automatic merging up to a specified point. Probably the problem is that "-r M" means a single revision M, whereas merging is an operation on a range of revisions. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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