Get the list of files of the last N commits in Subversion

Can I get a list of files of the last N commits in Subversion?

I would like to run the image optimization task for files in a Subversion repository, and I don't want to run entire files.

+4
source share
3 answers

To get the last N commits, use the --limitor flag -lin svn log. Alternatively, you can also limit journal entries to revision number and / or date.

To change files, you need to use the flag -v(or --verbose).

To suppress the text of the log, you need to use the flag -q(or --quiet).

, () , 2014 ( ), :

svn log --quiet --verbose --revision {2014-05-01}:HEAD
svn log -q -v -r {2014-05-01}:HEAD

10 , , :

svn log --quiet --verbose --limit 10
svn log -q -v -l 10
+3

Subversion, .

:

  • (), , . , , . , .

  • , , .

  • , ? ?

, , script. svn log --xml XML. :

$ svn log -v --xml $REPO

<?xml version="1.0" encoding="UTF-8"?>
<log>
<logentry
    revision=...>
<author>...</author>
<date>...</date>
<paths>
<path
   ....
   ....
   action=".">...name of file...</path>
<path ...
</paths>
<msg>.....</msg>
</logentry>
<logentry
   ....
   ....

XML, XML . <logentry, . <path, element, and when you see the closing > , you know that the rest of the line till the `- . -, .

A script Python Perl .

+1

"", , , Windows, PowerShell ( "n" "99" " ):

PS> Get-SvnLog |
Select -First 99 -ExpandProperty Paths |
% { ([xml]$_).SelectNodes("//path/text()").Value } |
Sort -Unique

API Get-SvnLog , 20 , . "PowerShell" SvnTools. .

+1

Source: https://habr.com/ru/post/1544259/


All Articles