phase-shelve: correct unicode string to honor 'shelve.store=internal'
authorJason R. Coombs <jaraco@jaraco.com>
Mon, 22 Aug 2022 16:59:14 -0400
changeset 49457 53229e170496
parent 49456 cdfba684b6a1
child 49459 df1d4e442c08
phase-shelve: correct unicode string to honor 'shelve.store=internal' In the case of strip-based shelves, there should be no hidden commit found. That's because shelve.store=internal is necessary but not sufficient to enable phase-based shelves; internal-phase must also be set.
mercurial/configitems.py
mercurial/shelve.py
tests/test-shelve.t
--- a/mercurial/configitems.py	Fri Aug 12 14:35:34 2022 -0700
+++ b/mercurial/configitems.py	Mon Aug 22 16:59:14 2022 -0400
@@ -1454,7 +1454,7 @@
 coreconfigitem(
     b'shelve',
     b'store',
-    default='internal',
+    default=b'internal',
     experimental=True,
 )
 coreconfigitem(
--- a/mercurial/shelve.py	Fri Aug 12 14:35:34 2022 -0700
+++ b/mercurial/shelve.py	Mon Aug 22 16:59:14 2022 -0400
@@ -102,7 +102,7 @@
 def _use_internal_phase(repo):
     return (
         phases.supportinternal(repo)
-        and repo.ui.config(b'shelve', b'store') == 'internal'
+        and repo.ui.config(b'shelve', b'store') == b'internal'
     )
 
 
--- a/tests/test-shelve.t	Fri Aug 12 14:35:34 2022 -0700
+++ b/tests/test-shelve.t	Mon Aug 22 16:59:14 2022 -0400
@@ -1605,3 +1605,16 @@
   default.patch
   default.shelve
   $ hg unshelve -q
+
+Override the disabling, re-enabling phase-based shelves
+
+  $ hg shelve --config shelve.store=internal -q
+
+#if phasebased
+  $ hg log --hidden --template '{user}\n'
+  shelve@localhost
+#endif
+
+#if stripbased
+  $ hg log --hidden --template '{user}\n'
+#endif