Mercurial > hg
comparison hgext/lfs/__init__.py @ 45784:74271829ddc0
clonebundles: move a bundle of clone bundle related code to a new module
In the process on general clone bundle automatically, we need to make some
function available more widely. This is a good opportunity to extract a
significant amount of code from `mercurial.exchange` into a new
`mercurial.bundlecaches`. This make `mercurial.exchange` move under the 3K line
range (hooray…).
The module is called `bundlecaches` because I expect it to be eventually useful
for more than just clone bundle (like pull bunbles).
Differential Revision: https://phab.mercurial-scm.org/D9208
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 15 Oct 2020 15:57:36 +0200 |
parents | a03c177a4679 |
children | 89a2afe31e82 |
comparison
equal
deleted
inserted
replaced
45783:88a47cbf063c | 45784:74271829ddc0 |
---|---|
125 import sys | 125 import sys |
126 | 126 |
127 from mercurial.i18n import _ | 127 from mercurial.i18n import _ |
128 | 128 |
129 from mercurial import ( | 129 from mercurial import ( |
130 bundlecaches, | |
130 config, | 131 config, |
131 context, | 132 context, |
132 error, | 133 error, |
133 exchange, | |
134 extensions, | 134 extensions, |
135 exthelper, | 135 exthelper, |
136 filelog, | 136 filelog, |
137 filesetlang, | 137 filesetlang, |
138 localrepo, | 138 localrepo, |
349 scmutil.fileprefetchhooks.add(b'lfs', wrapper._prefetchfiles) | 349 scmutil.fileprefetchhooks.add(b'lfs', wrapper._prefetchfiles) |
350 | 350 |
351 # Make bundle choose changegroup3 instead of changegroup2. This affects | 351 # Make bundle choose changegroup3 instead of changegroup2. This affects |
352 # "hg bundle" command. Note: it does not cover all bundle formats like | 352 # "hg bundle" command. Note: it does not cover all bundle formats like |
353 # "packed1". Using "packed1" with lfs will likely cause trouble. | 353 # "packed1". Using "packed1" with lfs will likely cause trouble. |
354 exchange._bundlespeccontentopts[b"v2"][b"cg.version"] = b"03" | 354 bundlecaches._bundlespeccontentopts[b"v2"][b"cg.version"] = b"03" |
355 | 355 |
356 | 356 |
357 @eh.filesetpredicate(b'lfs()') | 357 @eh.filesetpredicate(b'lfs()') |
358 def lfsfileset(mctx, x): | 358 def lfsfileset(mctx, x): |
359 """File that uses LFS storage.""" | 359 """File that uses LFS storage.""" |