hg 0.9.3: pull, revert to pre-merged version, pull expected behavior?
allan_wind at lifeintegrity.com
Thu Apr 26 13:43:26 CDT 2007
On 2007-04-26T11:06:16-0500, Matt Mackall wrote:
> On Thu, Apr 26, 2007 at 08:43:05AM -0400, Allan Wind wrote:
> > So if I cannot pull the changes in (because they were already merged
> > into this branch), then how do I get those changes? diff/patch?
> You're still not Understanding Mercurial.
Fair enough given that my experience with hg started last night night
with a review of the website, mail archives and bug tracking system then
working through the tutorial. I will humbly point out that:
does not explain how pull/merge interact with the store/repository and
the working directory.
> A repository is a collection of changesets, usually coupled with a
> working directory. Push and pull syncronize changesets between
> repositories with -no effect on your working directory-. So when you
> did the first pull, you got all those changesets into your local
> repository. You can see them with hg log and hg heads. There's no need
> to pull them again.
> Merge brings changes from other parts of the repository into your
> working directory with -no effect on your repository-.
Thanks for your explanation. I am afraid that I am not able to phrase
the question in a way that will elicit an answer. Perhaps an example
$ hg clone http://www.selenic.com/repo/hello my-hello
$ cd !:3
$ sed 's/world/world2/' hello.c > hello.c.tmp && mv hello.c.tmp hello.c
$ hg commit -m '2'
Now I want tip to contain the working directory we had in 1:
$ hg update 1
$ hg commit -m 'back to 1'
And the solution that I proposed was (continued from above):
$ hg update
$ hg diff -r2 -r1 | patch
$ hg commit -m 'make working directory contain same data as 1'
More information about the Mercurial