D7262: templateutil: fix a missing ABCMeta assignment

2019-11-07 Thread durin42 (Augie Fackler)
Closed by commit rHG3e57809d3251: templateutil: fix a missing ABCMeta 
assignment (authored by durin42).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7262?vs=17632=17679

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7262/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7262

AFFECTED FILES
  mercurial/templateutil.py

CHANGE DETAILS

diff --git a/mercurial/templateutil.py b/mercurial/templateutil.py
--- a/mercurial/templateutil.py
+++ b/mercurial/templateutil.py
@@ -111,6 +111,8 @@
 class mappable(object):
 """Object which can be converted to a single template mapping"""
 
+__metaclass__ = abc.ABCMeta
+
 def itermaps(self, context):
 yield self.tomap(context)
 



To: durin42, #hg-reviewers, indygreg
Cc: dlax, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7262: templateutil: fix a missing ABCMeta assignment

2019-11-07 Thread dlax (Denis Laxalde)
dlax added inline comments.

INLINE COMMENTS

> dlax wrote in templateutil.py:114
> This is ignored on Python 3 (meaning it's possible to instantiate `mappable` 
> directly, despite some methods being abstract). It should be `class 
> mappable(metaclass=abc.ABCMeta)` on Python 3. 
> But I realize that there are other `__metaclass__ = abc.ABCMeta` in the code 
> base. Do we handle this somehow or has this been overlooked?

Just seen D7272  and others which explain 
this. Nevermind.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7262/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7262

To: durin42, #hg-reviewers, indygreg
Cc: dlax, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7262: templateutil: fix a missing ABCMeta assignment

2019-11-07 Thread dlax (Denis Laxalde)
dlax added inline comments.

INLINE COMMENTS

> templateutil.py:114
>  
> +__metaclass__ = abc.ABCMeta
> +

This is ignored on Python 3 (meaning it's possible to instantiate `mappable` 
directly, despite some methods being abstract). It should be `class 
mappable(metaclass=abc.ABCMeta)` on Python 3. 
But I realize that there are other `__metaclass__ = abc.ABCMeta` in the code 
base. Do we handle this somehow or has this been overlooked?

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7262/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7262

To: durin42, #hg-reviewers, indygreg
Cc: dlax, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7262: templateutil: fix a missing ABCMeta assignment

2019-11-06 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Caught by pytype.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7262

AFFECTED FILES
  mercurial/templateutil.py

CHANGE DETAILS

diff --git a/mercurial/templateutil.py b/mercurial/templateutil.py
--- a/mercurial/templateutil.py
+++ b/mercurial/templateutil.py
@@ -111,6 +111,8 @@
 class mappable(object):
 """Object which can be converted to a single template mapping"""
 
+__metaclass__ = abc.ABCMeta
+
 def itermaps(self, context):
 yield self.tomap(context)
 



To: durin42, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel