diff --git a/mercurial/streamclone.py b/mercurial/streamclone.py --- a/mercurial/streamclone.py +++ b/mercurial/streamclone.py @@ -48,8 +48,7 @@ def stream_out(repo, untrusted=False): try: repo.ui.debug(_('scanning\n')) for name, ename, size in repo.store.walk(): - # for backwards compat, name was partially encoded - entries.append((store.encodedir(name), size)) + entries.append((name, size)) total_bytes += size finally: lock.release() @@ -62,6 +61,7 @@ def stream_out(repo, untrusted=False): yield '%d %d\n' % (len(entries), total_bytes) for name, size in entries: repo.ui.debug(_('sending %s (%d bytes)\n') % (name, size)) - yield '%s\0%d\n' % (name, size) + # partially encode name over the wire for backwards compat + yield '%s\0%d\n' % (store.encodedir(name), size) for chunk in util.filechunkiter(repo.sopener(name), limit=size): yield chunk diff --git a/tests/test-http b/tests/test-http --- a/tests/test-http +++ b/tests/test-http @@ -5,6 +5,11 @@ cp "$TESTDIR"/printenv.py . hg init test cd test echo foo>foo +mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg +echo foo>foo.d/foo +echo bar>foo.d/bAr.hg.d/BaR +echo bar>foo.d/baR.d.hg/bAR + hg commit -A -m 1 hg --config server.uncompressed=True serve -p $HGPORT -d --pid-file=../hg1.pid hg serve -p $HGPORT1 -d --pid-file=../hg2.pid diff --git a/tests/test-http.out b/tests/test-http.out --- a/tests/test-http.out +++ b/tests/test-http.out @@ -1,4 +1,7 @@ adding foo +adding foo.d/bAr.hg.d/BaR +adding foo.d/baR.d.hg/bAR +adding foo.d/foo abort: cannot start server at ':20060': % clone via stream streaming all changes @@ -10,31 +13,31 @@ checking changesets checking manifests crosschecking files in changesets and manifests checking files -1 files, 1 changesets, 1 total revisions +4 files, 1 changesets, 4 total revisions % try to clone via stream, should use pull instead requesting all changes adding changesets adding manifests adding file changes -added 1 changesets with 1 changes to 1 files +added 1 changesets with 4 changes to 4 files updating working directory -1 files updated, 0 files merged, 0 files removed, 0 files unresolved +4 files updated, 0 files merged, 0 files removed, 0 files unresolved % clone via pull requesting all changes adding changesets adding manifests adding file changes -added 1 changesets with 1 changes to 1 files +added 1 changesets with 4 changes to 4 files updating working directory -1 files updated, 0 files merged, 0 files removed, 0 files unresolved +4 files updated, 0 files merged, 0 files removed, 0 files unresolved checking changesets checking manifests crosschecking files in changesets and manifests checking files -1 files, 1 changesets, 1 total revisions +4 files, 1 changesets, 4 total revisions adding bar % pull -changegroup hook: HG_NODE=cfbd11a1fa315300a080c3de8fe36b0fc5820acf HG_SOURCE=pull HG_URL=http://localhost/ +changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_URL=http://localhost/ pulling from http://localhost/ searching for changes adding changesets