diff hgext/lfs/__init__.py @ 39851:1f7b3b980af8

lfs: add repository feature denoting the use of LFS Whether LFS is enabled seems like a useful feature to expose. This will also facilitate some future work around LFS feature compatibility. Differential Revision: https://phab.mercurial-scm.org/D4710
author Gregory Szorc <gregory.szorc@gmail.com>
date Wed, 19 Sep 2018 13:48:59 -0700
parents b9162ea1b815
children bcf72d7b1524
line wrap: on
line diff
--- a/hgext/lfs/__init__.py	Wed Sep 19 14:36:57 2018 -0700
+++ b/hgext/lfs/__init__.py	Wed Sep 19 13:48:59 2018 -0700
@@ -143,6 +143,7 @@
     node,
     pycompat,
     registrar,
+    repository,
     revlog,
     scmutil,
     templateutil,
@@ -242,6 +243,7 @@
                 if any(ctx[f].islfs() for f in ctx.files()
                        if f in ctx and match(f)):
                     repo.requirements.add('lfs')
+                    repo.features.add(repository.REPO_FEATURE_LFS)
                     repo._writerequirements()
                     repo.prepushoutgoinghooks.add('lfs', wrapper.prepush)
                     break
@@ -306,6 +308,8 @@
 
     wrapfunction = extensions.wrapfunction
 
+    wrapfunction(localrepo, 'makefilestorage', wrapper.localrepomakefilestorage)
+
     wrapfunction(cmdutil, '_updatecatformatter', wrapper._updatecatformatter)
     wrapfunction(scmutil, 'wrapconvertsink', wrapper.convertsink)