Details
Details
- Reviewers
pulkit - Group Reviewers
hg-reviewers - Commits
- rHG2d835c42ab41: bundle2: don't send "shared" requirement when cloning from a share
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
pulkit |
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/bundle2.py (1 line) | |||
M | tests/test-share.t (7 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
mitchell plamann | Feb 20 2019, 3:02 PM |
yield n | yield n | ||||
for n in sorted(closed): | for n in sorted(closed): | ||||
yield n | yield n | ||||
bundler.newpart('cache:rev-branch-cache', data=generate(), | bundler.newpart('cache:rev-branch-cache', data=generate(), | ||||
mandatory=False) | mandatory=False) | ||||
def _formatrequirementsspec(requirements): | def _formatrequirementsspec(requirements): | ||||
requirements = [req for req in requirements if req != "shared"] | |||||
return urlreq.quote(','.join(sorted(requirements))) | return urlreq.quote(','.join(sorted(requirements))) | ||||
def _formatrequirementsparams(requirements): | def _formatrequirementsparams(requirements): | ||||
requirements = _formatrequirementsspec(requirements) | requirements = _formatrequirementsspec(requirements) | ||||
params = "%s%s" % (urlreq.quote("requirements="), requirements) | params = "%s%s" % (urlreq.quote("requirements="), requirements) | ||||
return params | return params | ||||
def addpartbundlestream2(bundler, repo, **kwargs): | def addpartbundlestream2(bundler, repo, **kwargs): |
$ get-with-headers.py localhost:$HGPORT 'raw-file/' | $ get-with-headers.py localhost:$HGPORT 'raw-file/' | ||||
200 Script output follows | 200 Script output follows | ||||
-rw-r--r-- 4 a | -rw-r--r-- 4 a | ||||
-rw-r--r-- 2 b | -rw-r--r-- 2 b | ||||
Cloning a shared repo via bundle2 wrongly adds "shared" to the clone's requirements | Cloning a shared repo via bundle2 results in a non-shared clone | ||||
$ cd .. | $ cd .. | ||||
$ hg clone -q --stream --config ui.ssh="$PYTHON \"$TESTDIR/dummyssh\"" ssh://user@dummy/`pwd`/repo2 cloned-via-bundle2 | $ hg clone -q --stream --config ui.ssh="$PYTHON \"$TESTDIR/dummyssh\"" ssh://user@dummy/`pwd`/repo2 cloned-via-bundle2 | ||||
$ cat ./cloned-via-bundle2/.hg/requires | grep "shared" | $ cat ./cloned-via-bundle2/.hg/requires | grep "shared" | ||||
shared | [1] | ||||
$ hg id --cwd cloned-via-bundle2 -r tip | $ hg id --cwd cloned-via-bundle2 -r tip | ||||
abort: $ENOENT$: '$TESTTMP/cloned-via-bundle2/.hg/sharedpath' | c2e0ac586386 tip | ||||
[255] | |||||
$ cd repo2 | $ cd repo2 | ||||
test unshare command | test unshare command | ||||
$ hg unshare | $ hg unshare | ||||
$ test -d .hg/store | $ test -d .hg/store | ||||
$ test -f .hg/sharedpath | $ test -f .hg/sharedpath | ||||
[1] | [1] |