##// END OF EJS Templates
streamclone: partially encode filename over the wire, not for local read (issue1847)...
Greg Ward -
r9506:49b62395 default
parent child Browse files
Show More
@@ -48,8 +48,7 b' def stream_out(repo, untrusted=False):'
48 try:
48 try:
49 repo.ui.debug(_('scanning\n'))
49 repo.ui.debug(_('scanning\n'))
50 for name, ename, size in repo.store.walk():
50 for name, ename, size in repo.store.walk():
51 # for backwards compat, name was partially encoded
51 entries.append((name, size))
52 entries.append((store.encodedir(name), size))
53 total_bytes += size
52 total_bytes += size
54 finally:
53 finally:
55 lock.release()
54 lock.release()
@@ -62,6 +61,7 b' def stream_out(repo, untrusted=False):'
62 yield '%d %d\n' % (len(entries), total_bytes)
61 yield '%d %d\n' % (len(entries), total_bytes)
63 for name, size in entries:
62 for name, size in entries:
64 repo.ui.debug(_('sending %s (%d bytes)\n') % (name, size))
63 repo.ui.debug(_('sending %s (%d bytes)\n') % (name, size))
65 yield '%s\0%d\n' % (name, size)
64 # partially encode name over the wire for backwards compat
65 yield '%s\0%d\n' % (store.encodedir(name), size)
66 for chunk in util.filechunkiter(repo.sopener(name), limit=size):
66 for chunk in util.filechunkiter(repo.sopener(name), limit=size):
67 yield chunk
67 yield chunk
@@ -5,6 +5,11 b' cp "$TESTDIR"/printenv.py .'
5 hg init test
5 hg init test
6 cd test
6 cd test
7 echo foo>foo
7 echo foo>foo
8 mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg
9 echo foo>foo.d/foo
10 echo bar>foo.d/bAr.hg.d/BaR
11 echo bar>foo.d/baR.d.hg/bAR
12
8 hg commit -A -m 1
13 hg commit -A -m 1
9 hg --config server.uncompressed=True serve -p $HGPORT -d --pid-file=../hg1.pid
14 hg --config server.uncompressed=True serve -p $HGPORT -d --pid-file=../hg1.pid
10 hg serve -p $HGPORT1 -d --pid-file=../hg2.pid
15 hg serve -p $HGPORT1 -d --pid-file=../hg2.pid
@@ -1,4 +1,7 b''
1 adding foo
1 adding foo
2 adding foo.d/bAr.hg.d/BaR
3 adding foo.d/baR.d.hg/bAR
4 adding foo.d/foo
2 abort: cannot start server at ':20060':
5 abort: cannot start server at ':20060':
3 % clone via stream
6 % clone via stream
4 streaming all changes
7 streaming all changes
@@ -10,31 +13,31 b' checking changesets'
10 checking manifests
13 checking manifests
11 crosschecking files in changesets and manifests
14 crosschecking files in changesets and manifests
12 checking files
15 checking files
13 1 files, 1 changesets, 1 total revisions
16 4 files, 1 changesets, 4 total revisions
14 % try to clone via stream, should use pull instead
17 % try to clone via stream, should use pull instead
15 requesting all changes
18 requesting all changes
16 adding changesets
19 adding changesets
17 adding manifests
20 adding manifests
18 adding file changes
21 adding file changes
19 added 1 changesets with 1 changes to 1 files
22 added 1 changesets with 4 changes to 4 files
20 updating working directory
23 updating working directory
21 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
24 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
22 % clone via pull
25 % clone via pull
23 requesting all changes
26 requesting all changes
24 adding changesets
27 adding changesets
25 adding manifests
28 adding manifests
26 adding file changes
29 adding file changes
27 added 1 changesets with 1 changes to 1 files
30 added 1 changesets with 4 changes to 4 files
28 updating working directory
31 updating working directory
29 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
32 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
30 checking changesets
33 checking changesets
31 checking manifests
34 checking manifests
32 crosschecking files in changesets and manifests
35 crosschecking files in changesets and manifests
33 checking files
36 checking files
34 1 files, 1 changesets, 1 total revisions
37 4 files, 1 changesets, 4 total revisions
35 adding bar
38 adding bar
36 % pull
39 % pull
37 changegroup hook: HG_NODE=cfbd11a1fa315300a080c3de8fe36b0fc5820acf HG_SOURCE=pull HG_URL=http://localhost/
40 changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_URL=http://localhost/
38 pulling from http://localhost/
41 pulling from http://localhost/
39 searching for changes
42 searching for changes
40 adding changesets
43 adding changesets
General Comments 0
You need to be logged in to leave comments. Login now