Mercury equivalent of git whatchanged?

I want to get a similar output from the Git command:

$ git whatchanged <old_rev>..<new_rev> --pretty=oneline --name-status 

I read that hg outgoing might help, but on the help page it has nothing to do with versions:

$ hg diff <old_rev>..<new_rev> gave differences, but the output is:

 diff -r d3ed0d3eb928 -r 63329069147f hello.rb --- a/hello.rb Tue Jul 31 16:52:40 2012 +0530 +++ b/hello.rb Wed Aug 01 11:15:33 2012 +0530 @@ -1,1 +1,1 @@ -print "Hello" +print "Hello World" 

while I need something similar to:

 bb3b9a6bc00b7203ab6491dbd062641fa60efb95 Fix for #4 and other small errors M .gitignore A config.ru D db/database.db M views/setup.haml 1c4ff29e5c7fc707c6fe314c060cd1935b300dd9 Added keyboard shortcuts and reload M README.md A public/javascript/keys.js d0755d0b54cb4129fbf7730fe0bdf21a3996e224 Basic player completed M README.md D public/javascript/jquery-ui-1.8.21.custom.min.js ... 

which I get with git whatchanged 1c4ff29e5c7fc707c6fe314c060cd1935b300dd9 bb3b9a6bc00b7203ab6491dbd062641fa60efb95 --pretty=oneline --name-status

+4
source share
3 answers

You can try the changelog style. Of course, it does not look exactly the same, but it lists the files that were affected by the commit, which, in my opinion, is what you are looking for. Examples:

 hg log --style changelog hg outgoing --style changelog 

And as the Christian said, you can set the exact output to infinity using templates. See hg help templating for more information.

+2
source

You can use hg log to do this and customize the output with a template .

Example:

 hg log -r <old_rev>:<new_rev> --template "{node} {desc}\n{files}\n\n" 

This will be similar to your Git example.
The list of files does not look the same though (no line breaks).

I have never tried this myself, but you can also customize the output using styles (similar to templates, but you save the style in a file and just reference it by name). <w> The documentation for this is located at the same link that I posted above at the bottom of the page.
Apparently, you can put line breaks between files (an example for this is on the page).

+1
source

If you are looking for a way to get which files have been changed, but you are not too worried that formatting is similar to git, then I really like the diffstat switch to any of the commands that usually print diffs.

 # hg in --stat # hg out --stat # hg diff -r <old_rev>:<new_rev> --stat ... and a load more 

This is not quite the same. This is not a set of changes, and it does not say whether the file is added / modified / deleted, but, on the other hand, it gives some idea of โ€‹โ€‹the degree of change.

+1
source

All Articles