D464: commit: use an unambiguous path suffix for the commit editor file

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Mon Aug 28 14:58:46 EDT 2017


durin42 requested changes to this revision.
durin42 added inline comments.

INLINE COMMENTS

> cmdutil.py:3214
> +    extra = ctx.extra()
> +    extra['suffix'] = '.hgcommit.txt'
> +

I agree with smf: this patch is accomplishing a reasonable thing, but we should clean up this interface if we're going to use it. Let's add an action= parameter that's optional in the 4.4 cycle, with a devel warning if it's not specified. Then in 4.4 we can make it a mandatory parameter for ui.edit().

Right now the only client of this poke-something-in-extra API is histedit, so the time is right to clean up the API before more consumers do silly things. For your immediate goal in this patch, here's what I'd suggest as a compromise:

1. Add the new action=None business to ui.edit(), which then makes suffix='.hg$ACTION.txt' or similar
2. Update histedit to use that instead of screwing around with 'suffix' in extra
3. Remove support for 'suffix' in extra
4. Do this patch, but with action='commit' instead of poking '.hgcommit.txt' in the extra

How does that sound to everyone?

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D464

To: mbolin, quark, durin42, #hg-reviewers, ryanmce
Cc: smf, ryanmce, mercurial-devel


More information about the Mercurial-devel mailing list