Any way to prevent Evolve's `metaedit` from opening the message?

Faheem Mitha faheem at faheem.info
Fri Apr 7 18:09:45 UTC 2023


Hi Marco,

See below.

On Fri, 7 Apr 2023, Marcos Cruz wrote:

> Faheem Mitha escribió/skribis/wrote/scrit (2023-04-07T22:18:48+0530):
>
>> Yes, normally metaedit is intended to edit the existing commit message.
>> Hence it's natural to open an editor. What's the problem with that?
>
> I'm converting my last Fossil repos to Mercurial.
>
> The other day I had to fix the author of 287 commits that lacked email
> because of an old unnoticed misconfiguration in the Fossil repo, which
> has a GitHub mirror.
>
> I wrote a simple shell loop in order to change all of the commits in a
> single step… but I had to close the Neovim editor 287 times instead :)
> (I did a pause to check the docs and do some tests, but it seemed clear
> that there was no solution, so I finished the 287 manual non-editions…)
>
> I've found a second repo with ca. 90 commits without user email, so I
> prefered to ask, just in case.
>
>> What different behavior would you prefer?
>
> I've used the `metaedit` and `evolve` commands before, to fix some old
> wrong dates, and it worked great, it's impressive; but I never realized
> this limitation because I had to change only a few commits.
>
> The mandatory edition of the commit message makes it impossible to
> automatize the fixing of dates or users when the commit message needs no
> edition.
>
> A possible solution would be to write a shell program to extract all of
> the current messages and add them to `metaedit` with the `-m` option.
>
> I think a flag option meaning "no message edition required", say `-M`,
> would make `metaedit` more flexible without breaking the current default
> behaviour.

If you just want to change the user or date of the commit, there are 
separate flags for that. Namely, -u, -U, -d, and -D.

Have you not looked at the help? See below.

Regards, Faheem Mitha

######################################################################

hg help metaedit.

hg metaedit [OPTION]... [[-r] REV]...

edit commit information

     Edits the commit information for the specified revisions. By default,
     edits commit information for the working directory parent.

     With --fold, also folds multiple revisions into one if necessary. In 
this
     case, the given revisions must form a linear unbroken chain.

options ([+] can be repeated):

  -r --rev REV [+]  revision to edit
     --fold         also fold specified revisions into one
  -n --note TEXT    store a note on metaedit
  -m --message TEXT use text as commit message
  -l --logfile FILE read commit message from file
  -d --date DATE    record the specified date as commit date
  -u --user USER    record the specified user as committer
  -D --current-date record the current date as commit date
  -U --current-user record the current user as committer
     --mq           operate on patch repository

(some details hidden, use --verbose to show complete help)


> -- 
> Marcos Cruz
> http://programandala.net
> _______________________________________________
> Evolve-testers mailing list
> Evolve-testers at lists.mercurial-scm.org
> https://lists.mercurial-scm.org/mailman/listinfo/mercurial-evolve-testers
>
>


More information about the Evolve-testers mailing list