[PATCH 1 of 2] record: refactored prompt choices to clean code and offer better choices

A. S. Budden abudden at gmail.com
Fri Mar 9 05:59:30 CST 2012


On 28 February 2012 23:16, Matt Mackall <mpm at selenic.com> wrote:
> On Tue, 2012-02-28 at 15:16 +0000, A. S. Budden wrote:
>> # HG changeset patch
>> # User A. S. Budden <abudden at gmail.com>
>> # Date 1329682649 0
>> # Node ID 18bd6bc67345de83db30e2ae1cb0d6fbe77f57ea
>> # Parent  41fc1e078d6822502277ac80325ec3db99707a6f
>> record: refactored prompt choices to clean code and offer better choices
>
> I think I owe you an apology for making you wade into this particular
> morass. Now that I've been looking at it, I see there's a lot that's
> just wrong here to start with and fixing it up is hard:
>
> - we're poking in the docs to generate help
> - the docs (almost) duplicate the built-in prompt strings
> - the prompt strings don't match normal capitalization style
> - the prompt strings are normally only used/seen by third-party code
> like THG which wraps ui objects
> - the prompt characters themselves are translatable
> - translated characters are not guaranteed to be one byte wide
> - the translated characters must correspond with the translated prompt
> strings
> - single-character strings are just bad news for translators
> - there's a bunch of fiddling with upper/lowercase that's i18n-naïve
> - promptchoice itself is pretty i18n-naïve itself
> - promptchoice returns an index, which means it's inherently hostile to
> dynamic prompt choices

Sounds very very complicated...

>
> Given that there's a bunch of hard issues here with conflicting
> solutions, the odds of a new contributor getting it all right in one
> patch is approximately 0.0000000001%. And indeed the present patch take
> a few steps forward and several steps back.

Fair enough.

> Any time you try to solve two problems at the same time, your odds of
> getting it right shrink dramatically. Which is why I'm continuously
> saying "one issue per patch, please".

That was the main reason my original patch just added support for
line-by-line commit without trying to fix the issues with prompt()

> I don't want to make fixing this particular disaster your burden, but I
> also don't want to make things worse here by piling on more technical
> debt. So probably, I'll just take your original patch, and we can try to
> tackle the above issues one by one.

Okay, great.  Is there anything else you need me to do (e.g. submit
the original patch with the [0 of 1] message moved into the commit
message)?  I'm assuming the "original patch" you're referring to is
this one:

    http://selenic.com/pipermail/mercurial-devel/2012-February/037948.html

Or am I wrong?

Al


More information about the Mercurial-devel mailing list