Skip to content

Commit be3e8b5

Browse files
MichaelCuevasfacebook-github-bot
authored andcommitted
allow use of edenapi push for eden integration tests
Summary: # Context The new AugmentedManifest format used by Sapling and Mononoke will support looking up Trees/Blobs from CAS via (Blake3,size) pairs. We already provide a way for users to get (Blake3,size) pairs for blobs, but there is currently no easy way to get this information for trees. We want to add support to getAttributesFromFilesV2 for looking up the (Blake3,size) pairs for trees as well. To do this, we'll need to add a method for querying TreeMetadata (including size and Blake3 hashes) via the SaplingBackingStore. This initial implementation of TreeMetadata will only include the following features: 1) Ability to query TreeMetadata from the SaplingBackingStore via a getTreeMetadata endpoint 2) The ability to request TreeMetadata from the getAttributesFromFilesV2 thrift endpoint In the future, we will extend the implementation to support: 1) Automatically fetching TreeMetadata during BackingStore::getTree requests 2) Caching TreeMetadata in Eden's in-memory caches # This diff allow use of edenapi push for integration tests so that we can enable eagerepo usage in eden integration tests on Windows Reviewed By: muirdm Differential Revision: D59662770 fbshipit-source-id: 2c9e53cba9b6b09d28dfed870a63fc1619a6e16a
1 parent f2f985f commit be3e8b5

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

eden/scm/sapling/edenapi_upload.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def _uploadfilenodes(repo, fctxs):
7979
dpack, _hpack = repo.fileslog.getmutablelocalpacks()
8080
try:
8181
with repo.ui.timesection("http.edenapi.upload_files"):
82-
use_sha1 = util.istest() and "sha1-only" in repo.edenapi.capabilities()
82+
use_sha1 = "sha1-only" in repo.edenapi.capabilities()
8383
stream, _stats = repo.edenapi.uploadfiles(dpack, keys, use_sha1)
8484
items = list(stream)
8585
repo.ui.status(

eden/scm/sapling/push.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from enum import Enum
88
from typing import Dict, List, Optional
99

10-
from . import edenapi_upload, error, hg, mutation, phases, scmutil
10+
from . import edenapi_upload, error, hg, mutation, phases, scmutil, util
1111
from .bookmarks import readremotenames, saveremotenames
1212
from .i18n import _, _n, _x
1313
from .node import bin, hex, nullhex, short
@@ -42,10 +42,6 @@ def get_edenapi_for_dest(repo, _dest):
4242
# default push dest is the same as edenapi.url config.
4343
try:
4444
edenapi = repo.edenapi
45-
if edenapi.url().startswith("eager:"):
46-
# todo (zhaolong): implement push related EdenAPIs for eagerepo
47-
return None
48-
4945
return edenapi
5046
except Exception:
5147
return None

0 commit comments

Comments
 (0)