On Tue, Sep 27, 2011 at 06:26:52PM -0500, Shiyuan wrote:
> Hi,
> My repository looks like r0-r1-r2-r3, workdir, I want to start again
> from r1 but still want r2, r3 in my repos, Is there an easy way to do that?
> I am still using hg version 1.4.3, and I look at the command backout and
> follow the example in the Mercurial Book,
> http://hgbook.red-bean.com/read/finding-and-fixing-mistakes.html, however,
> I get different behavior,, that is what I did,
If I understood what you want to do, you don't really need to back out
anything. Backout would work more like an "undo" action (that would be recorded
in the repository's history). If you want to create another line of
development, you can do so by just updating to the desired revision and
commiting your changes like:
$ hg up -r 1
# Make the changes you want to make
$ hg commit -m 'decided to start all over again.'
And that's pretty much it. The just commited changeset will become the tip and
you can continue development from there.
Your graph history would be something like this now:
$ hg commit a -m 'decided to start all over again.'
created new head
$ hg glog
@ changeset: 3:c68dd6b55cd8
| tag: tip
| parent: 1:f6e35b1dcab0
| user: Renato Cunha
| date: Tue Sep 27 21:59:37 2011 -0300
| summary: decided to start all over again.
|
| o changeset: 2:91649f9b434b
|/ user: Renato Cunha
| date: Tue Sep 27 21:57:56 2011 -0300
| summary: some other stuff
|
o changeset: 1:f6e35b1dcab0
| user: Renato Cunha
| date: Tue Sep 27 21:57:25 2011 -0300
| summary: added some content
|
o changeset: 0:f60cb12a29d2
user: Renato Cunha
date: Tue Sep 27 21:56:55 2011 -0300
summary: created a
If you have ever used subversion, it might be instructing to take a look at
Joel's list of conceptual differences between subversion and mercurial at
http://hginit.com/00.html.
> However, in the FAQ,
> "http://mercurial.selenic.com/wiki/FAQ#FAQ.2BAC8-CommonProblems.I_want_to_retrieve_an_old_version_of_my_project.2C_what_do_I_do.3FMerged"
> hg revert is not advisable for retrieving old revision. What's the
> problem? Is what revert does is changing the content of files back to a
> certain version and the effect is just like manually editing the files?
That's what the FAQ entry said. If you want to retrieve an old revision, just
update to it. "Because revert does not change the working directory parents,
this will cause these files to appear modified." (Excerpt from "hg help
revert".)
Regards,
--
Renato Cunha
_______________________________________________
Mercurial mailing list
Merc...@selenic.com
http://selenic.com/mailman/listinfo/mercurial
I think you want:
hg update -r r1
<hack>
hg commit
This creates a new changeset on top of r1. The old r2 and r3 stay in the
repository, but are no longer used.
Best regards
Andreas
--
("`-''-/").___..--''"`-._
`o_ o ) `-. ( ).`-.__.`)
(_Y_.)' ._ ) `._ `. ``-..-'
_..`--'_..-_/ /--'_.' .'
(il).-'' (li).' ((!.-'
Andreas Tscharner an...@vis.ethz.ch ICQ-No. 14356454