[PATCH 2 of 4] largefiles: add a 'debuglfput' command to put largefile into the store
Boris Feld
boris.feld at octobus.net
Tue Jan 2 05:40:22 EST 2018
# HG changeset patch
# User Boris Feld <boris.feld at octobus.net>
# Date 1513860806 -3600
# Thu Dec 21 13:53:26 2017 +0100
# Node ID 1caa0132d155d10ababcac873791b0283865e599
# Parent 2bd6c705949fae0b4477759479e9a0a905788ca4
# EXP-Topic largefile-url
# Available At https://bitbucket.org/octobus/mercurial-devel/
# hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 1caa0132d155
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 --git a/hgext/largefiles/lfcommands.py b/hgext/largefiles/lfcommands.py
--- a/hgext/largefiles/lfcommands.py
+++ b/hgext/largefiles/lfcommands.py
@@ -593,3 +593,12 @@ def lfpull(ui, repo, source="default", *
(cached, missing) = cachelfiles(ui, repo, rev)
numcached += len(cached)
ui.status(_("%d largefiles cached\n") % numcached)
+
+ at 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
More information about the Mercurial-devel
mailing list