The best way I found was:
hg update -r0 -C #ancestor rev 0
hg revert -r tip --all
To illustrate the situation a bit:
hg init
echo "init" > a.txt
hg commit -A -m“init” a.txt #rev 0
echo "hello" > a.txt
hg commit -m"change"
hg update -r0 -C
hg revert -r tip --all
The interestin开发者_StackOverflow社区g properties are hg diff -r tip is empty and hg parent is changeset: 0.
You can do that like this, but don't tell anyone:
hg debugsetparent 0
you might need to also do hg debugrebuildstate for the hg stat command to realize you pulled a switcharoo on it.
You didn't hear it from me though. :)
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论