diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2019-04-12 13:50:47 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-04-12 13:50:47 -0400 |
| commit | 1cc88214f605e8458cc45495e6a8f476ad6d1cbb (patch) | |
| tree | 87e0bcbc252e9231336efd93be965f7d66b249fe | |
| parent | 7db010201783ae4b795908161e2027565e70a12f (diff) | |
| parent | eaa19fd89c2e61f52c677c958041013422df133f (diff) | |
| download | python-setuptools-git-1cc88214f605e8458cc45495e6a8f476ad6d1cbb.tar.gz | |
Merge pull request #1741 from 2xB/issue-1740
FIX: git and hg revision checkout under Windows
| -rw-r--r-- | changelog.d/1741.change.rst | 1 | ||||
| -rw-r--r-- | setuptools/package_index.py | 4 | ||||
| -rw-r--r-- | setuptools/tests/test_packageindex.py | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/changelog.d/1741.change.rst b/changelog.d/1741.change.rst new file mode 100644 index 00000000..03b24780 --- /dev/null +++ b/changelog.d/1741.change.rst @@ -0,0 +1 @@ +In package_index, now honor "current directory" during a checkout of git and hg repositories under Windows diff --git a/setuptools/package_index.py b/setuptools/package_index.py index 705a47cf..6b06f2ca 100644 --- a/setuptools/package_index.py +++ b/setuptools/package_index.py @@ -897,7 +897,7 @@ class PackageIndex(Environment): if rev is not None: self.info("Checking out %s", rev) - os.system("(cd %s && git checkout --quiet %s)" % ( + os.system("git -C %s checkout --quiet %s" % ( filename, rev, )) @@ -913,7 +913,7 @@ class PackageIndex(Environment): if rev is not None: self.info("Updating to %s", rev) - os.system("(cd %s && hg up -C -r %s -q)" % ( + os.system("hg --cwd %s up -C -r %s -q" % ( filename, rev, )) diff --git a/setuptools/tests/test_packageindex.py b/setuptools/tests/test_packageindex.py index ab371884..60d968fd 100644 --- a/setuptools/tests/test_packageindex.py +++ b/setuptools/tests/test_packageindex.py @@ -249,7 +249,7 @@ class TestPackageIndex: first_call_args = os_system_mock.call_args_list[0][0] assert first_call_args == (expected,) - tmpl = '(cd {expected_dir} && git checkout --quiet master)' + tmpl = 'git -C {expected_dir} checkout --quiet master' expected = tmpl.format(**locals()) assert os_system_mock.call_args_list[1][0] == (expected,) assert result == expected_dir |
