简体   繁体   中英

svn merge doesn't merge

I'm trying to merge some hotfixes from trunk onto a branch. When I compare trunk/foo.py and branches/feature/foo.py , I see differences. Yet, when I run svn merge https://<svn server>/trunk/foo.py foo.py , no changes get merged. Retrying with the --force option has no effect either. It seems like SVN thinks that the feature branch's copy of foo.py is the latest version. How do I convince SVN otherwise?

EDIT: My Subversion client is svn version 1.6.16 (Linux). The server is running trac, version 0.12.

EDIT2: The version of subversion the server is 1.6.9. Thanks to hasienda in the comments for pointing out that trac and subversion aren't necessarily correlated.

I'd start with;

  • Are both the Trunk and Branch files committed to SVN? No merge can happen if the files aren't in the repository.
  • Compare svn info <trunk>/foo.py and svn <branch>/foo.py ; Check the last Changed Rev & Date, if SVN says they're the same file, no merge would happen.

You can check out Advanced Merging for additional information.

我不确定你使用的是什么版本的subversion,但是我认为合并跟踪还没有完全实现。

Whenever something in Subversion is behaving unexpectedly or seems to be harder than it should be, my general rule of thumb is to grab a fresh working copy in a new, clean directory and try it again with no local modifications. This tends to rule out a number of subtle problems that can be hard to detect.

Also, do a svn diff <server>/branches/this_branch <server>/trunk to make sure Subversion thinks that there are changes to merge. Using two repository paths here will eliminate any possible issues with your working copy. If the above diff command gives you different results when you swap the branch URL with the path to your WC, then the problem is likely something in your working copy.

You can also do the merge purely in the repository by providing two full URLs to the merge command. If you go that route, I highly suggest using the --dry-run option to preview the merge before making it official.

Also, is there a reason why you are merging using specific filenames and not simply merging the the entire /trunk to your branch? I typically see far fewer problems when merging entire revisions into a branch rather than into specific files.

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