Better way to set the parent to an ancestor change set and get the content of the tip
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. :)
加载中,请稍侯......
精彩评论