[PATCH] merge: report all files in _checkunknown

Idan Kamara idankk86 at gmail.com
Thu Jan 12 04:52:42 CST 2012


On Thu, Jan 12, 2012 at 2:38 AM, Jordi Gutiérrez Hermoso <jordigh at octave.org
> wrote:

> 2012/1/11 Idan Kamara <idankk86 at gmail.com>:
> > On Wed, Jan 11, 2012 at 11:00 PM, Jordi Gutiérrez Hermoso
> > <jordigh at octave.org> wrote:
> >>
> >> # HG changeset patch
> >> # User Jordi Gutiérrez Hermoso <jordigh at octave.org>
> >> # Date 1326315222 18000
> >> # Node ID 9fe70ec6cb418daa14fed5f09f94c4f482d4d052
> >> # Parent  c47d69ce5208d5b5cfd2fb2f0f1d7a2b4795fbf5
> >> merge: report all files in _checkunknown
> >
> >
> > Some suggestions below (without really digging how to kill this function
> > like Matt said).
> >
> >>
> >>
> >> When doing hg up, if there is a file conflict with untracked files,
> >> currently only the first such conflict is reported. With this patch,
> >> all of them are listed.
> >>
> >> Since this requires a list, makes sense to put this list as another
> >> kwarg to the Abort exception. The hint kwarg is the wrong place for
> >> it, since it doesn't get displayed correctly for this purpose. I
> >> displayed this list along with the error in the relevant locations in
> >> dispatch.py
> >
> >
> > Why not just do the formatting at _checkunknown? It's less intrusive
> > than adding an error list to util.Abort, which doesn't sound too useful.
>
> I don't know. I thought it was uncharacteristic of the hg code to
> terminate abruptly instead of raising exceptions.
>

I meant instead of passing a list of errors to util.Abort, call
'\n'.join(..) and pass the fully formatted error string when raising
util.Abort.


>
> >>
> >>
> >> With this patch error message is now reported as
> >>
> >>    abort: untracked file(s) in working directory differ from file(s)
> >>    in requested revision:
> >>      a
> >>      b
> >>
> >>
> >> instead of
> >>
> >>    abort: untracked file in working directory differs from file in
> >>    requested revision: 'a'
> >
> >
> > What about:
> >
> > abort: untracked file in working directory differs from file in
> >    requested revision: 'a', 'b', 'c'
> >
> > It might be more consistent with the rest of the abort messages.
>
> Well, consider the case of hundreds of files. Having them all display
> on the same line would provide very ugly output.
>

Yeah, then maybe the place for this summary isn't in an error message,
maybe with -v.

A hint to hg status -u would have been better, but that might show untracked
files that aren't getting in the way.


>
> - Jordi G. H.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20120112/16cc8492/attachment.html>


More information about the Mercurial-devel mailing list