Mercurial > hg
changeset 19176:aae14b3d0a9c
clone: move file stream walk to a separate function
Moves the file walk out of the stream method so that extensions can override it.
This allows an extension to decide what files should be streamed, and in
particular allows a stream without filelogs.
author | Durham Goode <durham@fb.com> |
---|---|
date | Wed, 01 May 2013 10:38:41 -0700 |
parents | 63f7bd2e1a46 |
children | 1e104aaa4c44 |
files | mercurial/wireproto.py |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/wireproto.py Tue May 07 14:20:34 2013 -0700 +++ b/mercurial/wireproto.py Wed May 01 10:38:41 2013 -0700 @@ -523,6 +523,10 @@ def _allowstream(ui): return ui.configbool('server', 'uncompressed', True, untrusted=True) +def _walkstreamfiles(repo): + # this is it's own function so extensions can override it + return repo.store.walk() + def stream(repo, proto): '''If the server supports streaming clone, it advertises the "stream" capability with a value representing the version and flags of the repo @@ -544,7 +548,7 @@ lock = repo.lock() try: repo.ui.debug('scanning\n') - for name, ename, size in repo.store.walk(): + for name, ename, size in _walkstreamfiles(repo): if size: entries.append((name, size)) total_bytes += size