diff tests/simplestorerepo.py @ 42730:92ac6b1697a7

flagutil: move REVIDX_KNOWN_FLAGS source of truth in flagutil (API) Since REVIDX_KNOWN_FLAGS is "not really a constant" (extension can update it) and python integer,... it needs to be the responsability of a single module and always accessed through the module. We update all the user and move the source of truth in flagutil.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 08 Aug 2019 01:28:34 +0200
parents 2177133724ab
children 268662aac075
line wrap: on
line diff
--- a/tests/simplestorerepo.py	Thu Aug 08 01:04:48 2019 +0200
+++ b/tests/simplestorerepo.py	Thu Aug 08 01:28:34 2019 +0200
@@ -42,6 +42,9 @@
     interfaceutil,
     storageutil,
 )
+from mercurial.revlogutils import (
+    flagutil,
+)
 
 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
@@ -262,9 +265,9 @@
         if flags == 0:
             return text, True
 
-        if flags & ~revlog.REVIDX_KNOWN_FLAGS:
+        if flags & ~flagutil.REVIDX_KNOWN_FLAGS:
             raise simplestoreerror(_("incompatible revision flag '%#x'") %
-                                   (flags & ~revlog.REVIDX_KNOWN_FLAGS))
+                                   (flags & ~flagutil.REVIDX_KNOWN_FLAGS))
 
         validatehash = True
         # Depending on the operation (read or write), the order might be