diff hgext/largefiles/lfutil.py @ 50522:b4a9c8f18928

store: use StoreEntry API instead of parsing filename in largefile This is more explicit and more robust.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 15 May 2023 09:01:02 +0200
parents 521fec115dad
children 862e3a13da44
line wrap: on
line diff
--- a/hgext/largefiles/lfutil.py	Mon May 15 09:00:46 2023 +0200
+++ b/hgext/largefiles/lfutil.py	Mon May 15 09:01:02 2023 +0200
@@ -551,11 +551,10 @@
 
 def islfilesrepo(repo):
     '''Return true if the repo is a largefile repo.'''
-    if b'largefiles' in repo.requirements and any(
-        shortnameslash in entry.unencoded_path
-        for entry in repo.store.datafiles()
-    ):
-        return True
+    if b'largefiles' in repo.requirements:
+        for entry in repo.store.datafiles():
+            if entry.is_revlog and shortnameslash in entry.target_id:
+                return True
 
     return any(openlfdirstate(repo.ui, repo, False))