# HG changeset patch # User Marcin Kuzminski # Date 2019-03-04 10:27:25 # Node ID 7cf7cf22254d9c7c617e45b50000f592834447ae # Parent b3100e9462e02820c4161076f55d893e22faf48c Mercurial: addeed mercurial 4.9 support diff --git a/pkgs/python-packages.nix b/pkgs/python-packages.nix --- a/pkgs/python-packages.nix +++ b/pkgs/python-packages.nix @@ -316,11 +316,11 @@ self: super: { }; }; "mercurial" = super.buildPythonPackage { - name = "mercurial-4.6.2"; + name = "mercurial-4.9"; doCheck = false; src = fetchurl { - url = "https://files.pythonhosted.org/packages/d9/fb/c7ecf2b7fd349878dbf45b8390b8db735cef73d49dd9ce8a364b4ca3a846/mercurial-4.6.2.tar.gz"; - sha256 = "1bv6wgcdx8glihjjfg22khhc52mclsn4kwfqvzbzlg0b42h4xl0w"; + url = "https://files.pythonhosted.org/packages/1a/bb/fa36ada5f8d05651d30edeeb1b8dc7bf797ea701a77e4842c334246c912d/mercurial-4.9.tar.gz"; + sha256 = "01ig0464cvy9d87rn274g39frxr0p5q4lxf1xn5k3m24grf0qq0g"; }; meta = { license = [ pkgs.lib.licenses.gpl1 pkgs.lib.licenses.gpl2Plus ]; diff --git a/requirements.txt b/requirements.txt --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,7 @@ hgsubversion==1.9.3 hg-evolve==8.0.1 mako==1.0.7 markupsafe==1.1.0 -mercurial==4.6.2 +mercurial==4.9.0 msgpack-python==0.5.6 pastedeploy==2.0.1 diff --git a/vcsserver/hg.py b/vcsserver/hg.py --- a/vcsserver/hg.py +++ b/vcsserver/hg.py @@ -33,7 +33,7 @@ from vcsserver.base import RepoFactory, from vcsserver.hgcompat import ( archival, bin, clone, config as hgconfig, diffopts, hex, hg_url as url_parser, httpbasicauthhandler, httpdigestauthhandler, - makepeer, localrepository, match, memctx, exchange, memfilectx, nullrev, + makepeer, instance, match, memctx, exchange, memfilectx, nullrev, patch, peer, revrange, ui, hg_tag, Abort, LookupError, RepoError, RepoLookupError, InterventionRequired, RequirementError) @@ -114,7 +114,7 @@ class MercurialFactory(RepoFactory): def _create_repo(self, wire, create): baseui = self._create_config(wire["config"]) - return localrepository(baseui, wire["path"], create) + return instance(baseui, wire["path"], create) class HgRemote(object): @@ -266,14 +266,14 @@ class HgRemote(object): ctx = repo[revision] return ctx.description() - @reraise_safe_exceptions - def ctx_diff( - self, wire, revision, git=True, ignore_whitespace=True, context=3): - repo = self._factory.repo(wire) - ctx = repo[revision] - result = ctx.diff( - git=git, ignore_whitespace=ignore_whitespace, context=context) - return list(result) + # @reraise_safe_exceptions + # def ctx_diff( + # self, wire, revision, git=True, ignore_whitespace=True, context=3): + # repo = self._factory.repo(wire) + # ctx = repo[revision] + # result = ctx.diff( + # git=git, ignore_whitespace=ignore_whitespace, context=context) + # return list(result) @reraise_safe_exceptions def ctx_files(self, wire, revision): @@ -638,7 +638,7 @@ class HgRemote(object): # case when we want to compare two independent repositories if other_path and other_path != wire["path"]: baseui = self._factory._create_config(wire["config"]) - repo = unionrepo.unionrepository(baseui, other_path, wire["path"]) + repo = unionrepo.makeunionrepository(baseui, other_path, wire["path"]) else: repo = self._factory.repo(wire) return list(repo.revs(rev_spec, *args)) diff --git a/vcsserver/hgcompat.py b/vcsserver/hgcompat.py --- a/vcsserver/hgcompat.py +++ b/vcsserver/hgcompat.py @@ -44,7 +44,7 @@ from mercurial.error import ( LookupError, RepoError, RepoLookupError, Abort, InterventionRequired, RequirementError) from mercurial.hgweb import hgweb_mod -from mercurial.localrepo import localrepository +from mercurial.localrepo import instance from mercurial.match import match from mercurial.mdiff import diffopts from mercurial.node import bin, hex