tags:

views:

589

answers:

2

I didn't set the username on my development computer and made a few commits. Can I retroactively change the username so it's clear who committed these changesets?

+1  A: 

Check out the following document. There are quite a few downsides to rewriting the history which are covered in the document, so it's typically frowned upon. However, it looks to be possible.

Dave K
+12  A: 

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 :).

Andrew Aylett
Very nice and complete answer.
Martin Geisler