comparison hgext/largefiles/lfcommands.py @ 35563:4aa6ed598323

largefiles: add a 'debuglfput' command to put largefile into the store We add a new debug command able to add arbitrary new files into the largefile store. This will be useful for debugging, testing and other unholy usecase.
author Boris Feld <boris.feld@octobus.net>
date Thu, 21 Dec 2017 13:53:26 +0100
parents 8a0cac20a1ad
children b9da10f310f4
comparison
equal deleted inserted replaced
35562:6580cf751418 35563:4aa6ed598323
591 for rev in revs: 591 for rev in revs:
592 ui.note(_('pulling largefiles for revision %s\n') % rev) 592 ui.note(_('pulling largefiles for revision %s\n') % rev)
593 (cached, missing) = cachelfiles(ui, repo, rev) 593 (cached, missing) = cachelfiles(ui, repo, rev)
594 numcached += len(cached) 594 numcached += len(cached)
595 ui.status(_("%d largefiles cached\n") % numcached) 595 ui.status(_("%d largefiles cached\n") % numcached)
596
597 @command('debuglfput',
598 [] + cmdutil.remoteopts,
599 _('FILE'))
600 def debuglfput(ui, repo, filepath, **kwargs):
601 hash = lfutil.hashfile(filepath)
602 storefactory.openstore(repo).put(filepath, hash)
603 ui.write('%s\n' % hash)
604 return 0