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
 
@@ -52,7 +52,7 @@ class MercurialInMemoryChangeset(BaseInM
 
            # 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,
 
@@ -62,7 +62,7 @@ class MercurialInMemoryChangeset(BaseInM
 
            # 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,
kallithea/lib/vcs/utils/hgcompat.py
Show inline comments
 
@@ -32,6 +32,15 @@ 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
setup.py
Show inline comments
 
@@ -57,7 +57,7 @@ requirements = [
 
    "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",
 
]
0 comments (0 inline, 0 general)