In Mercurial, what is the exact step that Peter or me has to do so that he gets back the rolled back

Posted by Jian Lin on Stack Overflow See other posts from Stack Overflow or by Jian Lin
Published on 2010-06-14T05:03:45Z Indexed on 2010/06/14 5:12 UTC
Read the original article Hit count: 490

Filed under:
|
|

The short question is: if I hg rollback, how does Peter get my rolled back version if he cloned from me? What are the exact steps he or me has to do or type?

This is related to http://stackoverflow.com/questions/3034793/in-mercurial-when-peter-hg-clone-me-and-i-commit-and-he-pull-and-update-he-g

The details:

After the following steps, Mary has 7 and Peter has 11. My repository is 7 What are the exact steps Peter or me has to do or type SO THAT PETER GETS 7 back?

F:\>mkdir hgme

F:\>cd hgme

F:\hgme>hg init

F:\hgme>echo the code is 7 > code.txt

F:\hgme>hg add code.txt

F:\hgme>hg commit -m "this is version 1"

F:\hgme>cd ..

F:\>hg clone hgme hgpeter
updating to branch default
1 files updated, 0 files merged, 0 files removed, 0 files unresolved

F:\>cd hgpeter

F:\hgpeter>type code.txt
the code is 7

F:\hgpeter>cd ..

F:\>cd hgme

F:\hgme>notepad code.txt   [now i change 7 to 11]

F:\hgme>hg commit -m "this is version 2"

F:\hgme>cd ..

F:\>cd hgpeter

F:\hgpeter>hg pull
pulling from f:\hgme
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
(run 'hg update' to get a working copy)

F:\hgpeter>hg update
1 files updated, 0 files merged, 0 files removed, 0 files unresolved

F:\hgpeter>type code.txt
the code is 11


F:\hgpeter>cd ..

F:\>cd hgme

F:\hgme>hg rollback
rolling back last transaction

F:\hgme>cd ..

F:\>hg clone hgme hgmary
updating to branch default
1 files updated, 0 files merged, 0 files removed, 0 files unresolved

F:\>cd hgmary

F:\hgmary>type code.txt
the code is 7

F:\hgmary>cd ..

F:\>cd hgpeter

F:\hgpeter>hg pull
pulling from f:\hgme
searching for changes
no changes found

F:\hgpeter>hg update
0 files updated, 0 files merged, 0 files removed, 0 files unresolved

F:\hgpeter>type code.txt
the code is 11


F:\hgpeter>

© Stack Overflow or respective owner

Related posts about mercurial

Related posts about dvcs