-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bazaar: Export directly from the remote branch.
This significantly improves performance, since it allows the remote server to directly stream a tarball that just contains the requested revision rather than the full repository contents.
- Loading branch information
Showing
4 changed files
with
35 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,10 @@ language: python | |
cache: pip | ||
dist: xenial | ||
python: 3.6 | ||
addons: | ||
apt: | ||
packages: | ||
- bzr | ||
|
||
stages: | ||
- primary | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Avoid creating an unnecessary local clone of a Bazaar branch when exporting. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
""" | ||
Contains functional tests of the Bazaar class. | ||
""" | ||
|
||
import os | ||
|
||
from pip._internal.vcs.bazaar import Bazaar | ||
from tests.lib import _test_path_to_file_url, _vcs_add, create_file, need_bzr | ||
|
||
|
||
@need_bzr | ||
def test_export(script, tmpdir): | ||
"""Test that a Bazaar branch can be exported.""" | ||
branch_path = tmpdir / 'test-branch' | ||
branch_path.mkdir() | ||
|
||
create_file(branch_path / 'test_file', 'something') | ||
|
||
_vcs_add(script, str(branch_path), vcs='bazaar') | ||
|
||
bzr = Bazaar('bzr+' + _test_path_to_file_url(branch_path)) | ||
export_dir = str(tmpdir / 'export') | ||
bzr.export(export_dir) | ||
|
||
assert os.listdir(export_dir) == ['test_file'] |