Patchwork [1,of,9] formatter: remove unused private attributes from baseformatter

login
register
mail settings
Submitter Yuya Nishihara
Date April 12, 2018, 4:17 p.m.
Message ID <e6609e390f284931c10f.1523549824@mimosa>
Download mbox | patch
Permalink /patch/30807/
State Accepted
Headers show

Comments

Yuya Nishihara - April 12, 2018, 4:17 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1523543073 -32400
#      Thu Apr 12 23:24:33 2018 +0900
# Node ID e6609e390f284931c10f06f3c8258769fad9bbc5
# Parent  9c7a25ef5b49f3ce2fe698b58246b622ca9fd382
formatter: remove unused private attributes from baseformatter

No idea what they were for.
Gregory Szorc - April 12, 2018, 4:48 p.m.
On Thu, Apr 12, 2018 at 9:17 AM, Yuya Nishihara <yuya@tcha.org> wrote:

> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1523543073 -32400
> #      Thu Apr 12 23:24:33 2018 +0900
> # Node ID e6609e390f284931c10f06f3c8258769fad9bbc5
> # Parent  9c7a25ef5b49f3ce2fe698b58246b622ca9fd382
> formatter: remove unused private attributes from baseformatter
>

Queued this series with great delight, thanks!

This is infinitely better than my hacky series which was attempting to add
CBOR support. Thank you for coding this up.


>
> No idea what they were for.
>

AFAICT they are as old as this class and weren't even used when the class
was introduced! (3c0327ea20c0).


>
> diff --git a/mercurial/formatter.py b/mercurial/formatter.py
> --- a/mercurial/formatter.py
> +++ b/mercurial/formatter.py
> @@ -160,8 +160,6 @@ class baseformatter(object):
>      def __init__(self, ui, topic, opts, converter):
>          self._ui = ui
>          self._topic = topic
> -        self._style = opts.get("style")
> -        self._template = opts.get("template")
>          self._converter = converter
>          self._item = None
>          # function to convert node to string suitable for this output
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>

Patch

diff --git a/mercurial/formatter.py b/mercurial/formatter.py
--- a/mercurial/formatter.py
+++ b/mercurial/formatter.py
@@ -160,8 +160,6 @@  class baseformatter(object):
     def __init__(self, ui, topic, opts, converter):
         self._ui = ui
         self._topic = topic
-        self._style = opts.get("style")
-        self._template = opts.get("template")
         self._converter = converter
         self._item = None
         # function to convert node to string suitable for this output