Mercurial state - race when pressed using subppos

With a fairly simple subrepo structure:

Parent
Parent / subrepo1
parent / subrepo2

Race conditions typically occur when multiple users change changes at the same time. A simple example:

User 1 and 2 start to click.
User 1 skips parent/subrepo1 , no change.
User 2 clicks on parent/subrepo1 with the changes.
User 1 clicks on parent/subrepo2 with the changes.
User 2 tries to click on parent/subrepo2 , but cannot, because he will create several heads.
User 1 finishes pressing parent .

The result of this is that User 1 was able to successfully press everything, but User 2 partially pressed, and then failed. This left a head for parent/subrepo1 , which does not have a corresponding commit in parent , which will cause problems for the next person to press parent/subrepo1 unless user 2 detects its error, pulls parent , merges, and then tries to press (but not guarantees that another user will not try to click again at the same time!).

My question is: is there a way in Mercurial to make users wait while the push operation is performed in the Mercurial repository with other subrepos (for effective implementation of the mutex) OR is there a way to cancel the failed click on a target changed by subrepos when the user cannot click.

+4
source share

Source: https://habr.com/ru/post/1485936/


All Articles