Skip to content

Commit

Permalink
fixup! Display source/target/destination info in verbose mode and fis…
Browse files Browse the repository at this point in the history
…hy parameters
  • Loading branch information
sebalix committed Sep 16, 2024
1 parent 6080003 commit 5694b98
Showing 1 changed file with 24 additions and 13 deletions.
37 changes: 24 additions & 13 deletions oca_port/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,22 +206,33 @@ def _prepare_parameters(self):
)
# Print a summary of source/target/destination
if self.verbose or fishy_parameters:
source_remote_url = self.repo.remotes[self.source.remote].url
self._print(
f"{bc.BOLD}Source{bc.END}: {self.source.ref}, "
f"remote {bc.BOLD}{self.source.remote} {source_remote_url}{bc.END}"
source_remote_url = (
self.repo.remotes[self.source.remote].url if self.source.remote else ""
)
target_remote_url = self.repo.remotes[self.target.remote].url
self._print(
f"{bc.BOLD}Target{bc.END}: {self.target.ref}, "
f"remote {bc.BOLD}{self.target.remote} {target_remote_url}{bc.END}"
msg = f"{bc.BOLD}Source{bc.END}: {self.source.ref}"
if source_remote_url:
msg += f", remote {bc.BOLD}{self.source.remote} {source_remote_url}{bc.END}"
self._print(msg)
target_remote_url = (
self.repo.remotes[self.target.remote].url if self.target.remote else ""
)
if not self.dry_run and self.destination.remote:
dest_remote_url = self.repo.remotes[self.destination.remote].url
self._print(
f"{bc.BOLD}Destination{bc.END}: {self.destination.ref}, "
f"remote {bc.BOLD}{self.destination.remote} {dest_remote_url}{bc.END}"
msg = f"{bc.BOLD}Target{bc.END}: {self.target.ref}"
if target_remote_url:
msg += f", remote {bc.BOLD}{self.target.remote} {target_remote_url}{bc.END}"
self._print(msg)
if not self.dry_run:
dest_remote_url = (
self.repo.remotes[self.destination.remote].url
if self.destination.remote
else ""
)
msg = f"{bc.BOLD}Destination{bc.END}: {self.destination.ref}"
if dest_remote_url:
msg += (
f", remote {bc.BOLD}{self.destination.remote} "
f"{dest_remote_url}{bc.END}"
)
self._print(msg)

def _prepare_branch(self, info):
try:
Expand Down

0 comments on commit 5694b98

Please sign in to comment.