give a better message for an invalid ignore regexp
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| Bazaar |
Medium
|
Parth Malwankar |
Bug Description
C:\temp\bt>bzr init
Standalone tree (format: pack-0.92)
Location:
branch root: .
C:\temp\bt>bzr ignore RE:*.cpp
bzr: ERROR: sre_constants.
Traceback (most recent call last):
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "bzrlib\
File "re.pyo", line 188, in compile
File "re.pyo", line 241, in _compile
error: nothing to repeat
bzr 1.9 on python 2.5.2 (win32)
arguments: ['bzr', 'ignore', 'RE:*.cpp']
encoding: 'cp1252', fsenc: 'mbcs', lang: None
plugins:
bzrtools C:\Program Files\Bazaar\
launchpad C:\Program Files\Bazaar\
qbzr C:\Program Files\Bazaar\
svn C:\Program Files\Bazaar\
*** Bazaar has encountered an internal error.
Please report a bug at https:/
including this traceback, and a description of what you
were doing when the error occurred.
Related branches
- John A Meinel: Needs Fixing on 2010-06-28
- Robert Collins (community): Needs Fixing on 2010-06-21
-
Diff: 698 lines (+360/-66)17 files modifiedNEWS (+8/-0)
bzrlib/builtins.py (+11/-2)
bzrlib/errors.py (+7/-0)
bzrlib/globbing.py (+134/-4)
bzrlib/ignores.py (+2/-3)
bzrlib/lazy_regex.py (+13/-6)
bzrlib/log.py (+1/-3)
bzrlib/osutils.py (+0/-23)
bzrlib/tests/__init__.py (+1/-2)
bzrlib/tests/blackbox/test_add.py (+30/-0)
bzrlib/tests/blackbox/test_ignore.py (+33/-0)
bzrlib/tests/blackbox/test_ignored.py (+14/-0)
bzrlib/tests/blackbox/test_log.py (+2/-5)
bzrlib/tests/blackbox/test_status.py (+53/-0)
bzrlib/tests/test_globbing.py (+50/-0)
bzrlib/tests/test_ignores.py (+1/-0)
bzrlib/tests/test_osutils.py (+0/-18)
- John A Meinel: Needs Fixing on 2010-06-18
- Robert Collins: Pending requested 2010-06-18
- bzr-core: Pending requested 2010-06-04
-
Diff: 680 lines (+383/-39)12 files modifiedNEWS (+5/-0)
bzrlib/builtins.py (+10/-0)
bzrlib/errors.py (+1/-1)
bzrlib/globbing.py (+143/-28)
bzrlib/lazy_regex.py (+6/-6)
bzrlib/tests/blackbox/test_add.py (+28/-0)
bzrlib/tests/blackbox/test_ignore.py (+32/-0)
bzrlib/tests/blackbox/test_ignored.py (+15/-0)
bzrlib/tests/blackbox/test_ls.py (+23/-0)
bzrlib/tests/blackbox/test_status.py (+69/-0)
bzrlib/tests/test_globbing.py (+41/-4)
bzrlib/tests/test_ignores.py (+10/-0)
- Martin Pool: Approve on 2010-07-07
- John A Meinel: Needs Information on 2010-06-30
- Diff: 0 lines
- bzr-core: Pending requested 2010-07-08
-
Diff: 272 lines (+128/-38)6 files modifiedNEWS (+1/-0)
bzrlib/builtins.py (+8/-0)
bzrlib/globbing.py (+73/-23)
bzrlib/tests/blackbox/test_ignore.py (+16/-0)
bzrlib/tests/per_workingtree/test_is_ignored.py (+25/-13)
bzrlib/tests/test_globbing.py (+5/-2)
- Vincent Ladeuil: Approve on 2010-07-21
- John A Meinel: Needs Fixing on 2010-07-19
-
Diff: 279 lines (+135/-39)6 files modifiedNEWS (+5/-0)
bzrlib/builtins.py (+8/-0)
bzrlib/globbing.py (+75/-23)
bzrlib/tests/blackbox/test_ignore.py (+16/-0)
bzrlib/tests/per_workingtree/test_is_ignored.py (+25/-13)
bzrlib/tests/test_globbing.py (+6/-3)
description: | updated |
John A Meinel (jameinel) wrote : | #1 |
Changed in bzr: | |
importance: | Undecided → Low |
status: | New → Triaged |
nothing1212 (davidtgaulin) wrote : Re: [Bug 300062] Re: "bzr ignore RE:*.cpp" just crashed in an empty repo. | #2 |
Thank you for the explanation... can I correct the code myself?
If so, how do I get commit access to the code?
On Wed, Nov 19, 2008 at 15:45, John A Meinel <email address hidden> wrote:
> *.cpp
>
> is an invalid regex, I would guess you actually just wanted a glob,
> which would be "*.cpp".
>
> If you wanted a regex, then you would need "RE:.*\.cpp"
>
> That said, bzr could be a bit better about giving you a single line
> "Invalid regex: '*.cpp'" or something of the sort.
>
> ** Changed in: bzr
> Importance: Undecided => Low
> Status: New => Triaged
>
> --
> "bzr ignore RE:*.cpp" just crashed in an empty repo.
> https:/
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Bazaar Version Control System: Triaged
>
> Bug description:
> C:\temp\bt>bzr init
> Standalone tree (format: pack-0.92)
> Location:
> branch root: .
>
> C:\temp\bt>bzr ignore RE:*.cpp
> bzr: ERROR: sre_constants.
>
> Traceback (most recent call last):
> File "bzrlib\
> File "bzrlib\
> File "bzrlib\
> File "bzrlib\
> File "bzrlib\
> File "bzrlib\
> File "bzrlib\
> File "bzrlib\
> File "re.pyo", line 188, in compile
> File "re.pyo", line 241, in _compile
> error: nothing to repeat
>
> bzr 1.9 on python 2.5.2 (win32)
> arguments: ['bzr', 'ignore', 'RE:*.cpp']
> encoding: 'cp1252', fsenc: 'mbcs', lang: None
> plugins:
> bzrtools C:\Program Files\Bazaar\
> launchpad C:\Program Files\Bazaar\
> qbzr C:\Program Files\Bazaar\
> svn C:\Program Files\Bazaar\
> *** Bazaar has encountered an internal error.
> Please report a bug at https:/
> including this traceback, and a description of what you
> were doing when the error occurred.
>
Marius Kruger (amanica) wrote : | #3 |
2008/11/20 nothing1212 <email address hidden>
> Thank you for the explanation... can I correct the code myself?
> If so, how do I get commit access to the code?
you'll need the dev version which can be obtained like so:
bzr branch http://
(NB its a lot to download, the bzr.dev branch is about 93MB at the moment)
contribution guidlines can be found at:
http://
Changed in bzr: | |
status: | Triaged → Confirmed |
summary: |
- "bzr ignore RE:*.cpp" just crashed in an empty repo. + give a better message for an invalid ignore regexp |
tags: | added: easy ignore traceback |
Parth Malwankar (parthm) wrote : | #4 |
This is present on trunk (towards 2.2b4).
[aaa]% bzr ignore "RE:*.cpp"
bzr: ERROR: sre_constants.
Traceback (most recent call last):
File "/storage/
return the_callable(*args, **kwargs)
File "/storage/
ret = run(*run_argv)
File "/storage/
return self.run(
File "/storage/
return self._operation
File "/storage/
self.cleanups, self.func, *args, **kwargs)
File "/storage/
result = func(*args, **kwargs)
File "/storage/
if ignored.
File "/storage/
match = regex.match(
File "/storage/
self.
File "/storage/
**self.
File "/storage/
return _real_re_
File "/usr/lib/
return _compile(pattern, flags)
File "/usr/lib/
raise error, v # invalid expression
error: nothing to repeat
You can report this problem to Bazaar's developers by running
apport-bug /var/crash/
if a bug-reporting window does not automatically appear.
[aaa]%
Changed in bzr: | |
importance: | Low → Medium |
assignee: | nobody → Parth Malwankar (parthm) |
status: | Confirmed → In Progress |
Parth Malwankar (parthm) wrote : | #5 |
Just to add. The invalid pattern gets added to the .bzrignore file.
Parth Malwankar (parthm) wrote : | #6 |
Bad ignore pattern now shows a clear message.
[a1]% ~/src/bzr.
bzr: error: Invalid ignore pattern(s) found.
RE:*.cpp
bzr: ERROR: Invalid pattern(s) found.
[a1]%
Changed in bzr: | |
status: | In Progress → Fix Released |
milestone: | none → 2.2.0 |
*.cpp
is an invalid regex, I would guess you actually just wanted a glob, which would be "*.cpp".
If you wanted a regex, then you would need "RE:.*\.cpp"
That said, bzr could be a bit better about giving you a single line "Invalid regex: '*.cpp'" or something of the sort.