# HG changeset patch # User Mads Kiilerich # Date 2018-10-29 01:07:18 # Node ID c363f492c117c92d76e8d7cec56562e4a74cf9b0 # Parent 451b3f9d814ee4a7c4afb4fbda688d15a10668ed hg: refactor compat wrapping of repository diff --git a/kallithea/lib/vcs/backends/hg/repository.py b/kallithea/lib/vcs/backends/hg/repository.py --- a/kallithea/lib/vcs/backends/hg/repository.py +++ b/kallithea/lib/vcs/backends/hg/repository.py @@ -30,7 +30,7 @@ from kallithea.lib.vcs.utils.ordered_dic from kallithea.lib.vcs.utils.paths import abspath from kallithea.lib.vcs.utils.hgcompat import ( ui, nullid, match, patch, diffopts, clone, get_contact, - localrepository, RepoLookupError, Abort, RepoError, hex, scmutil, hg_url, + localrepo, RepoLookupError, Abort, RepoError, hex, scmutil, hg_url, httpbasicauthhandler, httpdigestauthhandler, peer, httppeer, sshpeer, tag ) @@ -364,7 +364,7 @@ class MercurialRepository(BaseRepository # Don't try to create if we've already cloned repo create = False - return localrepository(self.baseui, self.path, create=create) + return localrepo.localrepository(self.baseui, self.path, create=create) except (Abort, RepoError) as err: if create: msg = "Cannot create repository at %s. Original error was %s" \ diff --git a/kallithea/lib/vcs/utils/hgcompat.py b/kallithea/lib/vcs/utils/hgcompat.py --- a/kallithea/lib/vcs/utils/hgcompat.py +++ b/kallithea/lib/vcs/utils/hgcompat.py @@ -18,7 +18,6 @@ from mercurial.context import memctx, me from mercurial.error import RepoError, RepoLookupError, Abort from mercurial.hgweb import hgweb_mod from mercurial.hgweb.common import get_contact -from mercurial.localrepo import localrepository from mercurial.match import match from mercurial.mdiff import diffopts from mercurial.node import hex @@ -45,9 +44,9 @@ if inspect.getargspec(memfilectx.__init_ # workaround for 3.3 94ac64bcf6fe and not calling largefiles reposetup correctly -localrepository._lfstatuswriters = [lambda *msg, **opts: None] +localrepo.localrepository._lfstatuswriters = [lambda *msg, **opts: None] # 3.5 7699d3212994 added the invariant that repo.lfstatus must exist before hitting overridearchive -localrepository.lfstatus = False +localrepo.localrepository.lfstatus = False # Mercurial 4.2 moved tag from localrepo to the tags module def tag(repo, *args):