I've just gone and accidentally run hg revert *
. Does Mercurial come with a tool to move all the .orig
files back into place?
No. If you're in bash you can always do:
for thefile in *.orig ; do cp -v $thefile ${thefile%%.orig} ; done
This command will reinstate your .orig files from anywhere inside your repo:
find `hg root` -name *.orig -exec rename -f 's/.orig//' {} \;
You can add a hg alias for this in your .hgrc like so:
[alias]
reinstate= !find `$HG root` -name *.orig -exec rename -f 's/.orig//' {} \;
And then run it from your repo using this command:
hg reinstate
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