diff mercurial/changegroup.py @ 37132:a54113fcc8c9

lfs: move the 'supportedoutgoingversions' handling to changegroup.py This handling already exists here for the narrow extension. We still need to either figure out how to enable changegroup v3 without the extension, or figure out how to let the server detect that the client doesn't have it loaded, and emit a user friendly error[1]. I can't tell if D1944 is the appropriate vehicle for the latter. [1] https://www.mercurial-scm.org/pipermail/mercurial-devel/2018-January/109550.html
author Matt Harbison <matt_harbison@yahoo.com>
date Mon, 26 Mar 2018 23:02:50 -0400
parents f0b6fbea00cf
children 5859800edfc5
line wrap: on
line diff
--- a/mercurial/changegroup.py	Sun Mar 04 09:58:57 2018 -0500
+++ b/mercurial/changegroup.py	Mon Mar 26 23:02:50 2018 -0400
@@ -36,6 +36,8 @@
 _CHANGEGROUPV2_DELTA_HEADER = "20s20s20s20s20s"
 _CHANGEGROUPV3_DELTA_HEADER = ">20s20s20s20s20sH"
 
+LFS_REQUIREMENT = 'lfs'
+
 # When narrowing is finalized and no longer subject to format changes,
 # we should move this to just "narrow" or similar.
 NARROW_REQUIREMENT = 'narrowhg-experimental'
@@ -912,6 +914,12 @@
         # support that for stripping and unbundling to work.
         versions.discard('01')
         versions.discard('02')
+    if LFS_REQUIREMENT in repo.requirements:
+        # Versions 01 and 02 don't support revlog flags, and we need to
+        # mark LFS entries with REVIDX_EXTSTORED.
+        versions.discard('01')
+        versions.discard('02')
+
     return versions
 
 def localversion(repo):