I made a few commits, but I realised later on that I haven't had my username setup properly. I changed it and made a few more commits with the right username. Is there any way to change the first commits to use the new username before pushing all of them?
Here's how I would accomplish your goal, it relies on mq extension, Mercurial's patch queue. (Updated to include @MarkTolonen's fantastic comment!)
Step 0. Back up your work! (you can create a local throw-away clone to try this out)
mq extension in your config files (see help here)hg qimport to import into the patch queue the changesets you want to edithg qpop -a to pull those patches off the applied patch stackhg qpush hg qref -U to update the patch's author to the current user (or use hg qref -u <username> to set it explicityly)hg qfin -a to finalize the patches into changesetsMy original steps included manually setting the user in a text editor, which were in place of steps 4-6 above:
A. open the folder .hg\patches, you should have a ###.diff file for each changeset
B. open those in the text editor of your choice
C. edit the line at the top that starts with # User <your old user name>
and update it to be # User <your new user name>
D. save the patches
E. use hg push -a to push them back onto the applied stack
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With