Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
restart from an old revision.
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Shiyuan  
View profile  
 More options Sep 27 2011, 7:26 pm
From: Shiyuan <gshy2...@gmail.com>
Date: Tue, 27 Sep 2011 18:26:52 -0500
Local: Tues, Sep 27 2011 7:26 pm
Subject: restart from an old revision.

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,

>>hg init testhg
>>cd testhg
>>echo first change >> a;
>>hg add a ;
>>hg ci -m "first"
>>echo second change >> a;
>>hg ci -m "second"
>>echo third change >> a; cat a; hg ci -m "third"
>>hg backout 1 --merge

instead of geting
>>cat a

first change
third change
as in the book,
I got a conflict
===============================
reverting a
created new head
changeset 3:aa3afab03e79 backs out changeset 1:c3ec16461c36
merging with changeset 3:aa3afab03e79
merging a
warning: conflicts during merge.
merging a failed!
0 files updated, 0 files merged, 0 files removed, 1 files unresolved
use 'hg resolve' to retry unresolved file merges or 'hg update -C' to
abandon
=======================================================

Even if merge failed, it changed the content of the file

>>cat a

first change
<<<<<<< local
second change
third change
=======
>>>>>>> other

=========================================================
If I just want to restart from r1(but still keep r2,r3 in the repos), in
this simple case, I can do
>> hg revert -a -r 0
>> hg resolve -a -m
>> hg ci -m

However, in the FAQ,
"http://mercurial.selenic.com/wiki/FAQ#FAQ.2BAC8-CommonProblems.I_want..."
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?
Thanks.

_______________________________________________
Mercurial mailing list
Mercur...@selenic.com
http://selenic.com/mailman/listinfo/mercurial


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Renato Cunha  
View profile  
 More options Sep 27 2011, 9:35 pm
From: Renato Cunha <ren...@renatocunha.com>
Date: Tue, 27 Sep 2011 22:35:19 -0300
Local: Tues, Sep 27 2011 9:35 pm
Subject: Re: restart from an old revision.
Hello,

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..."
> 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
Mercur...@selenic.com
http://selenic.com/mailman/listinfo/mercurial


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andreas Tscharner  
View profile  
 More options Sep 28 2011, 7:11 am
From: Andreas Tscharner <a...@vis.ethz.ch>
Date: Wed, 28 Sep 2011 13:11:13 +0200
Local: Wed, Sep 28 2011 7:11 am
Subject: Re: restart from an old revision.
On 28.09.2011 01:26, 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

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   a...@vis.ethz.ch   ICQ-No. 14356454
_______________________________________________
Mercurial mailing list
Mercur...@selenic.com
http://selenic.com/mailman/listinfo/mercurial


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »