Show More
@@ -311,7 +311,7 b' def addremove(ui, repo, *files):' | |||
|
311 | 311 | repo.add(u) |
|
312 | 312 | repo.remove(d) |
|
313 | 313 | |
|
314 | def annotate(u, repo, file1, *files, **ops): | |
|
314 | def annotate(ui, repo, file1, *files, **opts): | |
|
315 | 315 | """show changeset information per file line""" |
|
316 | 316 | def getnode(rev): |
|
317 | 317 | return hg.short(repo.changelog.node(rev)) |
@@ -333,12 +333,13 b' def annotate(u, repo, file1, *files, **o' | |||
|
333 | 333 | |
|
334 | 334 | bcache = {} |
|
335 | 335 | opmap = [['user', getname], ['number', str], ['changeset', getnode]] |
|
336 | if not ops['user'] and not ops['changeset']: | |
|
337 | ops['number'] = 1 | |
|
336 | if not opts['user'] and not opts['changeset']: | |
|
337 | opts['number'] = 1 | |
|
338 | 338 | |
|
339 | node = repo.dirstate.parents()[0] | |
|
340 | if ops['revision']: | |
|
341 | node = repo.changelog.lookup(ops['revision']) | |
|
339 | if opts['revision']: | |
|
340 | node = repo.changelog.lookup(opts['revision']) | |
|
341 | else: | |
|
342 | node = repo.dirstate.parents()[0] | |
|
342 | 343 | change = repo.changelog.read(node) |
|
343 | 344 | mmap = repo.manifest.read(change[0]) |
|
344 | 345 | for f in relpath(repo, (file1,) + files): |
@@ -346,13 +347,13 b' def annotate(u, repo, file1, *files, **o' | |||
|
346 | 347 | pieces = [] |
|
347 | 348 | |
|
348 | 349 | for o, f in opmap: |
|
349 | if ops[o]: | |
|
350 | if opts[o]: | |
|
350 | 351 | l = [f(n) for n, dummy in lines] |
|
351 | 352 | m = max(map(len, l)) |
|
352 | 353 | pieces.append(["%*s" % (m, x) for x in l]) |
|
353 | 354 | |
|
354 | 355 | for p, l in zip(zip(*pieces), lines): |
|
355 |
u.write(" ".join(p) |
|
|
356 | ui.write("%s: %s" % (" ".join(p), l[1])) | |
|
356 | 357 | |
|
357 | 358 | def cat(ui, repo, file1, rev=None, **opts): |
|
358 | 359 | """output the latest or given revision of a file""" |
General Comments 0
You need to be logged in to leave comments.
Login now