Public Member Functions | |
def | __init__ |
def | dump |
def | split_ |
def | __str__ |
def | __repr__ |
def | check |
Public Attributes | |
children | |
meta | |
divs | |
Static Public Attributes | |
tuple | nchild = property(_nchild) |
tuple | smry = property(_smry) |
tuple | rejoin = property(lambda self:"\n".join([str(c) for c in self.children])) |
Hold the raw text of the full output of "svn diff" or "svnlook diff" and split into sub-Delta using the divider
Definition at line 297 of file svndiff.py.
def DybPython::svndiff::Diff::__init__ | ( | self, | ||
args, | ||||
kwargs | ||||
) |
Reimplemented from DybPython::svndiff::Text.
Definition at line 299 of file svndiff.py.
00302 : 00303 Text.__init__(self, *args, **kwargs) 00304 self.children = self.split_(Delta,lambda l:Delta.ptn[1].match(l), offset=-1 ) self.check()
def DybPython::svndiff::Diff::dump | ( | self | ) |
Definition at line 305 of file svndiff.py.
00308 : 00309 print repr(self) 00310 for dlt in self.children: 00311 print repr(dlt) 00312 if self.meta.get('verbose',False): 00313 for blk in dlt.children: 00314 print repr(blk) 00315 for hnk in blk.children: 00316 if hnk.smry: print repr(hnk)
def DybPython::svndiff::Text::split_ | ( | self, | ||
cls, | ||||
predicate = lambda line:True , |
||||
offset = 0 | ||||
) | [inherited] |
Definition at line 140 of file svndiff.py.
00144 :True, offset=0 ): 00145 divs = [] 00146 for n,line in enumerate(self): 00147 if predicate(line): 00148 divs.append(n+offset) 00149 self.divs = divs 00150 children = [] 00151 for i, n in enumerate(divs): 00152 if i + 1 < len(divs): 00153 m = divs[i+1] 00154 else: 00155 m = len(self)
def DybPython::svndiff::Text::__str__ | ( | self | ) | [inherited] |
def DybPython::svndiff::Text::__repr__ | ( | self | ) | [inherited] |
Reimplemented in DybPython::svndiff::Delta.
Definition at line 166 of file svndiff.py.
00168 : 00169 return "\n".join(self) 00170 def __repr__(self): 00171 try: 00172 label = "%(index)s[%(begin)s:%(end)s]" % self.meta except KeyError:
def DybPython::svndiff::Text::check | ( | self, | ||
verbose = False , |
||||
hdr = None | ||||
) | [inherited] |
Check can put together the split text
Definition at line 175 of file svndiff.py.
00177 :"\n".join([str(c) for c in self.children])) 00178 00179 def check(self, verbose=False, hdr=None ): 00180 """Check can put together the split text """ 00181 rejo = self.rejoin 00182 if hdr: 00183 rejo = "\n".join([ hdr, rejo]) 00184 00185 agree = str(self) == rejo 00186 00187 if verbose or not(agree): 00188 print "." * 50 + " original " + "." * 50 00189 print str(self) 00190 print "." * 50 + " recombined " + "." * 50 00191 print rejo
tuple DybPython::svndiff::Text::nchild = property(_nchild) [static, inherited] |
Definition at line 158 of file svndiff.py.
tuple DybPython::svndiff::Text::smry = property(_smry) [static, inherited] |
tuple DybPython::svndiff::Text::rejoin = property(lambda self:"\n".join([str(c) for c in self.children])) [static, inherited] |
Definition at line 173 of file svndiff.py.
DybPython::svndiff::Text::meta [inherited] |
Definition at line 135 of file svndiff.py.
DybPython::svndiff::Text::divs [inherited] |
Definition at line 137 of file svndiff.py.