Revious
Revious

Reputation: 8156

How is merging working in SVN?

Imagine I've a difference in a piece of code between the branch A and the branch B which is seen by SVN as a conflict.

When I try to merge the possible situations are:

  1. only A has been modified
  2. only B has been modified
  3. Both A and B have been modified

Is SVN providing me this information? Since I'm getting crazy trying to compare some huge CSS files...

Upvotes: 0

Views: 335

Answers (1)

Álvaro González
Álvaro González

Reputation: 146603

Of course, conflict means that both branches have modified the same code. Otherwise, there wouldn't be a conflict and Subversion would have been able to merge changes automatically.

Whenever there's a conflict related to file contents (directories are a different story) Subversion provides the following hints:

  1. All three involved files are dumped into your working copy:

    • foo.php.merge-left.r832
    • foo.php.merge-right.r833
    • foo.php.working
  2. Original file foo gets conflicts markers:

    <<<<<<< .working
     * Lower bound for DATETIME columns at SQL Server 2005
     */
    define('MIN_YEAR_SQL_SERVER', 1753);
    
    /*
     * Lower bound for date controls regarding building date
    =======
     * Lower bound for date controls
    >>>>>>> .merge-right.r833
    

    ... where first block is your current code and second block is incoming code.

Third-party merge tools can make this easier (or harder) but this is the information Subversion provides.

Upvotes: 3

Related Questions