Changeset - eda137096b3f
[Not reviewed]
default
0 2 0
Mads Kiilerich - 6 years ago 2019-05-27 00:17:32
mads@kiilerich.com
Grafted from: 63774e9057c0
hg: prepare for Mercurial 5.0 renaming memfilectx `copied` to `copysource` - add backwards compat wrapper
2 files changed with 10 insertions and 2 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/vcs/backends/hg/inmemory.py
Show inline comments
 
@@ -57,7 +57,7 @@ class MercurialInMemoryChangeset(BaseInM
 
                              if not node.is_binary else node.content),
 
                        islink=False,
 
                        isexec=node.is_executable,
 
                        copied=False)
 
                        copysource=False)
 

	
 
            # or changed
 
            for node in self.changed:
 
@@ -67,7 +67,7 @@ class MercurialInMemoryChangeset(BaseInM
 
                              if not node.is_binary else node.content),
 
                        islink=False,
 
                        isexec=node.is_executable,
 
                        copied=False)
 
                        copysource=False)
 

	
 
            raise RepositoryError("Given path haven't been marked as added,"
 
                                  "changed or removed (%s)" % path)
kallithea/lib/vcs/utils/hgcompat.py
Show inline comments
 
@@ -37,3 +37,11 @@ from mercurial.url import httpbasicauthh
 
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
 

	
 
# Mercurial 5.0 550a172a603b renamed memfilectx argument `copied` to `copysource`
 
import inspect
 
if inspect.getargspec(memfilectx.__init__).args[7] != 'copysource':
 
    assert inspect.getargspec(memfilectx.__init__).args[7] == 'copied', inspect.getargspec(memfilectx.__init__).args
 
    __org_memfilectx_ = memfilectx
 
    memfilectx = lambda repo, changectx, path, data, islink=False, isexec=False, copysource=None: \
 
        __org_memfilectx_(repo, changectx, path, data, islink=islink, isexec=isexec, copied=copysource)
0 comments (0 inline, 0 general)