snapshot: bugfix: fix missing attribute during rebundle behavior

Summary:
There might be cases when `bundlerepo` doesn't have a `_snapshotbundlestore`.
Let's check that directly.

Reviewed By: mitrandir77

Differential Revision: D17793227

fbshipit-source-id: c2312fcf9c3d4de5af2c6e487e594d6338989fbf
This commit is contained in:
Aleksei Kulikov 2019-10-09 11:07:08 -07:00 committed by Facebook Github Bot
parent 880b3618e9
commit 711d2c0082

View File

@ -53,6 +53,7 @@ from edenscm.mercurial import (
revsetlang,
smartset,
templatekw,
util,
visibility,
)
from edenscm.mercurial.i18n import _
@ -83,7 +84,7 @@ def reposetup(ui, repo):
repo.svfs.options["snapshotthreshold"] = threshold
repo.svfs.snapshotstore = blobstore.local(repo)
if isinstance(repo, bundlerepo.bundlerepository):
if util.safehasattr(repo, "_snapshotbundlestore"):
repo.svfs.snapshotstore = blobstoremod.unionstore(
repo.svfs.snapshotstore, repo._snapshotbundlestore
)