Changeset - 0bf6ccd6f67c
[Not reviewed]
default
0 3 0
Mads Kiilerich - 8 years ago 2018-04-02 14:22:11
mads@kiilerich.com
setup: support Mercurial 4.5.x

This requires passing an extra parameter to memctx __init__ after
https://www.mercurial-scm.org/repo/hg/rev/8a0cac20a1ad .
3 files changed with 12 insertions and 3 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/vcs/backends/hg/inmemory.py
Show inline comments
 
@@ -43,35 +43,35 @@ class MercurialInMemoryChangeset(BaseInM
 
            """
 
            Marks given path as added/changed/removed in a given _repo. This is
 
            for internal mercurial commit function.
 
            """
 

	
 
            # check if this path is removed
 
            if path in (node.path for node in self.removed):
 
                return None
 

	
 
            # check if this path is added
 
            for node in self.added:
 
                if node.path == path:
 
                    return memfilectx(_repo, path=node.path,
 
                    return memfilectx(_repo, memctx, path=node.path,
 
                        data=(node.content.encode('utf8')
 
                              if not node.is_binary else node.content),
 
                        islink=False,
 
                        isexec=node.is_executable,
 
                        copied=False)
 

	
 
            # or changed
 
            for node in self.changed:
 
                if node.path == path:
 
                    return memfilectx(_repo, path=node.path,
 
                    return memfilectx(_repo, memctx, path=node.path,
 
                        data=(node.content.encode('utf8')
 
                              if not node.is_binary else node.content),
 
                        islink=False,
 
                        isexec=node.is_executable,
 
                        copied=False)
 

	
 
            raise RepositoryError("Given path haven't been marked as added,"
 
                                  "changed or removed (%s)" % path)
 

	
 
        parents = [None, None]
 
        for i, parent in enumerate(self.parents):
 
            if parent is not None:
kallithea/lib/vcs/utils/hgcompat.py
Show inline comments
 
@@ -23,24 +23,33 @@ from mercurial.match import match
 
from mercurial.mdiff import diffopts
 
from mercurial.node import hex
 
from mercurial.encoding import tolocal
 
from mercurial.discovery import findcommonoutgoing
 
from mercurial.hg import peer
 
from mercurial.httppeer import httppeer
 
from mercurial.sshpeer import sshpeer
 
from mercurial.util import url as hg_url
 
from mercurial.scmutil import revrange
 
from mercurial.node import nullrev
 
from mercurial.url import httpbasicauthhandler, httpdigestauthhandler
 

	
 

	
 
# Mercurial 4.5 8a0cac20a1ad introduced an extra memctx changectx argument
 
# - introduce an optional wrapper factory that doesn't pass it on
 
import inspect
 
if inspect.getargspec(memfilectx.__init__).args[2] != 'changectx':
 
    __org_memfilectx = memfilectx
 
    memfilectx = lambda repo, changectx, *args, **kwargs: __org_memfilectx(repo, *args, **kwargs)
 

	
 

	
 
# workaround for 3.3 94ac64bcf6fe and not calling largefiles reposetup correctly
 
localrepository._lfstatuswriters = [lambda *msg, **opts: None]
 
# 3.5 7699d3212994 added the invariant that repo.lfstatus must exist before hitting overridearchive
 
localrepository.lfstatus = False
 

	
 
# Mercurial 4.2 moved tag from localrepo to the tags module
 
def tag(repo, *args):
 
    try:
 
        tag_f  = tagsmod.tag
 
    except AttributeError:
 
        return repo.tag(*args)
 
    tag_f(repo, *args)
setup.py
Show inline comments
 
@@ -48,25 +48,25 @@ requirements = [
 
    "SQLAlchemy>=1.1,<1.2",
 
    "Mako>=0.9.0,<=1.0.0",
 
    "pygments>=1.5",
 
    "whoosh>=2.5.0,<=2.5.7",
 
    "celery>=3.1,<3.2",
 
    "babel>=0.9.6,<2.4",
 
    "python-dateutil>=1.5.0,<2.0.0",
 
    "markdown==2.2.1",
 
    "docutils>=0.8.1",
 
    "URLObject==2.3.4",
 
    "Routes==1.13",
 
    "dulwich>=0.14.1",
 
    "mercurial>=4.0,<4.5",
 
    "mercurial>=4.0,<4.6",
 
    "decorator >= 3.3.2",
 
    "Paste >= 2.0.3, < 3.0",
 
]
 

	
 
if sys.version_info < (2, 7):
 
    requirements.append("importlib==1.0.1")
 
    requirements.append("argparse")
 

	
 
if not is_windows:
 
    requirements.append("bcrypt>=3.1.0")
 

	
 
dependency_links = [
0 comments (0 inline, 0 general)