summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
4f5410c)
'buffer' is the name of a built-in function:
http://docs.python.org/library/functions.html#buffer
Signed-off-by: Sergey Satskiy <sergey.satskiy@gmail.com>
Signed-off-by: Olivier Matz <zer0@droids-corp.org>
DIFFON="\x01"
DIFFOFF="\x02"
DIFFON="\x01"
DIFFOFF="\x02"
add_cpt, del_cpt = 0,0
line1, line2 = 0,0
hunk_off1, hunk_size1, hunk_off2, hunk_size2 = 0,0,0,0
add_cpt, del_cpt = 0,0
line1, line2 = 0,0
hunk_off1, hunk_size1, hunk_off2, hunk_size2 = 0,0,0,0
global add_cpt
global del_cpt
if del_cpt == 0 or add_cpt == 0:
global add_cpt
global del_cpt
if del_cpt == 0 or add_cpt == 0:
add_line(l[0], l[1])
elif del_cpt != 0 and add_cpt != 0:
l0, l1 = [], []
add_line(l[0], l[1])
elif del_cpt != 0 and add_cpt != 0:
l0, l1 = [], []
if l[0] != None:
l0.append(l[0])
if l[1] != None:
if l[0] != None:
l0.append(l[0])
if l[1] != None:
add_line(s0, s1)
add_cpt, del_cpt = 0,0
add_line(s0, s1)
add_cpt, del_cpt = 0,0
- global buffer, add_cpt, del_cpt
+ global buf, add_cpt, del_cpt
global line1, line2
global hunk_off1, hunk_size1, hunk_off2, hunk_size2
global line1, line2
global hunk_off1, hunk_size1, hunk_off2, hunk_size2
if re.match("^\+", l):
add_cpt += 1
hunk_size2 -= 1
if re.match("^\+", l):
add_cpt += 1
hunk_size2 -= 1
- buffer.append((None, l[1:]))
+ buf.append((None, l[1:]))
continue
if re.match("^\-", l):
del_cpt += 1
hunk_size1 -= 1
continue
if re.match("^\-", l):
del_cpt += 1
hunk_size1 -= 1
- buffer.append((l[1:], None))
+ buf.append((l[1:], None))
continue
if re.match("^\ ", l) and hunk_size1 and hunk_size2:
empty_buffer()
hunk_size1 -= 1
hunk_size2 -= 1
continue
if re.match("^\ ", l) and hunk_size1 and hunk_size2:
empty_buffer()
hunk_size1 -= 1
hunk_size2 -= 1
- buffer.append((l[1:], l[1:]))
+ buf.append((l[1:], l[1:]))