SVN keeps corrupting files with "<<<<<<< .mine", how to fix?
Asked Answered
S

13

52

I've got a Visual Studio C# project which is under version control (SVN). I've always commited and updated the project without any problems. But a couple of hours ago Visual Studio throws the following error when I try to launch/rebuild the project:

Files has invalid value "<<<<<<< .mine". Illegal characters in path.

I don't know how to fix this problem. What should I do?

Streamy answered 6/1, 2010 at 12:17 Comment(0)
C
66

That happens when svn encounters a conflict: You changed a file, the file on the server was changed and it cannot (easily) be merged automatically. You need to decide what is the correct solution now.

Subversion just adds the diff into your source file (and creates files next to it, called OriginalName.mine (unchanged) and OriginalName.rsomething (unchanged, server version)).

Fix the conflict and tell subversion that this is resolved.

Cyclopedia answered 6/1, 2010 at 12:21 Comment(2)
Thanks all. Found the problem by viewing differences with my working copy, it seemed to be a file in the Debug folder (which I exluded from SVN today). One of my co-workers resolved things while not being resolved..Streamy
Fix the conflict in which of the 3 files? .mine? .rOLDREV? .rNEWREV? Answer: None of them. Instead, fix in the original file (that's right: SVN's attempt to commit leaves 4 confusing files)Dowable
C
43

just delete the obj folder and it will worked fine.

Courson answered 6/11, 2013 at 6:10 Comment(4)
@MysticEarth: The error that you have in the subject line comes up sometimes if you try to build before resolving the conflicts, and keeps coming up EVEN AFTER you have resolved it. grepping the directories doesn't turn up anything to do with "<<<<<.mine" because it's embedded in binary form beneath obj; thusly you're none the wiser what is causing the build problem, nor how to fix it. Deleting /obj fixes the problem immediately. So you're wrong, the obj folder has something to do with corrupting files by Subversion. Ho hum.Alpheus
+1 this worked for me as well. The "Error List" wasn't listing any specific file and I had manually resolved the conflicts and ReSharper wouldn't see any problems in the solution, and Find wouldn't find anything like ".mine", but still VS would refuse to Build or even to Clean. Deleting the "obj" folder was an instant fix. No need to restart VS.Lobbyism
yes it worked fine for me also. I just deleted "obj" folder and it worked fine for me.Burier
Thanks for solution!Shipman
H
11

Remove the code that shouldn't be in the file throwing the error and remove the the three files with extensions .mine, .<somerevision> and .<some_other_revision>. svn updated files that now contain 'conflicts' and you need to resolve these conflicts by hand. Usually this means you edited a file, someone else edited the same file and checked in changes and you didn't pay attention when checking out the changed file.

Heliotype answered 6/1, 2010 at 12:20 Comment(6)
Perhaps a stupid question; but where can I find the .mine files? I can't seem to find them. Also, no file is in conflict and when I search through all files for "mine", nothing is found...Streamy
Right next to the source file that doesn't compile anymore (because of the conflict markers). Check for files with the same basename, but different extensions.Cyclopedia
Well, Visual Studio doesn't give any filename, just the error above. And I don't see any conflict markers...Streamy
It will either be in the .csproj (or .vcproj or whatever) file or the .sln file. You can use the appropriately titled 'blame' function of svn to see who committed the offending lines. Whoever that is has resolved a conflict incorrectly.Downpour
Forget Visual Studio for a moment and navigate to the file in the filesystem. You'll find the mentioned files there. You can resolve the conflict from your IDE though (edit the file). Evil train of thoughts: Maybe some of your co-workers managed to check that file in with conflict markers inside..?Cyclopedia
Thanks all. Found the problem by viewing differences with my working copy, it seemed to be a file in the Debug folder (which I exluded from SVN today). One of my co-workers resolved things while not being resolved..Streamy
C
11

Delete every thing you have in obj folder .

Remove your obj folder from svn version control . Because on every build it get updated and when other developer commit changes to solution SVN is unable to marge obj folder files and raise error

Files has invalid value "<<<<<<< .mine". Illegal characters in path.

Condonation answered 22/12, 2015 at 5:26 Comment(0)
V
6

Please read the Basic Usage chapter in the subversion book. It has a section about Merging conflicts by hand which explains the conflict markers you're seeing.

Vinegarish answered 6/1, 2010 at 12:49 Comment(1)
currently i was writing an example of my own, but like always the svnbook has a far more comprehensive one and if you're using Tortoise take a look into tortoisesvn.net/docs/release/TortoiseSVN_en/index.html (especially into chapter 4 Daily Usage Guide)Stogy
G
3

Removing the debug folders worked for me (see comment-not answer above). I got this after moving 12 folders from one section of svn to a new section. So if you get this after moving a project and the error does not point to an actual file, this is likely your issue.

Geode answered 17/5, 2012 at 19:41 Comment(1)
Thanks, it was because of the debug folder, it was not pointing to an actual file.Henryhenryetta
M
2

If you have AnkhSVN or VisualSVN installed resolving this is most likely as easy as right clicking the file in the solution explorer and selecting edit conflict.

This will open the changed file in your merge editor. (See Tools->Options->Source Control->Subversion User tools for AnkhSVN). With a good merge tool like the free to use SourceGear DiffMerge or TortoiseMerge, resolving the conflict is just a few mouseclicks away.

Merci answered 6/1, 2010 at 13:54 Comment(1)
VisualSVN actually does this using TortoiseSVN. You can also do it with TortoiseSVN by right-clicking the file in Windows Explorer and selecting Edit Conflict.Headphone
P
1

I have had this happen on a large scale where the files get marked resolved but the conflict metadata is still there. I wrote a regular expression for visual studio to find these, for instances where it is not feasible to simply revert the changed files.

http://www.codetunnel.com/blog/post/90/ever-merge-with-svn-and-mess-up-when-resolving-conflicts-read-on

Prosperous answered 29/8, 2011 at 17:15 Comment(0)
D
1

I closed the IDE, then deleted the obj folder and restarted the IDE and rebuilt my Code. This worked for me.

Descartes answered 17/9, 2013 at 4:33 Comment(1)
No need to close/reopen VS. Click "Show all files" in the Solution Explorer and delete the "Obj" folder. Done.Lobbyism
D
1
  • Inside your project :

    odj folder -> Debug -> project name.csproj.Filelistabsolute.txt(snb.csproj.Filelistabsolute.txt)

  • Inside the text file >>>>>>>.mine and >>>>>>>.r150 occurs to remove the things the program works

Dimorphism answered 17/3, 2015 at 7:16 Comment(0)
P
1

1)Just save your local changes whatever u have edited in the file

2)revert the file

3)update it from SVN

4)Paste your local changes

Palaearctic answered 3/12, 2015 at 5:6 Comment(1)
This is what I do all the time to get past this error.Thiol
B
0

If you are using TortoiseSVN you should have a right click option on the file called Edit Conflicts. This should bring up TortoiseMerge which is able to read those obnoxious notations stuck into the file (really, to break your code so you KNOW there's an issue and don't blindly check it in).

TortoiseMerge will read it properly and present you with a 3-way merge. This was what I was looking for. Although it is true that it does also create the separate .mine and .rxxx and .ryyy files, and there are various manual and command-line ways to deal with all this.

Bloodthirsty answered 13/1, 2016 at 16:49 Comment(0)
A
-1

Have a simple solution. just delete all file from debug folder and rebuild the solution, an error display on the screen "There were build errors. Would you like to continue and run the last successful build? click on "Yes" button. Now stop the program and run normally.

Angelicaangelico answered 1/5, 2021 at 7:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.