Patchwork keyword: handle filectx _customcmp

login
register
mail settings
Submitter Christian Ebert
Date Nov. 7, 2016, 10:23 p.m.
Message ID <94e42c8808cdd96891a9.1478557429@1.0.0.127.in-addr.arpa>
Download mbox | patch
Permalink /patch/17380/
State Accepted
Headers show

Comments

Christian Ebert - Nov. 7, 2016, 10:23 p.m.
# HG changeset patch
# User Christian Ebert <blacktrash@gmx.net>
# Date 1476718966 -7200
#      Mon Oct 17 17:42:46 2016 +0200
# Node ID 94e42c8808cdd96891a9f375f02a0760670e33d8
# Parent  d06c049695e6ad3219e7479c65ce98a2f123e878
keyword: handle filectx _customcmp

Suggested by Yuya Nishihara:
https://www.mercurial-scm.org/pipermail/mercurial-devel/2016-October/089461.html

Related to issue5364.
Augie Fackler - Nov. 8, 2016, 5:55 p.m.
On Mon, Nov 07, 2016 at 10:23:49PM +0000, Christian Ebert wrote:
> # HG changeset patch
> # User Christian Ebert <blacktrash@gmx.net>
> # Date 1476718966 -7200
> #      Mon Oct 17 17:42:46 2016 +0200
> # Node ID 94e42c8808cdd96891a9f375f02a0760670e33d8
> # Parent  d06c049695e6ad3219e7479c65ce98a2f123e878
> keyword: handle filectx _customcmp

Queued, thanks.

>
> Suggested by Yuya Nishihara:
> https://www.mercurial-scm.org/pipermail/mercurial-devel/2016-October/089461.html
>
> Related to issue5364.
>
> diff --git a/hgext/keyword.py b/hgext/keyword.py
> --- a/hgext/keyword.py
> +++ b/hgext/keyword.py
> @@ -737,6 +737,8 @@ def reposetup(ui, repo):
>              return ret
>
>      def kwfilectx_cmp(orig, self, fctx):
> +        if fctx._customcmp:
> +            return fctx.cmp(self)
>          # keyword affects data size, comparing wdir and filelog size does
>          # not make sense
>          if (fctx._filenode is None and
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

diff --git a/hgext/keyword.py b/hgext/keyword.py
--- a/hgext/keyword.py
+++ b/hgext/keyword.py
@@ -737,6 +737,8 @@  def reposetup(ui, repo):
             return ret
 
     def kwfilectx_cmp(orig, self, fctx):
+        if fctx._customcmp:
+            return fctx.cmp(self)
         # keyword affects data size, comparing wdir and filelog size does
         # not make sense
         if (fctx._filenode is None and