changeset 49199:575f3dedb69a

auto-upgrade: add a test case where the repository is already locked This show the current behavior when the repository to auto-upgrade is already locked. The current behavior is to abort, which is probably not great. Now that we have a proper test, we can think about the behavior we wants in a later tests. Differential Revision: https://phab.mercurial-scm.org/D12618
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 05 Apr 2022 04:45:48 +0200
parents a68b37524d50
children 71774d799de7
files tests/test-upgrade-repo.t
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-upgrade-repo.t	Tue Apr 05 04:43:34 2022 +0200
+++ b/tests/test-upgrade-repo.t	Tue Apr 05 04:45:48 2022 +0200
@@ -2076,3 +2076,18 @@
 
   $ chmod -R u+w auto-upgrade
 
+Attempting Auto-upgrade on a locked repository
+----------------------------------------------
+
+  $ hg -R auto-upgrade debuglock --set-lock --quiet &
+  $ echo $! >> $DAEMON_PIDS
+  $ $RUNTESTDIR/testlib/wait-on-file 10 auto-upgrade/.hg/store/lock
+  $ hg status -R auto-upgrade \
+  >     --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
+  >     --config format.use-dirstate-v2=no
+  abort: repository auto-upgrade: timed out waiting for lock held by 'brunhoff/effffffc:1215708'
+  [20]
+  $ hg debugformat -R auto-upgrade | grep dirstate-v2
+  dirstate-v2:        yes
+
+  $ killdaemons.py