See Mercurial changeset summary/user/date - mercurial

Given a Mercurial changeset 123, how can yous see the summary, user, and date associated with the changeset? Figured there was an hg log option but couldn't see it..

you can also try Mercurial Templates to get just the output you're after. Several keywords are supported, but in your example this command would work:
hg log -r 123 --template '{author}\n{date}\n{desc}\n'

Have you tried hg log -r 123?

Related

Exclude files added/changed by a merge from hg status

I have a repository default and a branch mybranch. Now I want to use hg status to show files which were added/changed in my branch but exclude files which were added/changed by a merge from default.
I tried
hg status --rev "branch('mybranch') and not merge()"
but this still contains files added by a merge. For testing I also tried
hg log --rev "branch('mybranch') and not merge()"
which works as expected. What am I doing wrong?
This may only be a partial answer, but it might help.
Option --rev does different things for status and log commands.
For status:
--rev REV [+] show difference from revision
For log:
-r --rev REV [+] show the specified revision or revset
Note also that status does have an -r option but it is not a synonym for --rev.
So this at least explains why the two commands don't give you the results you expected.
Oddly, though the help page for status does not mention revsets, they do seem to be supported.

Mercurial reporting - Revision and file change report available?

I'm looking for a way to view all of a repository's branches and each file that has changed in that branch. I'm not interested in the file level changes as this report is for simple auditing.
Can this be done?
hg log -b <branchname> --template "{files} "
Plus some post-processing, because output will be like this
lang/UTF-8/serendipity_lang_ru.inc.php lang/UTF-8/serendipity_lang_ru.inc.php lang/UTF-8/serendipity_lang_ru.inc.php lang/UTF-8/serendipity_lang_ru.inc.php plugins/serendipity_event_assigncategories/UTF-8/lang_ru.inc.php plugins/serendipity_event_entryproperties/UTF-8/lang_ru.inc.php plugins/serendipity_event_freetag/UTF-8/lang_ru.inc.php plugins/serendipity_event_gravatar/UTF-8/lang_ru.inc.php plugins/serendipity_event_relatedlinks/UTF-8/lang_ru.inc.php plugins/serendipity_event_nl2br/UTF-8/lang_ru.inc.php plugins/serendipity_event_freetag/UTF-8/lang_ru.inc.php
Use hg status to get information about files that have changed between revisions. See the revset language for how to select the revisions.
If you want to see file changes between the first and last changesets on branch B:
$ hg status --rev "min(branch(B)):max(branch(B))"
You can even make an alias for this:
[alias]
audit = status --rev "min(branch($1)):max(branch($1))"
and then use hg audit B to get the same result.

Tag diffing in mercurial

In mercurial is there a way to diff between 2 different tags?
I have tagged my builds and have a couple commits in between builds and want to figure out the differences between the 2 builds.
hg diff -r tag1:tag2
That's all there is to it.
This answer in the Kiln StackExchange seems quite complete (based on hg diff and hg log):
To see all of the changesets that were introduced between, say, the tags v1.0 and v1.1, run:
hg log -r v1.0:v1.1
To see the net sum of differences introduced in those revisions, you'd instead run:
hg diff -r v1.0:v1.1
Mercurial can even format this output in changelog-style, if you want. Simply add the --style changelog parameter:
hg log -r v1.0:v1.1 --style changelog

Svnstat for Mercurial

Is there a utility for Mercurial which does something like svnstat does for subversion?
The maillist post found here summarizes a few possibilties to generate reports for mercurial repositories.
The mercurial activity extension mentioned there is under active development and looks promising.
You can get a text graph showing the differences between two revisions
hg diff -r REV -r REV --stat
So that:
hg diff -r 0 -r tip --stat
shows info across the whole repo, but only on a file by file basis.
Alternately there are the hg activity, hg chart, and hg churn extensions.

Mercurial - use hg log to view all ancestors

Given changesets
a
--b
----c
------d
--------e
How can I get a listing of all changesets that come before d. Ie: how can you use hg log to return a-b-c?
Use:
hg log -r "ancestors(d)"
This requires the revsets feature in Mercurial 1.7 and later. See hg help revsets for some great fun.
You can do hg log -r :d (but it will also display d).
hg log -r d::a
or
hg log -r a::d
This will require a reasonably recent (I believe 1.6 or later) version of Mercurial to work.