##// END OF EJS Templates
crecord: add `content` properties to all nodes...
Jordi Gutiérrez Hermoso -
r52274:1d488f7b default
parent child Browse files
Show More
@@ -86,6 +86,10 b' class patchnode:'
86 (i.e. patchroot, header, hunk, hunkline)
86 (i.e. patchroot, header, hunk, hunkline)
87 """
87 """
88
88
89 @property
90 def content(self):
91 return b''
92
89 def firstchild(self):
93 def firstchild(self):
90 raise NotImplementedError(b"method must be implemented by subclass")
94 raise NotImplementedError(b"method must be implemented by subclass")
91
95
@@ -223,6 +227,10 b' class uiheader(patchnode):'
223 self.neverunfolded = True
227 self.neverunfolded = True
224 self.hunks = [uihunk(h, self) for h in self.hunks]
228 self.hunks = [uihunk(h, self) for h in self.hunks]
225
229
230 @property
231 def content(self):
232 return self.filename()
233
226 def prettystr(self):
234 def prettystr(self):
227 x = stringio()
235 x = stringio()
228 self.pretty(x)
236 self.pretty(x)
@@ -289,6 +297,10 b' class uihunkline(patchnode):'
289 # in the previtem method.
297 # in the previtem method.
290 self.folded = False
298 self.folded = False
291
299
300 @property
301 def content(self):
302 return self.linetext
303
292 def prettystr(self):
304 def prettystr(self):
293 return self.linetext
305 return self.linetext
294
306
@@ -347,6 +359,10 b' class uihunk(patchnode):'
347 # children are partially applied (i.e. some applied, some not).
359 # children are partially applied (i.e. some applied, some not).
348 self.partial = False
360 self.partial = False
349
361
362 @property
363 def content(self):
364 return self.proc if self.proc else b''
365
350 def nextsibling(self):
366 def nextsibling(self):
351 numhunksinheader = len(self.header.hunks)
367 numhunksinheader = len(self.header.hunks)
352 indexofthishunk = self.header.hunks.index(self)
368 indexofthishunk = self.header.hunks.index(self)
General Comments 0
You need to be logged in to leave comments. Login now