Mercurial > hg > mercurial-crew-with-dirclash
comparison mercurial/commands.py @ 744:3d88f6dd1ed4
Handle empty file list for annotate
author | mpm@selenic.com |
---|---|
date | Thu, 21 Jul 2005 12:22:54 -0500 |
parents | b0ba1866d6b5 |
children | 9246ae925d57 |
comparison
equal
deleted
inserted
replaced
743:b0ba1866d6b5 | 744:3d88f6dd1ed4 |
---|---|
366 if f >= 0: | 366 if f >= 0: |
367 name = name[f+1:] | 367 name = name[f+1:] |
368 bcache[rev] = name | 368 bcache[rev] = name |
369 return name | 369 return name |
370 | 370 |
371 if not pats: | |
372 raise Abort('at least one file name or pattern required') | |
373 | |
371 bcache = {} | 374 bcache = {} |
372 opmap = [['user', getname], ['number', str], ['changeset', getnode]] | 375 opmap = [['user', getname], ['number', str], ['changeset', getnode]] |
373 if not opts['user'] and not opts['changeset']: | 376 if not opts['user'] and not opts['changeset']: |
374 opts['number'] = 1 | 377 opts['number'] = 1 |
375 | 378 |
377 node = repo.changelog.lookup(opts['rev']) | 380 node = repo.changelog.lookup(opts['rev']) |
378 else: | 381 else: |
379 node = repo.dirstate.parents()[0] | 382 node = repo.dirstate.parents()[0] |
380 change = repo.changelog.read(node) | 383 change = repo.changelog.read(node) |
381 mmap = repo.manifest.read(change[0]) | 384 mmap = repo.manifest.read(change[0]) |
382 for src, abs, rel in walk(repo, pats, opts, emptyok = False): | 385 for src, abs, rel in walk(repo, pats, opts): |
383 lines = repo.file(abs).annotate(mmap[abs]) | 386 lines = repo.file(abs).annotate(mmap[abs]) |
384 pieces = [] | 387 pieces = [] |
385 | 388 |
386 for o, f in opmap: | 389 for o, f in opmap: |
387 if opts[o]: | 390 if opts[o]: |