amend: wrap all commit operations in a single transaction
This allows proper recovery of an interrupted amend process.
No changes are made to the logic besides:
- indent operations into a single try-except clause,
- some comment and code wrapping to 80 chars,
- strip logic should not be contained in the transaction and is extracted from
the main code.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Sat, 25 Aug 2012 15:37:28 +0200] rev 17471
amend: lock the repository during the whole process
Without this changes another writer can lock the repository in the middle the
amend process. The resulting mess can be pretty ugly.