wiki:CodeTroubleShootingResolvingVersionConflict

Version 2 (modified by trac, 12 years ago) ( diff )

Resolving an SVN Version Conflict


Problem: During compile time, error messages with the following structure appear:

fortcom: Error: beario.mpi_cpp.f90, line 53: Syntax error, found '<' when expecting one of: <LABEL> <END-OF-STATEMENT> ; BLOCK BLOCKDATA PROGRAM TYPE COMPLEX BYTE CHARACTER ...
<<<<<<< .mine
^
fortcom: Error: beario.mpi_cpp.f90, line 56: Syntax error, found '==' when expecting one of: <LABEL> <END-OF-STATEMENT> ; BLOCK BLOCKDATA PROGRAM TYPE COMPLEX BYTE CHARACTER ...
=======
^
fortcom: Error: beario.mpi_cpp.f90, line 62: Syntax error, found '>' when expecting one of: <LABEL> <END-OF-STATEMENT> ; BLOCK BLOCKDATA PROGRAM TYPE COMPLEX BYTE CHARACTER ...
>>>>>>> .r190
^

Cause: The <<<<<<< .mine, ======= and >>>>>>> .r190 lines appear because of an SVN version conflict. These three lines enclose blocks of irreconcilable code in the following format:

<<<<<<< .mine
...
{code from working copy}
...
=======
...
{code from revision REVNUM repository copy}
...
>>>>>>> .rREVNUM

Solution: There are two options when resolving a version conflict: either integrate the irreconcilable blocks yourself, or replace the file with one of the "pure" versions of the file created during the attempt to merge.

When SVN attempts to merge two versions of the file file_name, it backs up the two versions. file_name.mine is the backup of the working copy, and file_name.rREVNUM is the copy from revision REVNUM in the repository. file_name itself becomes a hybrid of the two, enclosing the irreconcilable blocks of code in the manner shown above.

Looking over the irreconcilable blocks and deciding what to do about them yourself is probably the safest way, albeit the most time-consuming. Needless to say, there's no formulaic way of doing this, otherwise SVN would have done it automatically.

By overwriting the hybrid file_name with file_name.mine or file_name.f90, you essentially revert to a "pure" version of the file (this is useful if one version actually got it right and SVN is just being a pill). Be warned, however, that more than one irreconcilable block may exist within file_name, so be sure to check it carefully before you fix it this way.

Note: See TracWiki for help on using the wiki.