changeset 7233:0e83a1bf6e49

setup: drop support for Mercurial < 4.0 There is little point in supporting Mercurial versions more than 2 years old. Also, the old memfilectx hack gets in the way for a clean workaround for a new API change. Some further cleanups might be possible when we can assume Mercurial >= 4.0 .
author Mads Kiilerich <mads@kiilerich.com>
date Mon, 02 Apr 2018 14:14:55 +0200
parents dbf8620c278b
children 0bf6ccd6f67c
files kallithea/lib/vcs/backends/hg/inmemory.py kallithea/lib/vcs/utils/hgcompat.py setup.py
diffstat 3 files changed, 2 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/lib/vcs/backends/hg/inmemory.py	Sun Apr 08 17:03:08 2018 +0200
+++ b/kallithea/lib/vcs/backends/hg/inmemory.py	Mon Apr 02 14:14:55 2018 +0200
@@ -47,12 +47,7 @@
 
             # check if this path is removed
             if path in (node.path for node in self.removed):
-                if getattr(memctx, '_returnnoneformissingfiles', False):
-                    return None
-                else:
-                    # (hg < 3.2) Raising exception is the way to mark node for
-                    # removal
-                    raise IOError(errno.ENOENT, '%s is deleted' % path)
+                return None
 
             # check if this path is added
             for node in self.added:
--- a/kallithea/lib/vcs/utils/hgcompat.py	Sun Apr 08 17:03:08 2018 +0200
+++ b/kallithea/lib/vcs/utils/hgcompat.py	Mon Apr 02 14:14:55 2018 +0200
@@ -30,20 +30,8 @@
 from mercurial.util import url as hg_url
 from mercurial.scmutil import revrange
 from mercurial.node import nullrev
-
-# those authhandlers are patched for python 2.6.5 bug an
-# infinite looping when given invalid resources
 from mercurial.url import httpbasicauthhandler, httpdigestauthhandler
 
-import inspect
-# Mercurial 3.1 503bb3af70fe
-if inspect.getargspec(memfilectx.__init__).args[1] != 'repo':
-    _org__init__ = memfilectx.__init__
-
-    def _memfilectx__init__(self, repo, *a, **b):
-        return _org__init__(self, *a, **b)
-    memfilectx.__init__ = _memfilectx__init__
-
 # 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
--- a/setup.py	Sun Apr 08 17:03:08 2018 +0200
+++ b/setup.py	Mon Apr 02 14:14:55 2018 +0200
@@ -57,7 +57,7 @@
     "URLObject==2.3.4",
     "Routes==1.13",
     "dulwich>=0.14.1",
-    "mercurial>=2.9,<4.5",
+    "mercurial>=4.0,<4.5",
     "decorator >= 3.3.2",
     "Paste >= 2.0.3, < 3.0",
 ]