style: use import hooks everywhere

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

Change-Id: I85a071ee73f8904ac33eae437d7853785762ba71
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/655846
Reviewed-by: Brian Gan <brgan@google.com>
Commit-Queue: Mike Frysinger <vapier@google.com>
Tested-by: Mike Frysinger <vapier@google.com>
This commit is contained in:
Mike Frysinger authored and gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com committed 2026-11-11 09:40:37 -08:00
1 parent 9b774577cb
commit d519ee40a9
2 files changed
+6 -6

No files matched your search

+3 -3
View File
@@ -60,7 +60,7 @@ import git_command
import git_config
import git_refs
import git_superproject
from hooks import RepoHook
import hooks
import manifest_xml
import platform_utils
import progress
@@ -900,7 +900,7 @@ later is required to fix a server side protocol bug.
action="store_true",
help=optparse.SUPPRESS_HELP,
)
RepoHook.AddOptionGroup(p, "post-sync")
hooks.RepoHook.AddOptionGroup(p, "post-sync")
def _GetBranch(self, manifest_project):
"""Returns the branch name for getting the approved smartsync manifest.
@@ -2568,7 +2568,7 @@ later is required to fix a server side protocol bug.
def _RunPostSyncHook(self, opt, sync_duration_seconds=None):
"""Run post-sync hook if configured in manifest <repo-hooks>."""
hook = RepoHook.FromSubcmd(
hook = hooks.RepoHook.FromSubcmd(
hook_type="post-sync",
manifest=self.manifest,
opt=opt,
+3 -3
View File
@@ -24,7 +24,7 @@ import editor
import error
import git_refs
import git_superproject
from hooks import RepoHook
import hooks
from project import ReviewableBranch
import repo_logging
from subcmds.sync import LocalSyncState
@@ -381,7 +381,7 @@ Gerrit Code Review: https://www.gerritcodereview.com/
default=True,
help="disable verifying ssl certs (unsafe)",
)
RepoHook.AddOptionGroup(p, "pre-upload", allow_fix=True)
hooks.RepoHook.AddOptionGroup(p, "pre-upload", allow_fix=True)
def _SingleBranch(self, opt, branch, people):
project = branch.project
@@ -827,7 +827,7 @@ Gerrit Code Review: https://www.gerritcodereview.com/
for (project, available) in pending
if project.manifest.topdir == manifest.topdir
]
hook = RepoHook.FromSubcmd(
hook = hooks.RepoHook.FromSubcmd(
hook_type="pre-upload",
manifest=manifest,
opt=opt,