Skip to content

Commit

Permalink
Tear down the load_and_update facade (#28922)
Browse files Browse the repository at this point in the history
Part of #28776.
  • Loading branch information
foolip authored May 10, 2021
1 parent 208e86d commit 3bdf00e
Showing 1 changed file with 4 additions and 41 deletions.
45 changes: 4 additions & 41 deletions tools/manifest/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from atomicwrites import atomic_write
from copy import deepcopy
from multiprocessing import Pool, cpu_count
from six import ensure_text

from . import jsonlib
from . import vcs
Expand Down Expand Up @@ -380,13 +379,13 @@ def _load(logger, # type: Logger
return rv


def load_and_update(tests_root, # type: Union[Text, bytes]
manifest_path, # type: Union[Text, bytes]
def load_and_update(tests_root, # type: Text
manifest_path, # type: Text
url_base, # type: Text
update=True, # type: bool
rebuild=False, # type: bool
metadata_path=None, # type: Optional[Union[Text, bytes]]
cache_root=None, # type: Optional[Union[Text, bytes]]
metadata_path=None, # type: Optional[Text]
cache_root=None, # type: Optional[Text]
working_copy=True, # type: bool
types=None, # type: Optional[Container[Text]]
write_manifest=True, # type: bool
Expand All @@ -395,42 +394,6 @@ def load_and_update(tests_root, # type: Union[Text, bytes]
):
# type: (...) -> Manifest

# This function is now a facade for the purposes of type conversion, so that
# the external API can accept paths as text or (utf8) bytes, but internal
# functions always use Text.

metadata_path_text = ensure_text(metadata_path) if metadata_path is not None else None
cache_root_text = ensure_text(cache_root) if cache_root is not None else None

return _load_and_update(ensure_text(tests_root),
ensure_text(manifest_path),
url_base,
update=update,
rebuild=rebuild,
metadata_path=metadata_path_text,
cache_root=cache_root_text,
working_copy=working_copy,
types=types,
write_manifest=write_manifest,
allow_cached=allow_cached,
parallel=parallel)


def _load_and_update(tests_root, # type: Text
manifest_path, # type: Text
url_base, # type: Text
update=True, # type: bool
rebuild=False, # type: bool
metadata_path=None, # type: Optional[Text]
cache_root=None, # type: Optional[Text]
working_copy=True, # type: bool
types=None, # type: Optional[Container[Text]]
write_manifest=True, # type: bool
allow_cached=True, # type: bool
parallel=True # type: bool
):
# type: (...) -> Manifest

logger = get_logger()

manifest = None
Expand Down

0 comments on commit 3bdf00e

Please sign in to comment.