Reputation: 11863
My only guess is something horrible like this:
# files where something has been added
hg diff -r AA -r BB|grep -- +++|cut -f1|cut -d/ -f2- >/tmp/ka
# files where something has been removed
hg diff -r AA -r BB|grep -- ---|cut -f1|cut -d/ -f2- >>/tmp/ka
# filtering out "dev/null": it appears when a file is added or removed from the repository
sort -u /tmp/ka |grep -v dev/null
What I need is the files modified between changeset AA and changeset BB. Something like hg diff -r AA -r BB
but file names only, instead of a whole diff.
Maybe there's a mercurial command I didn't notice? The changesets I want to examine are not consecutive, otherwise I could have just used hg status
.
Upvotes: 16
Views: 27197
Reputation: 13048
You can do something similar to hg stat
in Tortoise Workbench.
The simplest / most built-in way is:
This will produce a window similar to the following example:
(Then just click the [X]).
This screen may have limited use however... for instance you can't readily export it, other than taking a screenshot. You can copy/paste the text of individual lines one-by-one, however.
An alternate way which produces a useful text output is to automate the use of hg stat
right from THG Workbench, by adding a custom tool.
Now when you run that tool, you'll automatically get the results in the log pane. You can select a single or multiple changesets and it will compare them accordingly.
Note - alternately you can configure this in the settings file by adding:
[tortoisehg-tools]
filecomp.command = hg stat --rev {REVID}
filecomp.enable = istrue
filecomp.label = FILECOMP
filecomp.showoutput = True
The macro {REVID}
will expand to text like 33a6bd983eab
if you selected one changeset in the list, or like 33a6bd983eab+a41898ae15c4
if you selected two, etc.
In this method you can actually select > 2 changesets and it will report on the combined differences among them.
Also just to note there is an alternate syntax for stat
to get a listing of what file differences exist between any two changesets which I don't think was mentioned in the other answers:
hg stat --rev A --rev B
where A
and B
are the changeset IDs (which look like 1c845eefe22e
).
(You could also use the revision number like 12345 in place of the changeset ID, but be aware that these are not permanent values unlike the IDs).
A
and B
could be on any two branches, or the same branch, it doesn't matter, as long as both exist in the local clone you are working with.
Upvotes: 0
Reputation: 73798
The basic command to look for when you want to know something about file status is hg status
. The status command is the file name oriented command and you want to know some file names.
When you run it as
$ hg status
then it compares the working copy state with the working copy parent revision (.
). But if you run it as
$ hg status --rev AA:BB
then it will show files modified between AA
and BB
! No need for grepping, cutting, sorting or templates.
(I've explained this before here, here, and here, please see those questions and answers for more tips.)
Upvotes: 8
Reputation: 97365
Solution one. Diff-based
>hg diff -r 3 -r 4 --stat
comments.php | 14 +++-----------
functions.php | 15 +++++++++++++--
header.php | 2 +-
readme.txt | 17 ++++++++++++++---
sidebar.php | 43 ++++---------------------------------------
style.css | 18 ++++++++++++------
6 files changed, 47 insertions(+), 62 deletions(-)
you can get changed files by grepping on "|" char, or (better and nicer approach from my POV) pipe output to gawk, which, for record with exactly 4 fields, print $1
Solution two. Log + templating + revsets
>hg log -r "3::4" --template "{file_mods}\n"
footer.php functions.php header.php search.php style.css
comments.php functions.php header.php readme.txt sidebar.php style.css
convert to list, remove (possible) duplicates I'll leave for you
Upvotes: 0