Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
189 views
in Technique[技术] by (71.8m points)

git - Examining a changeset in HG

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 gives the changeset metadata and the diff as well.

question from:https://stackoverflow.com/questions/1312633/examining-a-changeset-in-hg

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Your question has two parts. First, how to get the metadata and diff for a changeset all at once:

hg log --patch --rev tip

You can shorten the options:

hg log -pr tip

The second part of the question is how to say "the parent changeset of X" without looking it up. For that you can use the parentrevspec extension Martin mentioned.

Once you enable the extension you can do:

hg log -pr tip^

You could add an alias to your ~/.hgrc file if you don't want to retrain your fingers from git's command:

[alias]
show = log -pr

Then you could use:

hg show tip^

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...