Svn 为一组修订更改文件

Svn 为一组修订更改文件,svn,Svn,如何在SVN中获得一组修订版中更改的所有文件的列表 例如,假设我有如下更改日志: Change 1 - File 1 changed Change 2 - File 2 changed Change 3 - Some other stuff I don't care about changed Change 4 - File 3 changed Author Rev Date Action Path ------ ---- ----

如何在SVN中获得一组修订版中更改的所有文件的列表

例如,假设我有如下更改日志:

Change 1 - File 1 changed
Change 2 - File 2 changed
Change 3 - Some other stuff I don't care about changed
Change 4 - File 3 changed
Author Rev  Date                   Action Path
------ ---- ----                   ------ ----
ms     1478 8/11/2013 4:00:05 PM   M      /trunk/profile/profile_scripts/NextIT_AgentManifest.ps1
ms     1478 8/11/2013 4:00:05 PM   M      /trunk/profile/profile_scripts/MsBuildTargets.ps1
ms     1478 8/11/2013 4:00:05 PM   M      /trunk/profile/profile_scripts/VsCommandPrompt.ps1
ms     1478 8/11/2013 4:00:05 PM   M      /trunk/profile/profile_scripts/EventLogByTime.ps1
ms     1478 8/11/2013 4:00:05 PM   M      /trunk/profile/profile_scripts/EventLogTail.ps1
ms     1479 8/11/2013 4:02:48 PM   M      /trunk/profile/Microsoft.PowerShell_profile.ps1
ms     1480 8/12/2013 7:45:59 PM   M      /trunk/CleanCode/FileTools/GetChildItemExtension.ps1
ms     1481 10/13/2013 1:05:04 AM  M      /trunk/scripts/SystemInfo.ps1
ms     1482 10/13/2013 1:05:51 AM  M      /trunk/CleanCode/DocTreeGenerator/DocTreeGenerator.psm1
ms     1482 10/13/2013 1:05:51 AM  M      /trunk/scripts/MeasureSimpleTalkArticles.ps1
ms     1483 10/13/2013 4:56:47 PM  M      /trunk/CleanCode/FileTools/Select-StringAligned.ps1
ms     1484 11/15/2013 10:46:15 AM M      /trunk/scripts/SystemInfo.ps1
ms     1484 11/15/2013 10:46:15 AM M      /trunk/scripts/RunSystemInfo.ps1
ms     1486 11/19/2013 9:07:59 PM  M      /trunk/CleanCode/DocTreeGenerator/DocTreeGenerator.psd1
我希望输出为:

File 1
File 2
File 3
我该怎么做


编辑:为了澄清,我希望在变更集1、2和4中更改文件,但不包括3个。

svn diff--summary-r START:END将列出在该范围内更改的所有唯一路径。

如果您在Windows上,可以使用我的一个开源库中的Get-SvnLog PowerShell cmdlet轻松完成此操作。首先考虑@ AlROC显示的命令:

svn diff --summarize -r START:END
正好映射到此PowerShell等效项:

Get-SvnLog -ByFile -RevisionRange START:END
但是现在您已经将输出作为.NET对象。该命令的输出可能如下所示:

Change 1 - File 1 changed
Change 2 - File 2 changed
Change 3 - Some other stuff I don't care about changed
Change 4 - File 3 changed
Author Rev  Date                   Action Path
------ ---- ----                   ------ ----
ms     1478 8/11/2013 4:00:05 PM   M      /trunk/profile/profile_scripts/NextIT_AgentManifest.ps1
ms     1478 8/11/2013 4:00:05 PM   M      /trunk/profile/profile_scripts/MsBuildTargets.ps1
ms     1478 8/11/2013 4:00:05 PM   M      /trunk/profile/profile_scripts/VsCommandPrompt.ps1
ms     1478 8/11/2013 4:00:05 PM   M      /trunk/profile/profile_scripts/EventLogByTime.ps1
ms     1478 8/11/2013 4:00:05 PM   M      /trunk/profile/profile_scripts/EventLogTail.ps1
ms     1479 8/11/2013 4:02:48 PM   M      /trunk/profile/Microsoft.PowerShell_profile.ps1
ms     1480 8/12/2013 7:45:59 PM   M      /trunk/CleanCode/FileTools/GetChildItemExtension.ps1
ms     1481 10/13/2013 1:05:04 AM  M      /trunk/scripts/SystemInfo.ps1
ms     1482 10/13/2013 1:05:51 AM  M      /trunk/CleanCode/DocTreeGenerator/DocTreeGenerator.psm1
ms     1482 10/13/2013 1:05:51 AM  M      /trunk/scripts/MeasureSimpleTalkArticles.ps1
ms     1483 10/13/2013 4:56:47 PM  M      /trunk/CleanCode/FileTools/Select-StringAligned.ps1
ms     1484 11/15/2013 10:46:15 AM M      /trunk/scripts/SystemInfo.ps1
ms     1484 11/15/2013 10:46:15 AM M      /trunk/scripts/RunSystemInfo.ps1
ms     1486 11/19/2013 9:07:59 PM  M      /trunk/CleanCode/DocTreeGenerator/DocTreeGenerator.psd1
所以通过包含来过滤是很简单的

Get-SvnLog -ByFile -RevisionRange 1478:1486 |
? { $_.Revision -in (1478, 1482, 1484) } | Format-Table -auto
。。。或通过排除:

Get-SvnLog -ByFile -RevisionRange 1478:1486 |
? { $_.Revision -notin (1478, 1482, 1484) } | Format-Table -auto

查看Get-SvnLog的API页面(转到我当时的PowerShell,然后是svn工具),了解更多激发想象力的示例。该库可以下载。

但是在这两个版本之间有一些我想排除的修订,我如何才能做到这一点?你不能用一个命令。你需要做多次差异来跳过特定的修改。该死,我希望我昨天看到这个。我刚刚完成了一个python脚本的编写,基本上就是这样做的。这真的很酷,我接受这个答案。