~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Martin Pool
  • Date: 2005-05-05 07:43:42 UTC
  • Revision ID: mbp@sourcefrog.net-20050505074342-6b2d3c39edc0c4cd
- New command touching-revisions and function to trace
  changes to a given file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
432
432
                        show_ids=show_ids)
433
433
 
434
434
 
 
435
 
 
436
class cmd_touching_revisions(Command):
 
437
    """Return revision-ids which affected a particular file."""
 
438
    hidden = True
 
439
    takes_args = ["filename"]
 
440
    def run(self, filename):
 
441
        b = Branch(filename, lock_mode='r')
 
442
        inv = b.read_working_inventory()
 
443
        file_id = inv.path2id(b.relpath(filename))
 
444
        for revno, revision_id, what in bzrlib.log.find_touching_revisions(b, file_id):
 
445
            print "%6d %s" % (revno, what)
 
446
 
 
447
 
435
448
class cmd_ls(Command):
436
449
    """List files in a tree.
437
450