Skip to content

Commit

Permalink
Add verbose flag to fetch_new() for bazaar, mercurial, SVN
Browse files Browse the repository at this point in the history
  • Loading branch information
SnoopJ committed Oct 10, 2021
1 parent f312997 commit 3042def
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
5 changes: 3 additions & 2 deletions src/pip/_internal/vcs/bazaar.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,16 @@ 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",
url,
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:
Expand Down
7 changes: 4 additions & 3 deletions src/pip/_internal/vcs/mercurial.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,18 @@ 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",
url,
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,
)

Expand Down
5 changes: 3 additions & 2 deletions src/pip/_internal/vcs/subversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,17 +277,18 @@ 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",
url,
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,
Expand Down

0 comments on commit 3042def

Please sign in to comment.