Fix hg push and hg push -r sometimes creating new heads without --force.
Fixing
issue179.
The algorithm checks if there not more new heads on the remote side than heads
which become non-heads due to getting children.
Pushing this repo:
m
/\
3 3a|
|/ /
2 2a
|/
1
to a repo only having 1, 2 and 3 didn't abort requiring --force before.
Added test cases for this and some doc strings for used methods.
add merge command. means same thing as "update -m".
repo.addchangegroup method now returns number of heads modified and added,
so command line can tell whether update or merge needed. this makes
tiny change to ssh wire protocol, but change is backwards compatible.
pull command now returns 0 if no changes to pull.
fix backtrace printed when cannot get lock.
change lock error handling code so exceptions have useful info and
exception handling in one place.
add test case for when cannot get lock.
Catch HTTPException when reading from remote http repository.
If the server dies very early, an httplib.IncompleteRead exception may be
raised, because httplib can't read a single byte. Catching all HTTPException
subclasses here will prevent ugly backtraces for similar things, too.