[PATCH] mq: gracefully handle malformated status file

Mads Kiilerich mads at kiilerich.com
Sat Feb 12 15:09:07 CST 2011


pierre-yves.david at logilab.fr wrote, On 02/11/2011 01:15 PM:
> # HG changeset patch
> # User Pierre-Yves David<pierre-yves.david at logilab.fr>
> # Date 1297426239 -3600
> # Branch stable
> # Node ID 13ce20da49086647b98883aa0c239f85242bbe05
> # Parent  02aa06a021a066cb360dc71097dedfa3ef123bb2
> mq: gracefully handle malformated status file.
>
> This patch prevent mq to crash when .hg/patches/status contains Malformed lines
> (without ":"). Blank lines are ignored and other malformed lines issue a
> warning.

Do we really need this? The status file should not be edited manually 
anyway, and I'm not sure we should be flexible when parsing it. I think 
it would make more sense to abort with a clear error message so those 
who edited it and introduced errors can fix their own mess.

It seems to me like the real problem here is that all exceptions that 
happens while parsing the status file are silently ignored.

/Mads



More information about the Mercurial-devel mailing list