[PATCH] subrepo: better prompt during merge when subrepo is missing from remote revision

Angel Ezquerra angel.ezquerra at gmail.com
Tue May 24 01:31:07 CDT 2011


On Tue, May 24, 2011 at 12:07 AM, Matt Mackall <mpm at selenic.com> wrote:
> On Sun, 2011-05-22 at 00:32 +0200, Angel Ezquerra wrote:
>> # HG changeset patch
>> # User Angel Ezquerra <angel.ezquerra at gmail.com>
>> # Date 1301671367 -7200
>> # Node ID 02375760c833bf678a5601513a5efdd09d9c1ed4
>> # Parent  2c9f5897d4b7e163502b6ce56287d400da738d89
>> subrepo: better prompt during merge when subrepo is missing from remote revision
>>
>> Without this patch, mercurial tells the user that remote removed a subrepo even
>> if it was in fact added on local.
>
> I think you've spotted a valid bug, but I think your fix is too
> complicated. Please try this one:
>
> diff -r 253bda94372e mercurial/subrepo.py
> --- a/mercurial/subrepo.py      Mon May 23 23:22:47 2011 +0300
> +++ b/mercurial/subrepo.py      Mon May 23 17:04:09 2011 -0500
> @@ -137,6 +137,10 @@
>         elif ld == a: # remote removed, local unchanged
>             debug(s, "remote removed, remove")
>             wctx.sub(s).remove()
> +        elif a == nullstate: # not present in remote or ancestor
> +            debug(s, "local added, keep")
> +            sm[s] = l
> +            continue
>         else:
>             if repo.ui.promptchoice(
>                 _(' local changed subrepository %s which remote removed\n'
>

Thank you Matt,

That is a much simpler solution :-)

Angel


More information about the Mercurial-devel mailing list