##// END OF EJS Templates
cleanup: get rid of most "import *"...
cleanup: get rid of most "import *" Apply script generated with the following hack: ( hg loc '*.py'|xargs pyflakes-2 | sed -rn "s/([^:]*):.*'(.*)' may be undefined, or defined from star imports.*/sed -ri 's,\\\\<\2\\\\>([^=]|$),XXXX.\2\\\\1,g' \1/gp" | sort -u hg loc '*.py'|xargs pyflakes-2 | sed -rn "s/([^:]*):.* undefined name '(.*)'$/sed -ri 's,\\\\<\2\\\\>([^=]|$),XXXX.\2\\\\1,g' \1/gp" | sort -u hg loc '*.py'|xargs pyflakes-2 | sed -rn "s/([^:]*):.*'(from .*)\.([^.]*) import \*' used.*/sed -ri 's,\\\\<XXXX\\\\.,\3.,g' \1/gp" | sort -u hg loc '*.py'|xargs pyflakes-2 | sed -rn "s/([^:]*):.*'(from .*)\.([^.]*) import \*' used.*/sed -ri 's,\2\\\\.\3 .*,\2 import \3,g' \1/gp" | sort -u ) | grep -v kallithea/bin/kallithea_cli_ishell.py > fix2.sh

File last commit:

r7921:5f3101d5 default
r7966:e527cc2c default
Show More
hgcompat.py
29 lines | 1.2 KiB | text/x-python | PythonLexer
"""
Mercurial libs compatibility
"""
import mercurial
from mercurial import archival, config, demandimport, discovery, httppeer, localrepo
from mercurial import merge as hg_merge
from mercurial import obsutil, patch, scmutil, sshpeer, ui, unionrepo
from mercurial.commands import clone, nullid, pull
from mercurial.context import memctx, memfilectx
from mercurial.discovery import findcommonoutgoing
from mercurial.error import Abort, RepoError, RepoLookupError
from mercurial.hg import peer
from mercurial.hgweb import hgweb_mod
from mercurial.hgweb.common import get_contact
from mercurial.match import exact as match_exact
from mercurial.match import match
from mercurial.mdiff import diffopts
from mercurial.node import hex, nullrev
from mercurial.scmutil import revrange
from mercurial.tags import tag
from mercurial.url import httpbasicauthhandler, httpdigestauthhandler
from mercurial.util import url as hg_url
# workaround for 3.3 94ac64bcf6fe and not calling largefiles reposetup correctly, and test_archival failing
localrepo.localrepository._lfstatuswriters = [lambda *msg, **opts: None]
# 3.5 7699d3212994 added the invariant that repo.lfstatus must exist before hitting overridearchive
localrepo.localrepository.lfstatus = False