mercurial/wireproto.py
changeset 12296 d7fff529d85d
parent 12085 6f833fc3ccab
child 12337 6a6149487817
--- a/mercurial/wireproto.py	Wed Sep 15 10:44:10 2010 +0200
+++ b/mercurial/wireproto.py	Wed Sep 15 11:06:22 2010 +0200
@@ -172,7 +172,13 @@
 def capabilities(repo, proto):
     caps = 'lookup changegroupsubset branchmap pushkey'.split()
     if _allowstream(repo.ui):
-        caps.append('stream=%d' % repo.changelog.version)
+        requiredformats = repo.requirements & repo.supportedformats
+        # if our local revlogs are just revlogv1, add 'stream' cap
+        if not requiredformats - set(('revlogv1',)):
+            caps.append('stream')
+        # otherwise, add 'streamreqs' detailing our local revlog format
+        else:
+            caps.append('streamreqs=%s' % ','.join(requiredformats))
     caps.append('unbundle=%s' % ','.join(changegroupmod.bundlepriority))
     return ' '.join(caps)