changeset 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 6580cf751418
children cf841f2b5a72
files hgext/largefiles/lfcommands.py
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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