##// END OF EJS Templates
lfs: add repository feature denoting the use of LFS...
Gregory Szorc -
r39887:1f7b3b98 default
parent child Browse files
Show More
@@ -143,6 +143,7 b' from mercurial import ('
143 node,
143 node,
144 pycompat,
144 pycompat,
145 registrar,
145 registrar,
146 repository,
146 revlog,
147 revlog,
147 scmutil,
148 scmutil,
148 templateutil,
149 templateutil,
@@ -242,6 +243,7 b' def reposetup(ui, repo):'
242 if any(ctx[f].islfs() for f in ctx.files()
243 if any(ctx[f].islfs() for f in ctx.files()
243 if f in ctx and match(f)):
244 if f in ctx and match(f)):
244 repo.requirements.add('lfs')
245 repo.requirements.add('lfs')
246 repo.features.add(repository.REPO_FEATURE_LFS)
245 repo._writerequirements()
247 repo._writerequirements()
246 repo.prepushoutgoinghooks.add('lfs', wrapper.prepush)
248 repo.prepushoutgoinghooks.add('lfs', wrapper.prepush)
247 break
249 break
@@ -306,6 +308,8 b' def extsetup(ui):'
306
308
307 wrapfunction = extensions.wrapfunction
309 wrapfunction = extensions.wrapfunction
308
310
311 wrapfunction(localrepo, 'makefilestorage', wrapper.localrepomakefilestorage)
312
309 wrapfunction(cmdutil, '_updatecatformatter', wrapper._updatecatformatter)
313 wrapfunction(cmdutil, '_updatecatformatter', wrapper._updatecatformatter)
310 wrapfunction(scmutil, 'wrapconvertsink', wrapper.convertsink)
314 wrapfunction(scmutil, 'wrapconvertsink', wrapper.convertsink)
311
315
@@ -14,6 +14,7 b' from mercurial.node import bin, hex, nul'
14
14
15 from mercurial import (
15 from mercurial import (
16 error,
16 error,
17 repository,
17 revlog,
18 revlog,
18 util,
19 util,
19 )
20 )
@@ -29,6 +30,12 b' from . import ('
29 pointer,
30 pointer,
30 )
31 )
31
32
33 def localrepomakefilestorage(orig, requirements, features, **kwargs):
34 if b'lfs' in requirements:
35 features.add(repository.REPO_FEATURE_LFS)
36
37 return orig(requirements=requirements, features=features, **kwargs)
38
32 def allsupportedversions(orig, ui):
39 def allsupportedversions(orig, ui):
33 versions = orig(ui)
40 versions = orig(ui)
34 versions.add('03')
41 versions.add('03')
@@ -25,6 +25,8 b" NARROW_REQUIREMENT = 'narrowhg-experimen"
25 REPO_FEATURE_REVLOG_FILE_STORAGE = b'revlogfilestorage'
25 REPO_FEATURE_REVLOG_FILE_STORAGE = b'revlogfilestorage'
26 # The storage part of the repository is shared from an external source.
26 # The storage part of the repository is shared from an external source.
27 REPO_FEATURE_SHARED_STORAGE = b'sharedstore'
27 REPO_FEATURE_SHARED_STORAGE = b'sharedstore'
28 # LFS supported for backing file storage.
29 REPO_FEATURE_LFS = b'lfs'
28
30
29 class ipeerconnection(interfaceutil.Interface):
31 class ipeerconnection(interfaceutil.Interface):
30 """Represents a "connection" to a repository.
32 """Represents a "connection" to a repository.
General Comments 0
You need to be logged in to leave comments. Login now