/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 __init__.py

  • Committer: Parth Malwankar
  • Date: 2010-02-24 02:54:13 UTC
  • mto: (0.44.2 grep) (6531.3.1 merge-grep)
  • mto: This revision was merged to the branch mainline in revision 6555.
  • Revision ID: parth.malwankar@gmail.com-20100224025413-i2zeoeh2sf9qjbef
issue a warning while searching unversioned file

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
from bzrlib import (
33
33
    osutils,
34
34
    bzrdir,
 
35
    trace,
35
36
    )
36
37
""")
37
38
 
82
83
            raise errors.BzrError("Invalid pattern: '%s'" % pattern)
83
84
 
84
85
        for path in path_list:
 
86
            tree, branch, relpath = bzrdir.BzrDir.open_containing_tree_or_branch(path)
 
87
 
85
88
            if osutils.isdir(path):
86
 
                tree, branch, relpath = bzrdir.BzrDir.open_containing_tree_or_branch(path)
87
 
 
88
89
                # setup rpath to open files relative to cwd
89
90
                rpath = relpath
90
91
                if relpath:
101
102
            else:
102
103
                # if user has explicitly specified a file
103
104
                # we don't care if its versioned
 
105
                if not tree.path2id(path):
 
106
                    trace.warning("warning: file '%s' is not versioned." % path)
104
107
                self.file_grep('.', path, patternc, eol_marker)
105
108
 
106
109
    def file_grep(self, relpath, path, patternc, eol_marker):