Difference between Mercurial Update and Retreat

What is the difference between these two teams (I want a rollback to revision 1):

hg update -r 1
hg backout -r 1 --merge

(in the prompt editor of example 3)

+5
source share
1 answer

To start, update -r 1 cancels revisions 2 and 3 in your working directory, while backout -r 1 -merge cancels revision 1, keeping versions 2 and 3. But there is a more fundamental difference:

updatechecks for an older revision in your working directory, while the backup creates a new one (but usually you should commit after the merge above). Try to run glogafter each of them to see the schedule of changes:

before:

0 - 1 - 2 - @3

after return:

0 - @1 - 2 - 3

upon return --merge; commit

0 - 1 - 2 - 3 - @5
     \- 4 - - - /

, , . 3 . , 5, , 1.

+11

All Articles