diff hgsubversion/wrappers.py @ 1519:aec176db232c

svnrepo: update with the latest upstream change The Mercurial upstream had a massive change on wireproto interface recently. Update code to be compatible with both versions.
author Jun Wu <quark@fb.com>
date Mon, 21 Aug 2017 15:19:12 -0700
parents fbc22592f4fa
children 0212c3a84ccd
line wrap: on
line diff
--- a/hgsubversion/wrappers.py
+++ b/hgsubversion/wrappers.py
@@ -89,9 +89,12 @@ def getlocalpeer(ui, opts, source):
     return repo
 
 def getcaps(other):
-    return (getattr(other, 'caps', None) or
+    caps = (getattr(other, 'caps', None) or
             getattr(other, 'capabilities', None) or set())
-
+    # 'capabilities' might be an instance method
+    if hgutil.safehasattr(caps, '__call__'):
+        caps = caps()
+    return caps
 
 def incoming(orig, ui, repo, origsource='default', **opts):
     """show incoming revisions from Subversion