From 3042defc8c778d26487debe6cee6a49f64a7b2ce Mon Sep 17 00:00:00 2001 From: James Gerity Date: Sun, 10 Oct 2021 15:36:19 -0400 Subject: [PATCH] Add verbose flag to fetch_new() for bazaar, mercurial, SVN --- src/pip/_internal/vcs/bazaar.py | 5 +++-- src/pip/_internal/vcs/mercurial.py | 7 ++++--- src/pip/_internal/vcs/subversion.py | 5 +++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/pip/_internal/vcs/bazaar.py b/src/pip/_internal/vcs/bazaar.py index 82e75954a08..8fb93732081 100644 --- a/src/pip/_internal/vcs/bazaar.py +++ b/src/pip/_internal/vcs/bazaar.py @@ -33,7 +33,7 @@ class Bazaar(VersionControl): def get_base_rev_args(rev: str) -> List[str]: return ["-r", rev] - def fetch_new(self, dest: str, url: HiddenText, rev_options: RevOptions) -> None: + def fetch_new(self, dest: str, url: HiddenText, rev_options: RevOptions, verbose: bool) -> None: rev_display = rev_options.to_display() logger.info( "Checking out %s%s to %s", @@ -41,7 +41,8 @@ def fetch_new(self, dest: str, url: HiddenText, rev_options: RevOptions) -> None rev_display, display_path(dest), ) - cmd_args = make_command("branch", "-q", rev_options.to_args(), url, dest) + flags = ('--verbose',) if verbose else ('--quiet',) + cmd_args = make_command("branch", *flags, rev_options.to_args(), url, dest) self.run_command(cmd_args) def switch(self, dest: str, url: HiddenText, rev_options: RevOptions) -> None: diff --git a/src/pip/_internal/vcs/mercurial.py b/src/pip/_internal/vcs/mercurial.py index 410c79d903a..8ac13fe22f9 100644 --- a/src/pip/_internal/vcs/mercurial.py +++ b/src/pip/_internal/vcs/mercurial.py @@ -33,7 +33,7 @@ class Mercurial(VersionControl): def get_base_rev_args(rev: str) -> List[str]: return [rev] - def fetch_new(self, dest: str, url: HiddenText, rev_options: RevOptions) -> None: + def fetch_new(self, dest: str, url: HiddenText, rev_options: RevOptions, verbose: bool) -> None: rev_display = rev_options.to_display() logger.info( "Cloning hg %s%s to %s", @@ -41,9 +41,10 @@ def fetch_new(self, dest: str, url: HiddenText, rev_options: RevOptions) -> None rev_display, display_path(dest), ) - self.run_command(make_command("clone", "--noupdate", "-q", url, dest)) + flags = ('--verbose', ) if verbose else ('--quiet',) + self.run_command(make_command("clone", "--noupdate", *flags, url, dest)) self.run_command( - make_command("update", "-q", rev_options.to_args()), + make_command("update", *flags, rev_options.to_args()), cwd=dest, ) diff --git a/src/pip/_internal/vcs/subversion.py b/src/pip/_internal/vcs/subversion.py index b5b6fd5c09f..1e6b6fdf990 100644 --- a/src/pip/_internal/vcs/subversion.py +++ b/src/pip/_internal/vcs/subversion.py @@ -277,7 +277,7 @@ def get_remote_call_options(self) -> CommandArgs: return [] - def fetch_new(self, dest: str, url: HiddenText, rev_options: RevOptions) -> None: + def fetch_new(self, dest: str, url: HiddenText, rev_options: RevOptions, verbose: bool) -> None: rev_display = rev_options.to_display() logger.info( "Checking out %s%s to %s", @@ -285,9 +285,10 @@ def fetch_new(self, dest: str, url: HiddenText, rev_options: RevOptions) -> None rev_display, display_path(dest), ) + flags = () if verbose else ('--quiet') cmd_args = make_command( "checkout", - "-q", + *flags, self.get_remote_call_options(), rev_options.to_args(), url,