diff hgext/remotefilelog/remotefilelog.py @ 48578:28f0092ec89f

exchange: add fast path for subrepo check on push Try to check if .hgsub and .hgsubstate exist at all before looking for them in every changeset to be pushed. The latter can be quite expensive for large repositories and the existance check is almost free. Differential Revision: https://phab.mercurial-scm.org/D11956
author Joerg Sonnenberger <joerg@bec.de>
date Mon, 03 Jan 2022 01:09:56 +0100
parents bf5dc156bb4c
children 6000f5b25c9b
line wrap: on
line diff
--- a/hgext/remotefilelog/remotefilelog.py	Wed Jan 05 11:34:54 2022 -0800
+++ b/hgext/remotefilelog/remotefilelog.py	Mon Jan 03 01:09:56 2022 +0100
@@ -244,11 +244,11 @@
     __bool__ = __nonzero__
 
     def __len__(self):
-        if self.filename == b'.hgtags':
-            # The length of .hgtags is used to fast path tag checking.
-            # remotefilelog doesn't support .hgtags since the entire .hgtags
-            # history is needed.  Use the excludepattern setting to make
-            # .hgtags a normal filelog.
+        if self.filename in (b'.hgtags', b'.hgsub', b'.hgsubstate'):
+            # Global tag and subrepository support require access to the
+            # file history for various performance sensitive operations.
+            # excludepattern should be used for repositories depending on
+            # those features to fallback to regular filelog.
             return 0
 
         raise RuntimeError(b"len not supported")