mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
output: return both 2.x and 3.x remote odbs in get_used_objects
This commit is contained in:
committed by
Peter Rowlands (변기호)
parent
f801eb4380
commit
5139da5f8e
+11
-6
@@ -1160,10 +1160,11 @@ class Output:
|
||||
return obj.filter(prefix)
|
||||
return obj
|
||||
|
||||
def get_used_objs( # noqa: C901
|
||||
def get_used_objs( # noqa: C901, PLR0911
|
||||
self, **kwargs
|
||||
) -> Dict[Optional["HashFileDB"], Set["HashInfo"]]:
|
||||
"""Return filtered set of used object IDs for this out."""
|
||||
from dvc.cachemgr import LEGACY_HASH_NAMES
|
||||
|
||||
if not self.use_cache:
|
||||
return {}
|
||||
@@ -1202,13 +1203,17 @@ class Output:
|
||||
return {}
|
||||
|
||||
if self.remote:
|
||||
remote = self.repo.cloud.get_remote_odb(
|
||||
remote_odb = self.repo.cloud.get_remote_odb(
|
||||
name=self.remote, hash_name=self.hash_name
|
||||
)
|
||||
else:
|
||||
remote = None
|
||||
|
||||
return {remote: self._named_obj_ids(obj)}
|
||||
other_odb = self.repo.cloud.get_remote_odb(
|
||||
name=self.remote,
|
||||
hash_name=(
|
||||
"md5" if self.hash_name in LEGACY_HASH_NAMES else "md5-dos2unix"
|
||||
),
|
||||
)
|
||||
return {remote_odb: self._named_obj_ids(obj), other_odb: set()}
|
||||
return {None: self._named_obj_ids(obj)}
|
||||
|
||||
def _named_obj_ids(self, obj):
|
||||
name = str(self)
|
||||
|
||||
Reference in New Issue
Block a user