1

I would like to batch-edit a number of commits to automatically make modifications to author and commit message (being able to apply a few regular expressions would be fine).

I am aware that this is rewriting history, will cause trouble if there are clones, and will change commit ids.

What's the best way to do that?

Nikratio
  • 389

2 Answers2

2
  1. Most easily automated way: MQ

In short:

  • qimport -r REV
  • qrefresh (-u for user, -m|-l for commit message)
  • qfinish+qdelete

with (probably) restoring the correct order of changesets (can't recall where qfinished cset will appear in DAG)

  1. Two-steps (with tricks and limitations) way
Lazy Badger
  • 3,694
1

Use hg export -g -o <outfile>, process outfile with whatever tool you like, and re-import with hg import <outfile>.

Nikratio
  • 389