1
使用svn diff
与--summarize
标志返回类似于下面的内容。我们如何将它传递给sed的或grep来做到以下几点:如何解析svn diff结果?
- 删除所有以“d”(删除文件)开始的任何行
- 删除的“M”前缀,“A”或“ MM“(或任何其他情况)以及随后的标签。
- 删除URL路径只留下文件名/文件夹。
- 存储在文件
例子:
D https://localhost/example/test1.php
D https://localhost/example/test2.php
M https://localhost/example/test3.php
M https://localhost/example/test4.php
A https://localhost/example/test5.php
M https://localhost/example/test6.php
A https://localhost/example/test7.php
M https://localhost/example/test8.php
M https://localhost/example/test9.php
M https://localhost/example/test10.php
A https://localhost/example/test11.php
M https://localhost/example/test12.php
M https://localhost/example/test13.php
MM https://localhost/example/test.php
M https://localhost/test0.php
然后会变成:
/example/test3.php
/example/test4.php
/example/test5.php
/example/test6.php
/example/test7.php
/example/test8.php
/example/test9.php
/example/test10.php
/example/test11.php
/example/test12.php
/example/test13.php
/example/test.php
/test0.php
您的输出结果与您的规格不符,它们不应包含'test1.php'或'test2.php',因为它们以'D'开头。 –
谢谢,更新了我的示例输出以纠正错误。 – atdev