Patchwork D12615: auto-upgrade: add a test case with no permission to lock the repository

login
register
mail settings
Submitter phabricator
Date May 6, 2022, 8:38 a.m.
Message ID <differential-rev-PHID-DREV-mrx5wcgpwuopg2ekxlif-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50964/
State New
Headers show

Comments

phabricator - May 6, 2022, 8:38 a.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This show the current behavior is 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 wants in a later tests.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D12615

AFFECTED FILES
  tests/test-upgrade-repo.t

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-upgrade-repo.t b/tests/test-upgrade-repo.t
--- a/tests/test-upgrade-repo.t
+++ b/tests/test-upgrade-repo.t
@@ -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
+