Merge lp:~parthm/bzr/503670-vila-grep-as-builtin into lp:bzr
Proposed by
Parth Malwankar
Status: | Rejected | ||||
---|---|---|---|---|---|
Rejected by: | Vincent Ladeuil | ||||
Proposed branch: | lp:~parthm/bzr/503670-vila-grep-as-builtin | ||||
Merge into: | lp:bzr | ||||
Diff against target: |
216 lines (+183/-0) 3 files modified
bzrlib/builtins.py (+127/-0) bzrlib/tests/blackbox/__init__.py (+1/-0) bzrlib/tests/blackbox/test_grep.py (+55/-0) |
||||
To merge this branch: | bzr merge lp:~parthm/bzr/503670-vila-grep-as-builtin | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Parth Malwankar | Disapprove | ||
Martin Packman (community) | Needs Fixing | ||
Robert Collins (community) | Needs Fixing | ||
Review via email: mp+19857@code.launchpad.net |
To post a comment you must log in.
Unmerged revisions
- 5054. By Parth Malwankar
-
ported tests
- 5053. By Parth Malwankar
-
move grep command into core (from plugin https:/
/code.launchpad .net/~vila/ bzr/grep)
Bug #503670
This patch ports the Vincent's grep plugin https:/ /code.launchpad .net/~vila/ bzr/grep
to builtins. The grep command is now available as 'bzr grep PATTERN [-- options]'. All grep options are support (followed by '--').
The current implementation requires xargs and grep commands to be available.
This command uses an implementation of os.path.relpath (ported from python 2.6 as cmd_grep._relpath). I tried using osutils.relpath but I found the two to be
inconsistent with the python 2.6 version in argument ordering, having optional arg and handling of '.'. As I don't fully understand the use cases of osutils.relpath I decided to keep cmd_grep._relpath.
Note on windows usage. unxutils. sourceforge. net/ installed. suggestions?
I tried this on a windows system with http://
The command silently existed for me even though xargs and grep are available. It may be a good idea to disable this command on non-POSIX OSes. We could add a new error type. Comments/
Example usage: test_version. py: def test_main_ version( self):
[bzrlib]% ../bzr --no-plugins grep main_version -- -i
__init__.py: main_version = '%d.%d' % version_info[:2]
__init__.py: main_version = '%d.%d.%d' % version_info[:3]
__init__.py: return main_version
__init__.py: return main_version + sub_string
tests/blackbox/
[bzrlib]%