Examining a changeset in HG

前端 未结 5 1882
执念已碎
执念已碎 2020-12-24 06:08

How can I examine a changeset in mercurial without looking up its parent? In mercurial, what\'s the equivalent of

git show HEAD^

Git-show

5条回答
  •  半阙折子戏
    2020-12-24 06:24

    A similar command to "git show HEAD^" would be:

    hg log -pr -2   # -1 (last commit), -2 - one before it, etc.
    

    OR

    hg exp tip^  # tip^ is similar to -r -2
    

    or for instance if you want to look at the last 3 commits (with diff):

    hg log -pr -3:  # colon means start 3 commits behind and up to tip inclusive
    

    A bit to late with the answer, but still. :)

    UPDATE: apparently now HG supports git syntax as well:

    hg exp tip^^^..tip
    

    or

    hg log -pr tip~4
    

提交回复
热议问题