Fixing commit author with broken character encoding

Matt Harbison mharbison72 at gmail.com
Sat May 4 01:39:56 UTC 2019


On Thu, 02 May 2019 10:02:34 -0400, Gregor Mückl  
<gmueckl at gregor-mueckl.de> wrote:

> Hi!
>
> I have a repository with a commit that I apparently made with a  
> misconfigured mercurial instance. Specificially, my author string seems  
> to have been broken so that my last name was mangled into something that  
> seems to be utterly broken. I can't tell you what the string in the  
> commit looks like because I cannot reconstruct how different clients try  
> to convert it before displaying it...
>
> So, whatever I try to match that particular author name in an authormap  
> file for hg convert, I can't get it to match because I don't know (a)  
> what the actually stored internal string looks like and (b) how to  
> reconstruct it so that hg can match it.
>
> Is there a way to get hg convert to do a fuzzy match or pattern match  
> for author names? Is there at least a way to get hg to dump the log or  
> anything else containing the raw author string *without* any potential  
> encoding conversion?
>
> Regards
> Gregor Mückl

The sledgehammer approach would be to write a tiny convert extension[1]  
that hard-codes the hash of the changeset you want to modify, and stuffs  
the name you want into the commit object before writing it to the  
destination repo.

[1] https://www.mercurial-scm.org/wiki/ConvertExtension#Customization



More information about the Mercurial mailing list