# HG changeset patch # User Augie Fackler # Date 1305480384 18000 # Node ID 5fdff9b8e7420572624dae2941251f11cd9bd6d7 # Parent bcc79fa3fe09c43a011936f7d8b2c1075e0d94da Cope with new discovery code without crashing. diff -r bcc79fa3fe09c43a011936f7d8b2c1075e0d94da -r 5fdff9b8e7420572624dae2941251f11cd9bd6d7 hggit/__init__.py --- a/hggit/__init__.py Sun May 15 12:26:03 2011 -0500 +++ b/hggit/__init__.py Sun May 15 12:26:24 2011 -0500 @@ -125,6 +125,8 @@ kwname = 'heads' if hg.util.version() >= '1.7': kwname = 'remoteheads' + if getattr(discovery, 'findcommonoutgoing', None): + kwname = 'onlyheads' def findoutgoing(orig, local, remote, *args, **kwargs): kw = {} kw.update(kwargs) @@ -141,8 +143,14 @@ if kwname == 'heads': r = orig(local, remote, **kw) return [x[0] for x in r] + if kwname == 'onlyheads': + del kw['base'] return orig(local, remote, **kw) - extensions.wrapfunction(discovery, 'findoutgoing', findoutgoing) + if getattr(discovery, 'findoutgoing', None): + extensions.wrapfunction(discovery, 'findoutgoing', findoutgoing) + else: + extensions.wrapfunction(discovery, 'findcommonoutgoing', + findoutgoing) except ImportError: pass