[PATCH 1 of 6] crecord: add/remove blank lines (coding style)
Anton Shestakov
av6 at dwimlabs.net
Thu May 5 13:54:01 UTC 2016
# HG changeset patch
# User Anton Shestakov <av6 at dwimlabs.net>
# Date 1462418392 -28800
# Thu May 05 11:19:52 2016 +0800
# Node ID a9f7adbb623c7587085949f0159a17a873a2c589
# Parent 8eba4cdcfd810d80785c94d770a442c5bd1f9d0f
crecord: add/remove blank lines (coding style)
diff --git a/mercurial/crecord.py b/mercurial/crecord.py
--- a/mercurial/crecord.py
+++ b/mercurial/crecord.py
@@ -91,6 +91,7 @@ class patchnode(object):
def allchildren(self):
"Return a list of all of the direct children of this node"
raise NotImplementedError("method must be implemented by subclass")
+
def nextsibling(self):
"""
Return the closest next item of the same type where there are no items
@@ -110,7 +111,6 @@ class patchnode(object):
def parentitem(self):
raise NotImplementedError("method must be implemented by subclass")
-
def nextitem(self, constrainlevel=True, skipfolded=True):
"""
If constrainLevel == True, return the closest next item
@@ -236,7 +236,6 @@ class uiheader(patchnode):
self.neverunfolded = True
self.hunks = [uihunk(h, self) for h in self.hunks]
-
def prettystr(self):
x = stringio()
self.pretty(x)
@@ -392,6 +391,7 @@ class uihunk(patchnode):
def allchildren(self):
"return a list of all of the direct children of this node"
return self.changedlines
+
def countchanges(self):
"""changedlines -> (n+,n-)"""
add = len([l for l in self.changedlines if l.applied
@@ -455,6 +455,7 @@ class uihunk(patchnode):
def __getattr__(self, name):
return getattr(self._hunk, name)
+
def __repr__(self):
return '<hunk %r@%d>' % (self.filename(), self.fromline)
@@ -766,7 +767,6 @@ class curseschunkselector(object):
# negative values scroll in pgup direction
self.scrolllines(selstart - padstartbuffered)
-
def scrolllines(self, numlines):
"scroll the screen up (down) by numlines when numlines >0 (<0)."
self.firstlineofpadtoprint += numlines
@@ -894,7 +894,6 @@ class curseschunkselector(object):
if isinstance(item, (uiheader, uihunk)):
item.folded = not item.folded
-
def alignstring(self, instr, window):
"""
add whitespace to the end of a string in order to make it fill
@@ -1133,7 +1132,6 @@ class curseschunkselector(object):
lineprefix = " "*self.hunkindentnumchars + checkbox
frtoline = " " + hunk.getfromtoline().strip("\n")
-
outstr += self.printstring(self.chunkpad, lineprefix, towin=towin,
align=False) # add uncolored checkbox/indent
outstr += self.printstring(self.chunkpad, frtoline, pair=colorpair,
More information about the Mercurial-devel
mailing list