remotefilelog: run python repack even if the pack directory doesn't exist

Summary:
When rust repack is default, and the packs directory doesn't exist, we wouldn't
try to run the loosefile repack, even if we had some. Let's move the packs
directory check a bit later to allow the loosefile repack to run.

Reviewed By: quark-zju

Differential Revision: D16774857

fbshipit-source-id: 1d1b67ae93c1b3aa2d07d5d15325e9be16a01196
This commit is contained in:
Xavier Deguillard 2019-08-12 20:04:37 -07:00 committed by Facebook Github Bot
parent d257546639
commit 97a6bc8e6a

View File

@ -85,9 +85,6 @@ def _userustrepack(repo):
def _runrustrepack(repo, options, packpath, incremental, pythonrepack):
if not os.path.isdir(packpath):
return
# In the case of a loose-only repack, fallback to Python, as Rust doesn't support them.
if options.get(constants.OPTION_LOOSEONLY):
return pythonrepack(repo, options, packpath, incremental)
@ -98,6 +95,9 @@ def _runrustrepack(repo, options, packpath, incremental, pythonrepack):
newoptions[constants.OPTION_LOOSEONLY] = True
pythonrepack(repo, newoptions, packpath, incremental)
if not os.path.isdir(packpath):
return
failed = False
if incremental: