tests/hghave.py
changeset 47279 40b51c28b242
parent 47080 94c0c36299b1
child 47301 97f04eaafa65
--- a/tests/hghave.py	Wed May 19 13:14:59 2021 +0200
+++ b/tests/hghave.py	Wed May 19 13:15:00 2021 +0200
@@ -1045,6 +1045,14 @@
     return 'fncache' in getrepofeatures()
 
 
+@check('dirstate-v2', 'using the v2 format of .hg/dirstate')
+def has_dirstate_v2():
+    # Keep this logic in sync with `newreporequirements()` in `mercurial/localrepo.py`
+    return has_rust() and matchoutput(
+        'hg config format.exp-dirstate-v2', b'(?i)1|yes|true|on|always'
+    )
+
+
 @check('sqlite', 'sqlite3 module and matching cli is available')
 def has_sqlite():
     try: