/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: Jelmer Vernooij
  • Date: 2018-03-04 15:59:37 UTC
  • mto: This revision was merged to the branch mainline in revision 6913.
  • Revision ID: jelmer@jelmer.uk-20180304155937-pssy5js0av6hvmba
Make Tree.iter_files_bytes() take paths rather than file_ids.

Show diffs side-by-side

added added

removed removed

Lines of Context:
408
408
    from_dir = osutils.pathjoin(relpath, path)
409
409
    if opts.from_root:
410
410
        # start searching recursively from root
411
 
        from_dir=None
412
 
        recursive=True
 
411
        from_dir = None
 
412
        recursive = True
413
413
 
414
414
    to_grep = []
415
415
    to_grep_append = to_grep.append
435
435
                    #                but it's what the old code seemed to do
436
436
                    outputter.write_cached_lines(cache_id, revno)
437
437
                else:
438
 
                    to_grep_append((fid, (fp, fid)))
 
438
                    to_grep_append((osutils.pathjoin(from_dir if from_dir else '', fp), (fp, fid)))
439
439
            else:
440
440
                # we are grepping working tree.
441
441
                if from_dir is None:
454
454
    if revno != None: # grep versioned files
455
455
        for (path, fid), chunks in tree.iter_files_bytes(to_grep):
456
456
            path = _make_display_path(relpath, path)
457
 
            _file_grep(chunks[0], path, opts, revno, path_prefix,
 
457
            _file_grep(chunks, path, opts, revno, path_prefix,
458
458
                tree.get_file_revision(path, fid))
459
459
 
460
460