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 867395
In Process

The Archive Base Latest Questions

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

That is, in Mercurial, if Peter cloned from me by hg clone c:\mycode e:\code

  • 0

That is, in Mercurial, if Peter cloned from me by

hg clone c:\mycode e:\code

into his e:\code

let’s say there is a file code.txt and it contains the text the code is 7

Now, when I change it to the code is 11 and hg commit, then he can get my code using hg pull and hg update. Now his version says the code is 11

But if I decide the change was wrong and hg rollback, then my repository should have the 7 version, while the working directory should have the 11 version.

So when Peter does an hg pull and hg update, he should be sync’ed up to my current repository, which is the 7, but I found that it is not the case — he still gets the 11 version. Why is that? Can he get the rolled back code (the 7)? Does Git behave the same way too?

Update: I thought commit affects the repository the same way that rollback affects the repository — commit and rollback are both DB transaction words… and now we are saying commit affects the repository but rollback doesn’t? What’s the rule here?

Update 2: At this point, if Mary does an

hg clone c:\mycode e:\marycode

at this point, she actually gets the 7 version. So, Mary gets 7. Peter gets 11. And they are both “up to date”? What is this?

  • 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-15T09:58:07+00:00Added an answer on May 15, 2026 at 9:58 am

    hg pull pulls down new changesets from a remote repository – but it doesn’t delete ones that don’t exist remotely. Otherwise, doing a pull would erase any of your own work that hadn’t already be pushed to the remote. Thus, pull doesn’t get rid of a changeset that was pulled, and then the remote rolled it back, because there’s no new changeset to grab.

    If you make a new commit which has the rolled-back state, then that commit will get pulled down and Peter will see it.

    In other words, what you need to do is first use hg revert -r <previous-rev> to check out an earlier version that you want to change back to, then use hg commit to create a new commit based on the older revision, and then have people pull that commit.

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

Sidebar

Related Questions

I have a largish Mercurial repository that I've decided would be better as several
When using Mercurial I sometimes find that it is hard to understand the relationship
I'm just starting with Mercurial and one of the things that I should do
I've heard that many of the distributed VCSs (git, mercurial, etc) are better at
That's basically the question, is there a right way to implement operator<< ? Reading
I'm seeing that mercurial efficiently compresses the files in repository (repo/.hg/store/data) Does anybody know
I know that Mercurial can track renames of files, but how do I get
I've seen it mentioned that mercurial stores the executable bit on files, but cannot
I've seen a number of blog posts, and have experienced for myself, that Mercurial
I'm looking at the mercurial handbook, chapter 6 Working with multiple branches. In there

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.