Details
Details
- Reviewers
durin42 - Group Reviewers
hg-reviewers - Commits
- rHG7e4a856a4f05: pullbundle: fix handling of gzip bundlespecs
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
durin42 |
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/wireprotov1server.py (4 lines) | |||
M | tests/test-pull-bundle.t (6 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
Joerg Sonnenberger | Jul 12 2018, 9:29 AM |
res = exchange.filterclonebundleentries(repo, res) | res = exchange.filterclonebundleentries(repo, res) | ||||
if not res: | if not res: | ||||
return None | return None | ||||
cl = repo.changelog | cl = repo.changelog | ||||
heads_anc = cl.ancestors([cl.rev(rev) for rev in heads], inclusive=True) | heads_anc = cl.ancestors([cl.rev(rev) for rev in heads], inclusive=True) | ||||
common_anc = cl.ancestors([cl.rev(rev) for rev in common], inclusive=True) | common_anc = cl.ancestors([cl.rev(rev) for rev in common], inclusive=True) | ||||
compformats = clientcompressionsupport(proto) | compformats = clientcompressionsupport(proto) | ||||
for entry in res: | for entry in res: | ||||
if 'COMPRESSION' in entry and entry['COMPRESSION'] not in compformats: | comp = entry.get('COMPRESSION') | ||||
altcomp = util.compengines._bundlenames.get(comp) | |||||
if comp and comp not in compformats and altcomp not in compformats: | |||||
continue | continue | ||||
# No test yet for VERSION, since V2 is supported by any client | # No test yet for VERSION, since V2 is supported by any client | ||||
# that advertises partial pulls | # that advertises partial pulls | ||||
if 'heads' in entry: | if 'heads' in entry: | ||||
try: | try: | ||||
bundle_heads = decodehexstring(entry['heads']) | bundle_heads = decodehexstring(entry['heads']) | ||||
except TypeError: | except TypeError: | ||||
# Bad heads entry | # Bad heads entry |
> EOF | > EOF | ||||
$ hg bundle --base null -r 0 .hg/0.hg | $ hg bundle --base null -r 0 .hg/0.hg | ||||
1 changesets found | 1 changesets found | ||||
$ hg bundle --base 0 -r 1 .hg/1.hg | $ hg bundle --base 0 -r 1 .hg/1.hg | ||||
1 changesets found | 1 changesets found | ||||
$ hg bundle --base 1 -r 2 .hg/2.hg | $ hg bundle --base 1 -r 2 .hg/2.hg | ||||
1 changesets found | 1 changesets found | ||||
$ cat <<EOF > .hg/pullbundles.manifest | $ cat <<EOF > .hg/pullbundles.manifest | ||||
> 2.hg heads=effea6de0384e684f44435651cb7bd70b8735bd4 bases=bbd179dfa0a71671c253b3ae0aa1513b60d199fa | > 2.hg BUNDLESPEC=none-v2 heads=effea6de0384e684f44435651cb7bd70b8735bd4 bases=bbd179dfa0a71671c253b3ae0aa1513b60d199fa | ||||
> 1.hg heads=ed1b79f46b9a29f5a6efa59cf12fcfca43bead5a bases=bbd179dfa0a71671c253b3ae0aa1513b60d199fa | > 1.hg BUNDLESPEC=bzip2-v2 heads=ed1b79f46b9a29f5a6efa59cf12fcfca43bead5a bases=bbd179dfa0a71671c253b3ae0aa1513b60d199fa | ||||
> 0.hg heads=bbd179dfa0a71671c253b3ae0aa1513b60d199fa | > 0.hg BUNDLESPEC=gzip-v2 heads=bbd179dfa0a71671c253b3ae0aa1513b60d199fa | ||||
> EOF | > EOF | ||||
$ hg --config blackbox.track=debug --debug serve -p $HGPORT2 -d --pid-file=../repo.pid | $ hg --config blackbox.track=debug --debug serve -p $HGPORT2 -d --pid-file=../repo.pid | ||||
listening at http://*:$HGPORT2/ (bound to $LOCALIP:$HGPORT2) (glob) (?) | listening at http://*:$HGPORT2/ (bound to $LOCALIP:$HGPORT2) (glob) (?) | ||||
$ cat ../repo.pid >> $DAEMON_PIDS | $ cat ../repo.pid >> $DAEMON_PIDS | ||||
$ cd .. | $ cd .. | ||||
$ hg clone -r 0 http://localhost:$HGPORT2/ repo.pullbundle | $ hg clone -r 0 http://localhost:$HGPORT2/ repo.pullbundle | ||||
adding changesets | adding changesets | ||||
adding manifests | adding manifests |