GIF89a;
EcchiShell v1.0
/
/
usr/
lib64/
lib64/
lib64/
python2.7/
Tools/
$") # <> to force a mismatch by default
if rev:
if rev.find('.0.') >= 0:
rev = rev.replace('.0.', '.')
branch = re.compile(r"^" + re.escape(rev) + r"\.\d+$")
records = []
for lines in chunk[1:]:
revline = lines[0]
dateline = lines[1]
text = lines[2:]
words = dateline.split()
author = None
if len(words) >= 3 and words[0] == 'date:':
dateword = words[1]
timeword = words[2]
if timeword[-1:] == ';':
timeword = timeword[:-1]
date = dateword + ' ' + timeword
if len(words) >= 5 and words[3] == 'author:':
author = words[4]
if author[-1:] == ';':
author = author[:-1]
else:
date = None
text.insert(0, revline)
words = revline.split()
if len(words) >= 2 and words[0] == 'revision':
rev = words[1]
else:
# No 'revision' line -- weird...
rev = None
text.insert(0, revline)
if branch:
if rev is None or not branch.match(rev):
continue
records.append((date, working_file, rev, author, text))
return records
def format_output(database):
prevtext = None
prev = []
database.append((None, None, None, None, None)) # Sentinel
for (date, working_file, rev, author, text) in database:
if text != prevtext:
if prev:
print sep2,
for (p_date, p_working_file, p_rev, p_author) in prev:
print p_date, p_author, p_working_file, p_rev
sys.stdout.writelines(prevtext)
prev = []
prev.append((date, working_file, rev, author))
prevtext = text
if __name__ == '__main__':
try:
main()
except IOError, e:
if e.errno != errno.EPIPE:
raise