[PATCH evolve_ext V2] fold: take an explicit list of revisions (BC)

Greg Ward greg at gerg.ca
Sat Jun 28 08:15:08 CDT 2014


[my patch review]
> You're mixing multiple changes together. Improving error messages,
> adding hints, and I18N are all good things ... but they are distinct
> things from "overhaul handling of revisions".

[Jordi's reply]
> Blegh, I hate splitting this. The error messages are related to the
> new functionality. The new functionality needs to go all at once. If I
> make --rev optional, then I would create an intermediate broken commit
> where you cannot work without folding with ".". I could also make
> intermediate pointless commits that don't use i18n in the error
> messages, but why would you want non-i18n messages to begin with? It's
> not like adding _() is that big of a change.

I was specifically talking about these three changes:

>      roots = repo.revs('roots(%ld)', revs)
>      if len(roots) > 1:
> -        raise util.Abort("set has multiple roots")
> +        raise util.Abort(_("cannot fold non-linear revisions"),
> +                           hint=_("multiple roots detected"))
>      root = repo[roots[0]]
>      if root.phase() <= phases.public:
> -        raise util.Abort("can't fold public revisions")
> +        raise util.Abort(_("cannot fold public revisions"))
>      heads = repo.revs('heads(%ld)', revs)
>      if len(heads) > 1:
> -        raise util.Abort("set has multiple heads")
> +        raise util.Abort(_("cannot fold non-linear revisions"),
> +                           hint=_("multiple heads detected"))

which are all improvements to existing error messages. The middle one
can *obviously* be sent independently of your UI changes. And IIUC, it
looks like the first and third can as well. So do that. They're small,
uncontroversial, and unquestionably make evolve better. Modulo a bit
of bikeshedding, this patch should go in *right now*. But combining it
with the UI overhaul means we have to fight over the UI before we can
get better error messages.

(Certain purists might object that you're combining I18N and improved
wording and adding hints in a single changeset. Nonsense. *I* think
it's fine. Hell, you might even through in a conversion from double
quotes to single quotes. ;-)

My bikeshedding contribution to these error messages: none. I think
they're great.

       Greg
-- 
Greg Ward                            http://www.gerg.ca
<greg at gerg.ca>                       @gergdotca


More information about the Mercurial-devel mailing list