# HG changeset patch # User Boris Feld # Date 1513860806 -3600 # Node ID 4aa6ed5983235a6c9f63117fe8430a5db899240e # Parent 6580cf7514186f0ac866a4b0e5b25dd6b313d15e 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. diff -r 6580cf751418 -r 4aa6ed598323 hgext/largefiles/lfcommands.py --- a/hgext/largefiles/lfcommands.py Fri Dec 15 09:30:16 2017 +0100 +++ b/hgext/largefiles/lfcommands.py Thu Dec 21 13:53:26 2017 +0100 @@ -593,3 +593,12 @@ (cached, missing) = cachelfiles(ui, repo, rev) numcached += len(cached) ui.status(_("%d largefiles cached\n") % numcached) + +@command('debuglfput', + [] + cmdutil.remoteopts, + _('FILE')) +def debuglfput(ui, repo, filepath, **kwargs): + hash = lfutil.hashfile(filepath) + storefactory.openstore(repo).put(filepath, hash) + ui.write('%s\n' % hash) + return 0