# HG changeset patch # User Pierre-Yves David # Date 2022-12-02 18:15:04 # Node ID 2a5feacc4085630bde395654c20cf4299f34fe17 # Parent 0d7ecac8b6f76d02efd4cabc483e25837cc0781a addbranchrevs: explicitly detect the need to fetch a peer Instead of having `peer()` method on all `peer()` for this usecase, we could simply handle it explicitly. diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -66,7 +66,11 @@ sharedbookmarks = b'bookmarks' def addbranchrevs(lrepo, other, branches, revs): - peer = other.peer() # a courtesy to callers using a localrepo for other + if util.safehasattr(other, 'peer'): + # a courtesy to callers using a localrepo for other + peer = other.peer() + else: + peer = other hashbranch, branches = branches if not hashbranch and not branches: x = revs or None