Can I change the username on a mercurial changeset?

If you’ve not published your repository then this shouldn’t be too hard. You need to use the Convert extension to Mercurial, which will let you ‘filter’ your existing repository to create a new one. the –authors switch lets you edit the author for each commit as it is filtered.

If you have published your repository, please consider the impact on your users, the mercurial wiki has some reasons not to edit history.

Enable the extension by adding these lines to your .hgrc:

[extensions]
hgext.convert=

Write a file to map the old name to the new name (authors.convert.list):

user@[email protected]

Run the conversion:

hg convert --authors authors.convert.list SOURCE DEST

I just checked it, it works for me :).

Leave a Comment