changeset 49196:1c233af99316

auto-upgrade: add a test case with no permission to lock the repository This show the current behavior when the repository is unlockable. 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 want in a later changeset. Differential Revision: https://phab.mercurial-scm.org/D12615
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 05 Apr 2022 03:36:31 +0200
parents 411d591e0a27
children 883be4c74d54
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 Mar 22 14:14:52 2022 +0100
+++ b/tests/test-upgrade-repo.t	Tue Apr 05 03:36:31 2022 +0200
@@ -2061,3 +2061,18 @@
   tracked-hint:        no
   share-safe:         yes
 
+Attempting Auto-upgrade on a read-only repository
+-------------------------------------------------
+
+  $ chmod -R a-w auto-upgrade
+
+  $ hg status -R auto-upgrade \
+  >     --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
+  >     --config format.use-dirstate-v2=no
+  abort: could not lock working directory of auto-upgrade: Permission denied
+  [20]
+  $ hg debugformat -R auto-upgrade | grep dirstate-v2
+  dirstate-v2:        yes
+
+  $ chmod -R u+w auto-upgrade
+