Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 850849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:19:58+00:00 2026-05-15T07:19:58+00:00

The short question is: if I hg rollback , how does Peter get my

  • 0

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 In Mercurial, when Peter "hg clone" me, and I commit and he pull and update, he gets my version, but not when I rollback?

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:\>hg init hgme
F:\>cd hgme
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:\>type hgpeter\code.txt
the code is 7
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 ..\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 ..\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:\>type hgmary\code.txt
the code is 7
F:\>cd hgpeter
F:\hgpeter>hg pull
pulling from f:\hgme
searching for changes
no changes found
F:\hgpeter>type code.txt
the code is 11

What are the exact steps Peter or me has to do or type SO THAT PETER GETS 7 back? There should be some steps that Peter can do to get the “current state” of my repository since he cloned from me. I shouldn’t need to knock on his front door to tell him, “hey, you need to rollback” or whatever.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T07:19:59+00:00Added an answer on May 15, 2026 at 7:19 am

    If someone has already pulled your changes (which is the case you’re describing), a rollback isn’t appropriate.

    From hg manual:

    This command is not intended for use
    on public repositories. Once changes
    are visible for pull by other users,
    rolling a transaction back locally is
    ineffective (someone else may already
    have pulled the changes). Furthermore,
    a race is possible with readers of the
    repository; for example an in-progress
    pull from the repository may fail if a
    rollback is performed.

    What you should do is hg backout the changeset, then tell Peter to pull.

    If you insist on rolling back, you could tell Peter to reclone the repository, but I wouldn’t recommend working this way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.