Mercurial > hg > hg-fastimport
diff hgext3rd/fastimport/__init__.py @ 95:3b398a887b95
Use a sqlite3 database to store the blob data if available
This is much more performant than using a filesystem when we are
dealing with a large number of blobs.
If sqlite3 is not available, then fallback to writing to the filesystem.
In both cases, the blob data is compressed before writing to save space.
A new option has also been added to specify a path for persistent blob data.
This is only really important for large continuous interations where the
source data has no concept of export marks and thus only gets bigger.
What we gain here is a reduction in the write load on the disk.
| author | Roy Marples <roy@marples.name> |
|---|---|
| date | Thu, 21 Jan 2021 23:59:21 +0000 |
| parents | dc1d11466aa6 |
| children | 7eb15a5c4cad |
line wrap: on
line diff
--- a/hgext3rd/fastimport/__init__.py Thu Jan 21 22:52:55 2021 +0000 +++ b/hgext3rd/fastimport/__init__.py Thu Jan 21 23:59:21 2021 +0000 @@ -32,7 +32,8 @@ @command(b'fastimport', [(b'', b'branchsort', None, _(b'try to sort changesets by branches')), (b'', b'datesort', None, _(b'try to sort changesets by date')), - (b'', b'sourcesort', None, _(b'preserve source changesets order'))], + (b'', b'sourcesort', None, _(b'preserve source changesets order')), + (b'', b'blobpath', b'', _(b'path for persistent blob data'))], _(b'hg fastimport SOURCE ...'), norepo=False) @@ -55,6 +56,8 @@ if not sources: sources = (b'-') + opts = pycompat.byteskwargs(opts) + # assume fastimport metadata (usernames, commit messages) are # encoded UTF-8 convcmd.orig_encoding = encoding.encoding @@ -62,9 +65,8 @@ # sink is the current repo, src is the list of fastimport streams destc = hg.mercurial_sink(ui, b'hg', repo.root) - srcc = fastimport_source(ui, b'fastimport', repo, sources) + srcc = fastimport_source(ui, b'fastimport', repo, sources, opts[b'blobpath']) - opts = pycompat.byteskwargs(opts) defaultsort = b'branchsort' # for efficiency and consistency sortmodes = (b'branchsort', b'datesort', b'sourcesort') sortmode = [m for m in sortmodes if opts.get(m)]
