Mercurial > hg
comparison mercurial/simplemerge.py @ 48750:aed8ef33db8b
simplemerge: convert MergeInput to regular, non-attr.ib class
I'm about to add more logic and state to it.
Differential Revision: https://phab.mercurial-scm.org/D12145
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 04 Feb 2022 18:36:36 -0800 |
parents | 9ee70e175fed |
children | 59c6724ddccb |
comparison
equal
deleted
inserted
replaced
48749:9ee70e175fed | 48750:aed8ef33db8b |
---|---|
17 # s: "i hate that." | 17 # s: "i hate that." |
18 | 18 |
19 from __future__ import absolute_import | 19 from __future__ import absolute_import |
20 | 20 |
21 from .i18n import _ | 21 from .i18n import _ |
22 from .thirdparty import attr | |
23 from . import ( | 22 from . import ( |
24 error, | 23 error, |
25 mdiff, | 24 mdiff, |
26 pycompat, | 25 pycompat, |
27 ) | 26 ) |
472 else: | 471 else: |
473 lines.extend(group_lines) | 472 lines.extend(group_lines) |
474 return lines | 473 return lines |
475 | 474 |
476 | 475 |
477 @attr.s | |
478 class MergeInput(object): | 476 class MergeInput(object): |
479 fctx = attr.ib() | 477 def __init__(self, fctx, label=None, label_detail=None): |
480 label = attr.ib(default=None) | 478 self.fctx = fctx |
481 # If the "detail" part is set, then that is rendered after the label and | 479 self.label = label |
482 # separated by a ':'. The label is padded to make the ':' aligned among all | 480 # If the "detail" part is set, then that is rendered after the label and |
483 # merge inputs. | 481 # separated by a ':'. The label is padded to make the ':' aligned among |
484 label_detail = attr.ib(default=None) | 482 # all merge inputs. |
483 self.label_detail = label_detail | |
485 | 484 |
486 | 485 |
487 def simplemerge( | 486 def simplemerge( |
488 ui, | 487 ui, |
489 local, | 488 local, |