I have a Mercurial (hg) repository with commit data that has wrong (malformed) e-mail address attached to all commits I have pushed. I have direct access to that repository files on the remote server (via ssh). Is there any way I can directly modify the repository files to correct every instance of that malformed e-mail in the commit history?
I have a Mercurial (hg) repository with commit data that has wrong (malformed) e-mail
Share
You cannot do this without rewriting history. Every changeset ID in a Mercurial repository is a cryptographic hash computed from the changeset data. Essentially, changing the email address as just the same as changing contents of one of the files — in every affected changeset.
Do you really need to fix that email? If you do that by rewriting history, you’ll end up having something which is essentially a new repository. Your fellow developer will have to abandon his copies of the rep in favor of the re-created one.
To do the actual conversion, the built-in
convertextension with the--authorsmap should help you, I believe. It will create a copy of the repository with fixed author names.