Patchwork D7042: phabricator: add the phabhunk data structure

login
register
mail settings
Submitter phabricator
Date Oct. 11, 2019, 5:54 p.m.
Message ID <1dab28f93d27ba9b5ab7011180ecc8f9@localhost.localdomain>
Download mbox | patch
Permalink /patch/42225/
State Not Applicable
Headers show

Comments

phabricator - Oct. 11, 2019, 5:54 p.m.
Kwan added a comment.
Kwan updated this revision to Diff 17073.


  Fix some test-check-code issues, and one test-check-pyflakes unused local.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7042?vs=17048&id=17073

BRANCH
  default

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

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

AFFECTED FILES
  hgext/phabricator.py

CHANGE DETAILS




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

Patch

diff --git a/hgext/phabricator.py b/hgext/phabricator.py
--- a/hgext/phabricator.py
+++ b/hgext/phabricator.py
@@ -50,6 +50,7 @@ 
 from mercurial.node import bin, nullid
 from mercurial.i18n import _
 from mercurial.pycompat import getattr
+from mercurial.thirdparty import attr
 from mercurial import (
     cmdutil,
     context,
@@ -465,6 +466,21 @@ 
     BINARY = 3
 
 
+@attr.s
+class phabhunk(dict):
+    """Represents a Differential hunk, which is owned by a Differential change
+    """
+
+    oldOffset = attr.ib(default=0)  # camelcase-required
+    oldLength = attr.ib(default=0)  # camelcase-required
+    newOffset = attr.ib(default=0)  # camelcase-required
+    newLength = attr.ib(default=0)  # camelcase-required
+    corpus = attr.ib(default='')
+    # These get added to the phabchange's equivalents
+    addLines = attr.ib(default=0)  # camelcase-required
+    delLines = attr.ib(default=0)  # camelcase-required
+
+
 def creatediff(ctx):
     """create a Differential Diff"""
     repo = ctx.repo()