Mercurial - all files that have been changed in a change set?

How can you identify all files that have been modified in a given set of changes?

I am not looking for diff in this case, just a list of additions / deletions / modifications.

hg log -vprX contains a list of differences, but I just want the files.

+74
mercurial diff changeset
Sep 24 '10 at 17:15
source share
6 answers

If you want to list only files that have been changed, you should use the "status" command. The following are the changes to the files in the REV version

 hg status --change REV 
+119
Sep 24 '10 at 17:27
source share
— -

Just remove p from your hg log -vpr showing a list of files. -p means patch. You can also use the template to format the output to your liking.

+13
Sep 24 '10 at 18:44
source share

I know that the question is about one set of changes, but if you want all the files to be changed for a series of changes, you can do

 hg status --rev 1 --rev 10 -m 
+8
Oct 31 '12 at 20:15
source share

Found this question through Googling for a similar concept. To show all files that have been modified using a series of change sets, this is simple:

 hg log -r [start rev]:[end rev] --template "{file_mods}{file_adds}\n" | sed -e 's/ /\n/g' | sort -d | uniq 
  • hg log -r [start rev]:[end rev] --template "{file_mods}{file_adds}\n" will show you a list of each file that has been changed or added to each change set, from [start rev] to [ end rev], with each change set file on a new line. Swap {file_mods}{file_adds} using {files} to show all files modified, added or deleted.
  • sed -e 's/ /\n/g' will split all the files into separate lines and
  • sort will, er, sort the list for you so we can filter the list with uniq
  • uniq will filter the list to remove duplicate files that have been modified in more than one version.
+1
Nov 01 '14 at 20:16
source share

If you are like most stores, you use a ticket system to track changes. If you know the ticket number and want to find all the commits associated with this ticket (provided that you include the ticket number in the commit message), you can use:

 hg log -k TICKET_NUMBER 

This displays all changes associated with the ticket. However, it does not list files. You can use one of the answers above to get a list of files related to the changes.

To simplify the work by combining information from previous answers, you can perform the following steps to find commits, including modified files:

 hg log -vk TICKET_NUMBER 
0
Jul 21 '15 at 14:33
source share

I know this question is an old question, and I am surprised that no one has offered a modified form of OP code. I got a list of files with modified / added / deleted files (not marked as this) by simply running hg log -v . Or that I really need hg log -v -l5 to see files that have been changed / added / deleted in the last 5 commits (including those that I haven't clicked on the repo yet).

0
Dec 21 '16 at 2:39 on
source share



All Articles