SVN Skipped File

5.6k views Asked by At

When I try to merge code from trunk to a branch, it will not pick up all of my files. The files will show "skipped" in the merge log.

Of course I searched for the issue first and found the common problem of merging but not committing, then reverting, then merging. Some order of those functions seems to cause a problem. Something with the file still being on my hard drive but not in SVN so it is skipped. I don't think that is what's going on here.

First thing I did was I deleted my branch locally (I don't have any changes to commit). I pulled a fresh copy from the repo and tried the merge again. I got the same error. I was hoping it would be solved b/c from what I found already I think that should have done it.

Then things got strange. When I was doing a merge on my top level directory (fully recursive), the file I wanted to add was "skipped". But when I merged only the subfolder (i.e. from /trunk/src/main/.../subfolder to /branch/src/main/.../subfolder) then the file was "added".

So my question is why would the granularity matter? Why at a top level are files skipped, but if I drill down to the level of the file it is then able to be "added"?

3

There are 3 answers

0
Crick3t On

The “Skipped” message means that the merge operations wants to create or modify a file but that file already exists in your working copy and is not under version control.

I had the same issue when I tried to revert a change where I added files and for some reason the file has not been deleted from the working copy folder, but removed from repository. Then I did the change again but when tried to merge it it skipped half of the files.

In this case the solution is to run a clean-up on the destination folder and click "Delete unversioned files and folders". This removes the files that should not be there and the merge should go through next time.

Or, if you have only a few skipped files then just delete those files manually.

0
Michal On

Subversion uses a property svn:mergeinfo to record what revisions from where were merged to the given branch (the property content is essentially list of location and revision ranges, that were merged). If you do the merge, svn changes both the merged files and the svn:mergeinfo on root dir of the merge. If you then revert the files, but don't revert the propset (and eventually commit the property), then you might run into trouble (because what got merged is different from what svn thinks was merged). But if you had no commits in your branch and you had a freshly checkted out working copy, then this should not be a case.

Generally, the skipped message means, that in the merged revisions, there is a change to a file, but this file is not present in your working copy (see the SVN Book): this typically happens when you are merging from wrong location, or you skipped some revisions (e.g. the ones where the file was created).

1
Steve Barnes On

It is possible that the sub-directory is an extern i.e. comes from a different repository from the rest of your code - so if the majority of your code is in repository A and some of the stuff, e.g. things like common library interface files, are from repository B then a commit from the top level of your code is to A and is not allowed to change repository B but if some subdirectory is marked as (possibly part of) repository B then a check from that sub-directory there is allowed to change B.