Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mercurial commandline: How to show changes of a specific revision?

Tags:

mercurial

After I pull a new head into my repository, I want to see what files are touched by the new head. Like an hg status but without changing over to it. I don't want the whole diff, just an overview.

Which I expect is a specific version of the more general question: how do i see a summary of the changes in a specific revision?

This is on the commandline, I don't want to fire up TortoiseHG or some other GUI.

like image 748
John Mee Avatar asked Jan 25 '11 00:01

John Mee


People also ask

What hg command shows a list of changed files?

If you are using the terminal in windows add hg status --rev x:y > your-file. txt to save the list to a file. To only see changes in the current directory: hg status --rev x:y .

What does hg commit do?

Use the command hg update to switch to an existing branch. Use hg commit --close-branch to mark this branch head as closed. When all heads of a branch are closed, the branch will be considered closed.

What does hg update do?

Update sets the working directory's parent revision to the specified changeset (see hg help parents). If the changeset is not a descendant or ancestor of the working directory's parent and there are uncommitted changes, the update is aborted.

How do I revert a commit in Mercurial?

If you want to revert just the latest commit use: hg strip --keep -r . Using strip will revert the state of your files to the specified commit but you will have them as pending changes, so you can apply them together with your file to a new commit.


1 Answers

The status command shows you which files are changed. Use

hg status --rev .:tip

to compare the working copy parent revision (the currently checked out revision) with the tip revision.

If you've pulled more than one changeset, then this is different from

hg status --change tip

That command only shows the files touched by the tip changeset — not the combined changes between the currently checked out changeset (.) and tip.

like image 91
Martin Geisler Avatar answered Oct 19 '22 03:10

Martin Geisler