`hg rewind` not working as expected

Faheem Mitha faheem at faheem.info
Mon May 6 18:04:10 UTC 2019


On Mon, 6 May 2019, Faheem Mitha wrote:

>
> Hi folks,
>
> I'm not sure if this is a bug, so writing here first.

I thought this might have something to do with topics, but apparently not, 
since if I comment out the topic line, I get the same behavior.

This is all quite strange. Either I'm really misunderstanding what rewind 
does, or I've hit some kind of corner case. Though my example seems 
completely ordinary. Clarifications would be much appreciated. Thanks in 
advance.

Regards, Faheem Mitha

> Consider the following script. As you can see, `hg rewind` does nothing here. 
> This is a simple case, so I'm wondering if it is user error.
>
> `hg help rewind` says
>
>    By default, we rewind from the working copy parents, restoring its
>    predecessor.
>
> Comments/clarifications/corrections appreciated. I can post a bug report if 
> necessary - let me know. Thanks.
>
> Regards, Faheem Mitha
>
> ########################################################################
>
> rm -rf rewind
> hg init rewind
> cd rewind
> touch a
> hg add a
> hg ci -m "Add a"
> hg topics foo
> touch b
> hg add b
> hg ci -m "Add b"
> touch c
> hg add c
> hg ci -m "Add c"
> hg parents # parents is 2
> hg log -vG --hidden
> hg rewind # abort: no revision to rewind to
> hg rewind --to 1 # rewinded to 0 changesets
> hg log -vG --hidden
>



More information about the Evolve-testers mailing list