# HG changeset patch # User Anton Shestakov # Date 2016-05-05 03:19:52 # Node ID 36d3535c6a475a7215feba432048a0d756cb416d # Parent 3f0177d2b8fb019a422563f9684b44800621293b 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 '' % (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,