[PATCH V3 [RETITLED]] subrepo: append subrepo path to subrepo error messages

Angel Ezquerra angel.ezquerra at gmail.com
Sun Dec 16 17:27:07 CST 2012


On Mon, Dec 17, 2012 at 12:24 AM, Angel Ezquerra
<angel.ezquerra at gmail.com> wrote:
> # HG changeset patch
> # User Angel Ezquerra <angel.ezquerra at gmail.com>
> # Date 1355438273 -3600
> # Node ID 964686dbc23ea2e66c5f86ebffe96425096dd89c
> # Parent  34a1a639d8358e43f4bcba7b0cff19f4e4e6958d
> subrepo: append subrepo path to subrepo error messages
>
> This change appends the subrepo path to subrepo errors. That is, when there
> is an error performing an operation a subrepo, rather than displaying a message
> such as:
>
> pushing subrepo MYSUBREPO to PATH
> searching for changes
> abort: push creates new remote head HEADHASH!
> hint: did you forget to merge? use push -f to force
>
> mercurial will show:
>
> pushing subrepo MYSUBREPO to PATH
> searching for changes
> abort: push creates new remote head HEADHASH! (on subrepo MYSUBREPO)
> hint: did you forget to merge? use push -f to force
>
> The rationale for this change is that the current error messages make it hard
> for TortoiseHg (and similar tools) to tell the user which subrepo caused the
> push failure.
>
> The "(on subrepo MYSUBREPO)" message has been added to those subrepo methods
> were it made sense (by using a decorator).
>
> Because the state() function already printed the subrepo path when it threw an
> error, that error has been changed to avoid duplicating the subrepo path in the
> error message.
>
> Note that I have also updated test-subrepo.t to reflect these changes. The test
> passes on windows.
>

This is a new version of the patch that was titled "".
This new version tries to follow Mads advice of using a decorator and
adding the subrepo that caused the error to all subrepo errors.

I've tried to decorate those subrepo methods were I think it would
make sense to handle errors in this manner. I've also had to chagne an
existing error message to accommodate the way we append the subrepo
that is in error to all error messages.

Cheers,

Angel


More information about the Mercurial-devel mailing list