I\'m trying to understand the details of the subversion merge commands. I think understanding the difference between a change that is also a conflict and a change that is n
Consider a function like this (call it revision 1)
void foo(){
int bar;
}
Now let's suppose two people make changes to this function, both starting from revision 1.
Alice:
void foo(){
char bar;
}
Bob:
double foo(){
double bar;
bar = 0;
return bar;
}
For the sake of this example, let's suppose Alice commits her changes.
Now Bob goes to commit changes, and svn will tell Bob he's out of date, and needs to update and merge changes. So Bob runs an update, and the merge occurs.
Basically, it's (somewhat) easy to see that what happens is an analysis that decides what Bob changed from revision 1 and what Alice changed from revision 1. A simple merge will produce something like
double foo(){
[conflict] bar;
bar = 0;
return bar;
}
Note that both Alice and Bob changed the type of bar
from int
, except Alice made it char
and Bob made it double
. The merger cannot decide which one is correct (it's not doing code analysis), so as a human Bob needs to help resolve the conflict.
The example is, of course, somewhat contrived, and with the exception of the noted conflict, all other changes are not conflicts.
If Bob had not changed the type of bar
, the files would've merged without conflict.