[cig-commits] commit: Fix up shims to work with Mercurial 0.9.4.

Mercurial hg at geodynamics.org
Mon Nov 24 11:27:07 PST 2008


changeset:   56:8648e7ba97e8
user:        Simon Law <simon at akoha.org>
date:        Wed Aug 15 10:50:30 2007 -0400
files:       forest.py
description:
Fix up shims to work with Mercurial 0.9.4.


diff -r 146cb75364c0 -r 8648e7ba97e8 forest.py
--- a/forest.py	Sat Aug 18 10:17:17 2007 +0200
+++ b/forest.py	Wed Aug 15 10:50:30 2007 -0400
@@ -155,7 +155,11 @@ def _sshserver_do_hello(self):
 
     caps = ['unbundle', 'lookup', 'changegroupsubset', 'forests']
     if self.ui.configbool('server', 'uncompressed'):
-        caps.append('stream=%d' % self.repo.revlogversion)
+        if hasattr(self.repo, "revlogversion"):
+            version = self.repo.revlogversion
+        else:
+            version = self.repo.changelog.version
+        caps.append('stream=%d' % version)
     self.respond("capabilities: %s\n" % (' '.join(caps),))
 
 sshserver.sshserver.do_hello = _sshserver_do_hello
@@ -195,7 +199,11 @@ def _httpserver_do_capabilities(self, re
 def _httpserver_do_capabilities(self, req):
     caps = ['lookup', 'changegroupsubset', 'forests']
     if self.configbool('server', 'uncompressed'):
-        caps.append('stream=%d' % self.repo.revlogversion)
+        if hasattr(self.repo, "revlogversion"):
+            version = self.repo.revlogversion
+        else:
+            version = self.repo.changelog.version
+        caps.append('stream=%d' % version)
     # XXX: make configurable and/or share code with do_unbundle:
     unbundleversions = ['HG10GZ', 'HG10BZ', 'HG10UN']
     if unbundleversions:



More information about the CIG-COMMITS mailing list