/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/plugins/grep/grep.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-03-24 00:53:02 UTC
  • mfrom: (6883.7.16 cleanups)
  • Revision ID: breezy.the.bot@gmail.com-20180324005302-z0eh8ftsz57804cg
Avoid using file ids in a couple more places.

Merged from https://code.launchpad.net/~jelmer/brz/cleanups/+merge/341360

Show diffs side-by-side

added added

removed removed

Lines of Context:
357
357
            tree = rev.as_tree(branch)
358
358
            for path in opts.path_list:
359
359
                path_for_id = osutils.pathjoin(relpath, path)
360
 
                id = tree.path2id(path_for_id)
361
 
                if not id:
 
360
                if not tree.is_versioned(path_for_id):
362
361
                    trace.warning("Skipped unknown file '%s'." % path)
363
362
                    continue
364
363
 
366
365
                    path_prefix = path
367
366
                    dir_grep(tree, path, relpath, opts, revno, path_prefix)
368
367
                else:
369
 
                    versioned_file_grep(tree, id, '.', path, opts, revno)
 
368
                    versioned_file_grep(tree, path_for_id, '.', path, opts, revno)
370
369
 
371
370
 
372
371
def workingtree_grep(opts):
473
472
    return path
474
473
 
475
474
 
476
 
def versioned_file_grep(tree, id, relpath, path, opts, revno, path_prefix = None):
 
475
def versioned_file_grep(tree, path_for_id, relpath, path, opts, revno, path_prefix=None):
477
476
    """Create a file object for the specified id and pass it on to _file_grep.
478
477
    """
479
478
 
480
479
    path = _make_display_path(relpath, path)
481
 
    file_text = tree.get_file_text(relpath, id)
 
480
    file_text = tree.get_file_text(path_for_id)
482
481
    _file_grep(file_text, path, opts, revno, path_prefix)
483
482
 
484
483