amend: query the wdir parent after taking lock (issue5266)
If we query wdir parent without taking a lock, that can lead to bugs because the
wdir parent can change is another process has changed the wdir parent.
One such example of this was issue 5266. When a user is running amend and that
amend is waiting for commit message, the user runs another amend which waits for
lock. The second amend is waiting for lock, but has already read the description
from the parent of working directory to use. Once the first amend completes the
wdir parent changes but we still have the description from an old wdir parent.
This patch fixes the bug by querying the description after taking lock.
Attempts were made to add test for this but the results were unstable because
they depend on time in which lock is released.
.. Copyright 2011 Pierre-Yves David <pierre-yves.david@ens-lyon.org>
.. Logilab SA <contact@logilab.fr>
-----------------------------------------
Good practice for (early) users of evolve
-----------------------------------------
Avoid unstability
-----------------
The less unstability you have the less you need to resolve.
Evolve is not yet able to detect and solve every situation. And your mind is
not ready neither.
Branch as much as possible
--------------------------
This is not MQ; you are not constrained to linear history.
Making a branch per independent branch will help you avoid unstability
and conflict.
Rewrite your changes only
-------------------------
There is no descent conflict detection and handling right now.
Rewriting other people's changesets guarantees that you will get
conflicts. Communicate with your fellow developers before trying to
touch other people's work (which is a good practice in any case).
Using multiple branches will help you to achieve this goal.
Prefer pushing unstability to touching other people changesets
--------------------------------------------------------------
If you have children changesets from other people that you don't really care
about, prefer not altering them to risking a conflict by stabilizing them.
Do not get too confident
------------------------
This is an experimental extension and a complex concept. This is beautiful,
powerful and robust on paper, but the tool and your mind may not be prepared for
all situations yet.