Patchwork D7284: mdiff: mark diffopts as having dynamic attributes

login
register
mail settings
Submitter phabricator
Date Nov. 6, 2019, 10:59 p.m.
Message ID <differential-rev-PHID-DREV-o4arn4luggybkh6guhat-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/42835/
State Superseded
Headers show

Comments

phabricator - Nov. 6, 2019, 10:59 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This class looks like we could move it to being an attrs and life
  would be better, but let's do that later.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/mdiff.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/mdiff.py b/mercurial/mdiff.py
--- a/mercurial/mdiff.py
+++ b/mercurial/mdiff.py
@@ -38,6 +38,7 @@ 
 splitnewlines = bdiff.splitnewlines
 
 
+# TODO: this looks like it could be an attrs, which might help pytype
 class diffopts(object):
     '''context is the number of context lines
     text treats all files as text
@@ -52,6 +53,8 @@ 
     upgrade generates git diffs to avoid data loss
     '''
 
+    _HAS_DYNAMIC_ATTRIBUTES = True
+
     defaults = {
         b'context': 3,
         b'text': False,