style: use import manifest_xml everywhere

Align with Google style guides and `import manifest_xml` as a module
rather than import symbols out of it.

Change-Id: Ib600a5ccaf53b178e27e6e9d56847751d266bfe4
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/654812
Tested-by: Mike Frysinger <vapier@google.com>
Commit-Queue: Mike Frysinger <vapier@google.com>
Reviewed-by: Brian Gan <brgan@google.com>
This commit is contained in:
Mike Frysinger authored and gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com committed 2026-11-09 17:34:52 -08:00
1 parent 95d7c8c0df
commit 4cef373d98
4 files changed
+14 -14

No files matched your search

+3 -3
View File
@@ -50,7 +50,7 @@ import event_log
import git_command
import git_config
from git_trace2_event_log import EventLog
from manifest_xml import RepoClient
import manifest_xml
import pager
import repo_trace
from subcmds import all_commands
@@ -389,10 +389,10 @@ class _Repo:
result = 0
color.SetDefaultColoring(gopts.color)
outer_client = RepoClient(self.repodir)
outer_client = manifest_xml.RepoClient(self.repodir)
repo_client = outer_client
if gopts.submanifest_path:
repo_client = RepoClient(
repo_client = manifest_xml.RepoClient(
self.repodir,
submanifest_path=gopts.submanifest_path,
outer_client=outer_client,
+3 -3
View File
@@ -14,7 +14,7 @@
import color
from command import PagedCommand
from manifest_xml import RepoClient
import manifest_xml
class _Coloring(color.Coloring):
@@ -238,12 +238,12 @@ synced and their revisions won't be found.
self.printRevision
) = self.printText
manifest1 = RepoClient(self.repodir)
manifest1 = manifest_xml.RepoClient(self.repodir)
manifest1.Override(args[0], load_local_manifests=False)
if len(args) == 1:
manifest2 = self.manifest
else:
manifest2 = RepoClient(self.repodir)
manifest2 = manifest_xml.RepoClient(self.repodir)
manifest2.Override(args[1], load_local_manifests=False)
diff = manifest1.projectsDiff(manifest2)
+7 -7
View File
@@ -64,7 +64,7 @@ import git_config
import git_refs
import git_superproject
from hooks import RepoHook
from manifest_xml import XmlManifest
import manifest_xml
import platform_utils
from progress import elapsed_str
from progress import jobs_str
@@ -887,7 +887,7 @@ later is required to fix a server side protocol bug.
)
def _GetSuperprojectRevision(
self, opt: optparse.Values, manifest: XmlManifest
self, opt: optparse.Values, manifest: manifest_xml.XmlManifest
) -> Optional[str]:
"""Returns the --superproject-revision to apply to manifest.
@@ -906,7 +906,7 @@ later is required to fix a server side protocol bug.
return None
def _ConfigureSuperproject(
self, opt: optparse.Values, manifest: XmlManifest
self, opt: optparse.Values, manifest: manifest_xml.XmlManifest
) -> bool:
"""Configure superproject with options.
@@ -2156,7 +2156,7 @@ later is required to fix a server side protocol bug.
self,
opt: optparse.Values,
smart_sync_manifest_path: str,
manifest: XmlManifest,
manifest: manifest_xml.XmlManifest,
best_effort: bool = False,
) -> str:
if not manifest.manifest_server:
@@ -2474,7 +2474,7 @@ later is required to fix a server side protocol bug.
def _SyncToSuperprojectRev(
self,
opt: optparse.Values,
manifest: XmlManifest,
manifest: manifest_xml.XmlManifest,
mp: Project,
manifest_name: Optional[str],
errors: List[Exception],
@@ -2520,7 +2520,7 @@ later is required to fix a server side protocol bug.
)
def _ResolveSmartSyncOption(
self, opt: optparse.Values, manifest: XmlManifest
self, opt: optparse.Values, manifest: manifest_xml.XmlManifest
) -> bool:
"""Resolve opt.smart_sync from CLI flags, config, and manifest.
@@ -2773,7 +2773,7 @@ later is required to fix a server side protocol bug.
self,
opt: optparse.Values,
args: List[str],
manifest: XmlManifest,
manifest: manifest_xml.XmlManifest,
all_projects: List[Project],
) -> None:
"""Fail when repo.reprojectcmd is used on a manifest nesting projects.
+1 -1
View File
@@ -181,7 +181,7 @@ def test_event_log_disabled_skips_add_and_git_hash() -> None:
project.GetCommitRevisionId.assert_not_called()
@mock.patch("main.RepoClient")
@mock.patch("manifest_xml.RepoClient")
def test_run_long_gates_event_log_on_flag(
mock_client_cls: mock.MagicMock, tmp_path: Path
) -> None: