54
54
from bzrlib.tree import EmptyTree
55
55
from bzrlib.delta import compare_trees
56
56
from bzrlib.trace import mutter
59
60
def find_touching_revisions(branch, file_id):
408
409
from bzrlib.osutils import format_date
410
411
to_file = self.to_file
412
date_str = format_date(rev.timestamp, rev.timezone or 0,
412
414
print >>to_file, "%5d %s\t%s" % (revno, rev.committer,
413
415
format_date(rev.timestamp, rev.timezone or 0,
414
416
self.show_timezone))
426
428
delta.show(to_file, self.show_ids)
431
class LineLogFormatter(LogFormatter):
432
def truncate(self, str, max_len):
433
if len(str) <= max_len:
435
return str[:max_len-3]+'...'
437
def date_string(self, rev):
438
from bzrlib.osutils import format_date
439
return format_date(rev.timestamp, rev.timezone or 0,
440
self.show_timezone, date_fmt="%Y-%m-%d",
443
def message(self, rev):
445
return '(no message)'
449
def short_committer(self, rev):
450
return re.sub('<.*@.*>', '', rev.committer).strip(' ')
452
def show(self, revno, rev, delta):
453
print >> self.to_file, self.log_string(rev, 79)
455
def log_string(self, rev, max_chars):
456
out = [self.truncate(self.short_committer(rev), 20)]
457
out.append(self.date_string(rev))
458
out.append(self.message(rev).replace('\n', ' '))
459
return self.truncate(" ".join(out).rstrip('\n'), max_chars)
431
461
FORMATTERS = {'long': LongLogFormatter,
432
462
'short': ShortLogFormatter,
463
'line': LineLogFormatter,