What`s the difference between this 2 commands (i want to rollback to revision 1):
hg update -r 1
hg backout -r 1 --merge
(in the example tip revision is 3)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To start with, update -r 1 will undo revisions 2 and 3 in your working directory, whereas backout -r 1 –merge will undo revision 1, while keeping revisions 2 and 3. But there’s a more fundamental difference:
updatechecks out an older revision in your working directory, whereas backout creates a new one (but normally you’d commit after the merge above). Try runningglogafter each of those to look at the revision graph:before:
after revert:
after backout –merge; commit
Because revert only affects the working directory, it is invisible to any user that clones your repository. They will end up at 3 before and after revert. Whereas after backout, they will end up at 5, which does not have the changes done by 1.