1

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.

quanticle
  • 4,872
  • 6
  • 32
  • 42
  • What version of SVN? Looks like you're using a command line client? – AlG Feb 28 '12 at 21:41
  • I'm using SVN 1.6.16, and I'm using the command-line client for Linux. – quanticle Feb 28 '12 at 21:54
  • In what way is this related to the Trac installation? Trac doesn't do anything to the repository other than making it accessible (read-only!) by the Trac repository browser via HTTP. – hasienda Feb 28 '12 at 22:51
  • I'm not too familiar with trac, so I thought it somehow integrated Subversion. I've looked again and the subversion version on the server is 1.6.9. – quanticle Feb 28 '12 at 23:05
  • Do you merge inside WC? WC of trunk or branch? Did you read `svn help merge`? – Lazy Badger Feb 29 '12 at 01:06
  • The merge was `server -> wc`, where `wc` is a copy of the branch. `svn help merge` and the [SVN Book](http://svnbook.red-bean.com/) both say that this should have been a straightforward affair - just another sync merge. – quanticle Feb 29 '12 at 02:36
  • Does your working copy contain any local changes that have not yet been committed to your branch? – bta Feb 29 '12 at 13:55

3 Answers3

2

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.

AlG
  • 14,697
  • 4
  • 41
  • 54
  • Thanks for the advanced merging link. I found that if I pointed SVN at the specific revision that I wanted merged, it'd merge. However, if I just told it to merge from the trunk's HEAD revision, it wouldn't merge. I'm going to have to take a look at this further in the future, but for now, I have the revisions, and I can continue working. Thanks for your help. – quanticle Mar 01 '12 at 16:11
0

I'm not sure what version of subversion you're using but merge tracking wasn't fully implemented until 1.5 I think.

Thomas Schultz
  • 2,446
  • 3
  • 25
  • 36
0

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.

bta
  • 43,959
  • 6
  • 69
  • 99