Skip to content

Commit

Permalink
bazaar: Use lightweight checkouts rather than a full branch clone
Browse files Browse the repository at this point in the history
Fixes pypa#5444
  • Loading branch information
jelmer committed Jul 15, 2022
1 parent e89e391 commit a88ec53
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions news/5444.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use the much faster 'bzr co --lightweight' to obtain a copy of a Bazaar tree.
6 changes: 4 additions & 2 deletions src/pip/_internal/vcs/bazaar.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,16 @@ def fetch_new(
flag = ""
else:
flag = f"-{'v'*verbosity}"
cmd_args = make_command("branch", flag, rev_options.to_args(), url, dest)
cmd_args = make_command(
"checkout", "--lightweight", flag, rev_options.to_args(), url, dest
)
self.run_command(cmd_args)

def switch(self, dest: str, url: HiddenText, rev_options: RevOptions) -> None:
self.run_command(make_command("switch", url), cwd=dest)

def update(self, dest: str, url: HiddenText, rev_options: RevOptions) -> None:
cmd_args = make_command("pull", "-q", rev_options.to_args())
cmd_args = make_command("update", "-q", rev_options.to_args())
self.run_command(cmd_args, cwd=dest)

@classmethod
Expand Down

0 comments on commit a88ec53

Please sign in to comment.