##// END OF EJS Templates
Fixes for annotate...
mpm@selenic.com -
r771:0de22301 default
parent child Browse files
Show More
@@ -379,17 +379,23 b' def annotate(ui, repo, *pats, **opts):'
379 change = repo.changelog.read(node)
379 change = repo.changelog.read(node)
380 mmap = repo.manifest.read(change[0])
380 mmap = repo.manifest.read(change[0])
381 for src, abs, rel in walk(repo, pats, opts):
381 for src, abs, rel in walk(repo, pats, opts):
382 if abs not in mmap:
383 ui.warn("warning: %s is not in the repository!\n" % rel)
384 continue
385
382 lines = repo.file(abs).annotate(mmap[abs])
386 lines = repo.file(abs).annotate(mmap[abs])
383 pieces = []
387 pieces = []
384
388
385 for o, f in opmap:
389 for o, f in opmap:
386 if opts[o]:
390 if opts[o]:
387 l = [f(n) for n, dummy in lines]
391 l = [f(n) for n, dummy in lines]
388 m = max(map(len, l))
392 if l:
389 pieces.append(["%*s" % (m, x) for x in l])
393 m = max(map(len, l))
394 pieces.append(["%*s" % (m, x) for x in l])
390
395
391 for p, l in zip(zip(*pieces), lines):
396 if pieces:
392 ui.write("%s: %s" % (" ".join(p), l[1]))
397 for p, l in zip(zip(*pieces), lines):
398 ui.write("%s: %s" % (" ".join(p), l[1]))
393
399
394 def cat(ui, repo, file1, rev=None, **opts):
400 def cat(ui, repo, file1, rev=None, **opts):
395 """output the latest or given revision of a file"""
401 """output the latest or given revision of a file"""
General Comments 0
You need to be logged in to leave comments. Login now