##// END OF EJS Templates
store: use StoreEntry API instead of parsing filename in largefile...
marmoute -
r51381:b4a9c8f1 default
parent child Browse files
Show More
@@ -551,10 +551,9 b' def unixpath(path):'
551
551
552 def islfilesrepo(repo):
552 def islfilesrepo(repo):
553 '''Return true if the repo is a largefile repo.'''
553 '''Return true if the repo is a largefile repo.'''
554 if b'largefiles' in repo.requirements and any(
554 if b'largefiles' in repo.requirements:
555 shortnameslash in entry.unencoded_path
555 for entry in repo.store.datafiles():
556 for entry in repo.store.datafiles()
556 if entry.is_revlog and shortnameslash in entry.target_id:
557 ):
558 return True
557 return True
559
558
560 return any(openlfdirstate(repo.ui, repo, False))
559 return any(openlfdirstate(repo.ui, repo, False))
@@ -457,12 +457,16 b' def reposetup(ui, repo):'
457
457
458 def checkrequireslfiles(ui, repo, **kwargs):
458 def checkrequireslfiles(ui, repo, **kwargs):
459 with repo.lock():
459 with repo.lock():
460 if b'largefiles' not in repo.requirements and any(
460 if b'largefiles' in repo.requirements:
461 lfutil.shortname + b'/' in entry.unencoded_path
461 return
462 for entry in repo.store.datafiles()
462 marker = lfutil.shortnameslash
463 ):
463 for entry in repo.store.datafiles():
464 # XXX note that this match is not rooted and can wrongly match
465 # directory ending with ".hglf"
466 if entry.is_revlog and marker in entry.target_id:
464 repo.requirements.add(b'largefiles')
467 repo.requirements.add(b'largefiles')
465 scmutil.writereporequirements(repo)
468 scmutil.writereporequirements(repo)
469 break
466
470
467 ui.setconfig(
471 ui.setconfig(
468 b'hooks', b'changegroup.lfiles', checkrequireslfiles, b'largefiles'
472 b'hooks', b'changegroup.lfiles', checkrequireslfiles, b'largefiles'
General Comments 0
You need to be logged in to leave comments. Login now