Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dfetch/commands/add.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def _finalize_add(
return

superproject.manifest.append_project_entry(project_entry)
superproject.manifest.update_dump()
superproject.manifest.dump()
logger.print_info_line(
project_entry.name,
f"Added '{project_entry.name}' to manifest '{superproject.manifest.path}'",
Expand Down
2 changes: 1 addition & 1 deletion dfetch/commands/freeze.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,5 @@ def __call__(self, args: argparse.Namespace) -> None:
manifest_updated = True

if manifest_updated:
superproject.manifest.update_dump()
superproject.manifest.dump()
logger.info(f"Updated manifest ({manifest_path}) in {os.getcwd()}")
22 changes: 11 additions & 11 deletions dfetch/commands/import_.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@
from collections.abc import Sequence
from itertools import combinations

import yaml

import dfetch.commands.command
from dfetch import DEFAULT_MANIFEST_NAME
from dfetch.log import get_logger
from dfetch.manifest.manifest import Manifest
from dfetch.manifest.manifest import ManifestBuilder
from dfetch.manifest.project import ProjectEntry
from dfetch.manifest.remote import Remote
from dfetch.project import determine_superproject_vcs
Expand Down Expand Up @@ -58,14 +56,16 @@ def __call__(self, _: argparse.Namespace) -> None:
project.set_remote(remote)
break

manifest_data = {
"manifest": {
"version": "0.0",
"remotes": [r.as_yaml() for r in remotes],
"projects": [p.as_yaml() for p in projects],
}
}
manifest = Manifest.from_yaml(yaml.dump(manifest_data, sort_keys=False))
single_remote = len(remotes) == 1
builder = ManifestBuilder()
for remote in remotes:
builder.add_remote(remote)
for p in projects:
d = p.as_yaml()
if single_remote:
d.pop("remote", None)
builder.add_project_dict(d)
manifest = builder.build()

manifest.dump(DEFAULT_MANIFEST_NAME)
logger.info(f"Created manifest ({DEFAULT_MANIFEST_NAME}) in {os.getcwd()}")
Expand Down
Loading
Loading