Well, they are quite safe as long as you don't start reorganizing your code.
Consider the following example:
class A {
public void methodA() {
// do something here
// that should be great
}
public void methodB() {
// And now I'll
// do something here
// and it's gonna be good.
}
public void methodC() {
// Finally, let's
// do something here
}
}
Now, you start working and decide to add some instructions to methodC.
During this time, a co-worker decided that methodC, for whatever reason, should be placed on top of the class.
You will end up with two versions to merge.
Yours:
class A {
public void methodA() {
// do something here
// that should be great
}
public void methodB() {
// And now I'll
// do something here
// and it's gonna be good.
}
public void methodC() {
// Finally, let's
// do something here
// and here your marvelous changes
}
}
And your co-worker ones:
class A {
public void methodC() {
// Finally, let's
// do something here
}
public void methodA() {
// do something here
// that should be great
}
public void methodB() {
// And now I'll
// do something here
// and it's gonna be good.
}
}
When the merge occurs, as the default context is three lines wide, the automatic merge might consider that a valid result would be this one:
class A {
public void methodC() {
// Finally, let's
// do something here
}
public void methodA() {
// do something here
// that should be great
}
public void methodB() {
// And now I'll
// do something here
// and it's gonna be good.
}
public void methodC() {
// Finally, let's
// do something here
// and here your marvelous changes
}
}
For that reason, if possible, I try to keep methods organized so that accessors are grouped, and untouched, privates are grouped by common logic, etc... But it is not always possible.
Hopefully this case is quite rare and if there are too many changes, mercurial will request you to merge the classes manually.