# HG changeset patch # User Mads Kiilerich # Date 2018-10-29 01:20:21 # Node ID 9ca238e56396c4fbb091867da72f3f71089e7e79 # Parent 6834e12654156a1429d2cccfa22416da61c502eb hg: update diff between repositories to support Mercurial 4.8 by using the makeunionrepository factory diff --git a/kallithea/controllers/compare.py b/kallithea/controllers/compare.py --- a/kallithea/controllers/compare.py +++ b/kallithea/controllers/compare.py @@ -95,9 +95,14 @@ class CompareController(BaseRepoControll elif alias == 'hg': # case two independent repos if org_repo != other_repo: - hgrepo = unionrepo.unionrepository(other_repo.baseui, - other_repo.path, - org_repo.path) + try: + hgrepo = unionrepo.makeunionrepository(other_repo.baseui, + other_repo.path, + org_repo.path) + except AttributeError: # makeunionrepository was introduced in Mercurial 4.8 23f2299e9e53 + hgrepo = unionrepo.unionrepository(other_repo.baseui, + other_repo.path, + org_repo.path) # all ancestors of other_rev will be in other_repo and # rev numbers from hgrepo can be used in other_repo - org_rev ancestors cannot