Issue37

Title can't revert broken .hgignore
Priority bug Status resolved
Superseder Nosy List ThomasAH, mpm, tksoh, tonfa, vadim
Assigned To tonfa Topics matcher

Created on 2005-10-26.00:42:26 by tksoh, last changed 2007-06-22.21:44:07 by mpm.

Files
File name Uploaded Type Edit Remove
hgignore.patch vadim, 2006-01-03.00:07:49 text/plain
matchererror.diff tonfa, 2005-10-27.08:04:40 text/plain
Messages
msg3263 (view) Author: mpm Date: 2007-06-22.21:44:07
Moving or fixing the .hgignore file is the right answer.
msg2179 (view) Author: ThomasAH Date: 2006-10-13.12:57:43
still an issue with bb9852b3bf06 (much after 0.9.1)
msg1257 (view) Author: ThomasAH Date: 2006-05-13.06:55:14
this is still an issue with Mercurial 0.9
msg385 (view) Author: ThomasAH Date: 2006-01-17.15:35:49
I think this issue isn't yet in the 'testing' stage.
msg356 (view) Author: tonfa Date: 2006-01-05.13:52:59
I think the proper solution would be to throw some sort of MatcherError
exception and catch it in the .hgignore case and not in the command line case.
By the way, Matt suggested it, the matcher functions could be implemented as a
class.
Sadly, I won't have time to work on this issue this month (i have a lot of work
for the end of the semester).
msg347 (view) Author: vadim Date: 2006-01-03.06:37:21
one thought that can maybe be safe: if error parsing ignore file, ignore
*everything*.

this way, every file not explicitly listed on command line will be ignored. this
will let you revert .hgignore by using "hg revert .hgignore", but e.g. "hg
revert some-dir-name" will do nothing.

i think this needs a patch to implement it and some testing to be sure it is safe.
msg345 (view) Author: vadim Date: 2006-01-03.00:07:49
here is patch to warn on error in hgignore file, instead of abort.

i am not sure it is right thing to do, but how else to undo mistaken edit of
hgignore?
msg334 (view) Author: vadim Date: 2006-01-02.01:49:34
[ is broken for sure.  if your shell finds a problem in a pattern, it usually
uses the text of the pattern and does not force you to fix the problem.
msg157 (view) Author: tonfa Date: 2005-11-07.22:12:49
@vadim:
the '[' glob pattern is not a broken pattern, it is valid (it does the same
thing as a shell will do: match '[')
msg156 (view) Author: tksoh Date: 2005-11-07.06:15:40
not sure how the '[' pattern managed to get past matcher, but I did find another
related bug (posted).
msg152 (view) Author: vadim Date: 2005-11-07.04:53:30
i see a problem. this hgignore file is broken, but mercurial does not report
anything:

syntax: glob
[
msg149 (view) Author: tksoh Date: 2005-11-06.02:24:29
As of writing, Hg aborts on invalid .hgingore patterns, which is the right thing
to me. Perhaps a note can be added to doc on handling of bad patterns in .hgignore.
msg122 (view) Author: tonfa Date: 2005-11-03.08:40:44
i think we need to be consistent:
- abort in case of error in .hgignore
- skip invalid patterns

actually we sometimes do the first option and sometimes the second.
msg119 (view) Author: mpm Date: 2005-11-03.08:11:02
I think this should be fixed now?

I don't like the disregard .hgignore option.
msg87 (view) Author: tksoh Date: 2005-10-28.09:25:52
IHMO, 2 and 3 may have their own share of concerns, while 1 may be a good trick
that should go into Wiki until a solution is implemented. Now if I may...

4) add a global option to disregard .hgignore.

This is just an extension on 3, but allows user to decide this is what they want
to do.
msg78 (view) Author: tonfa Date: 2005-10-27.08:04:40
tksoh, can you please test the attached patch, it implements option 2) (if
parsing of .hgignore failed, it will not use it).
msg69 (view) Author: tonfa Date: 2005-10-26.21:45:22
I am not sure what to do with it.
1) We don't change mercurial, the user remove .hgignore and revert it. (nothing
to do)
2) We report invalid patterns and continue parsing .hgignore (harder to do).
3) We report invalid patterns and we continue without ignoring something (easy
to do).
msg52 (view) Author: tksoh Date: 2005-10-26.00:42:25
If .hgignore contains invalid patterns, 'hg revert' aborts before reverting
anything - including the broken .hgignore itself. Apparently, it breaks 'hg
update -C' too.

The only workaround I found so far is to do 'hg cat .hgignore > .hgignore'
History
Date User Action Args
2007-06-22 21:44:07mpmsetstatus: chatting -> resolved
nosy: mpm, vadim, ThomasAH, tonfa, tksoh
messages: + msg3263
2006-10-13 12:57:43ThomasAHsetnosy: mpm, vadim, ThomasAH, tonfa, tksoh
messages: + msg2179
2006-05-13 06:55:17ThomasAHsetnosy: mpm, vadim, ThomasAH, tonfa, tksoh
messages: + msg1257
2006-03-15 06:17:53tonfasettopic: + matcher
nosy: mpm, vadim, ThomasAH, tonfa, tksoh
2006-01-17 15:35:51ThomasAHsetstatus: testing -> chatting
nosy: + ThomasAH
messages: + msg385
2006-01-05 13:53:01tonfasetnosy: mpm, vadim, tonfa, tksoh
messages: + msg356
2006-01-03 06:37:24vadimsetnosy: mpm, vadim, tonfa, tksoh
messages: + msg347
2006-01-03 00:07:50vadimsetfiles: + hgignore.patch
nosy: mpm, vadim, tonfa, tksoh
messages: + msg345
2006-01-02 01:49:35vadimsetnosy: mpm, vadim, tonfa, tksoh
messages: + msg334
2005-11-07 22:12:49tonfasetnosy: mpm, vadim, tonfa, tksoh
messages: + msg157
2005-11-07 06:15:41tksohsetnosy: mpm, vadim, tonfa, tksoh
messages: + msg156
2005-11-07 04:53:39vadimsetnosy: + vadim
2005-11-07 04:53:30vadimsetnosy: mpm, tonfa, tksoh
messages: + msg152
2005-11-06 02:24:30tksohsetnosy: mpm, tonfa, tksoh
messages: + msg149
2005-11-03 08:40:44tonfasetnosy: mpm, tonfa, tksoh
messages: + msg122
2005-11-03 08:11:03mpmsetstatus: chatting -> testing
nosy: mpm, tonfa, tksoh
messages: + msg119
2005-10-28 09:25:53tksohsetnosy: mpm, tonfa, tksoh
messages: + msg87
2005-10-27 08:13:28mpmsetnosy: + mpm
2005-10-27 08:04:40tonfasetfiles: + matchererror.diff
messages: + msg78
2005-10-26 21:45:23tonfasetstatus: unread -> chatting
messages: + msg69
2005-10-26 00:44:32mpmsetassignedto: tonfa
nosy: + tonfa
2005-10-26 00:42:26tksohcreate