Просмотр различий в «унифицированном файле различий» рядом друг с другом

Когда у меня есть много небольших изменений в нескольких файлах в исходной папке Suversion, удобно просматривать изменения в одном большом унифицированном файле различий. Чтобы было ясно, единый файл различий , созданный subversion, выглядит следующим образом (пример содержит различия из двух файлов, все различия отображаются в одном и том же файле .diff):

Index: file1.py
===================================================================
--- file1.py    (revision 2)
+++ file1.py    (working copy)
@@ -227,7 +229,7 @@
         some line of code
         some other line of code
         yet a third line of code
-        first change, left
+        first change, right
         some line of code
         some other line of code
         yet a third line of code
@@ -608,8 +610,8 @@
         some line of code
         some other line of code
         yet a third line of code
-##         second change, left
-##         third change, left
+        second change, right
+        third change, right
         some line of code
         some other line of code
         yet a third line of code
\ No newline at end of file
Index: file2.py
===================================================================
--- file2.py    (revision 3)
+++ file2.py    (working copy)
@@ -3607,22 +3630,22 @@
         some line of code
         some other line of code
         yet a third line of code
-##         first change, left
-##         second change, left
+        first change, right
+        second change, right
         some line of code
         some other line of code
         yet a third line of code
@@ -7988,7 +8011,7 @@
         some line of code
         some other line of code
         yet a third line of code
-        third change, left
+        third change, right
         some line of code
         some other line of code
         yet a third line of code

Как вы можете себе представить, если в нескольких файлах есть много похожих изменений, очень удобно смотреть на это в tortoiseudiff (обратите внимание на «u» в имени), поскольку он кодирует изменения цветом, и вы можете быстро их просмотреть. Однако tortoiseudiff показывает этот файл как есть (плюс некоторая подсветка синтаксиса): «левая» и «правая» стороны diff расположены вертикально, а не рядом. Было бы еще лучше видеть две стороны каждого блока diff рядом, а не сверху/снизу. Что-то вроде этого:

Index: file1.py
===================================================================
--- file1.py    (revision 2)
+++ file1.py    (working copy)
@@ -227,7 +229,7 @@
    some line of code                      some line of code
    some other line of code                some other line of code
    yet a third line of code               yet a third line of code
-   first change, left                 +   first change, right
    some line of code                      some line of code
    some other line of code                some other line of code
    yet a third line of code               yet a third line of code
@@ -608,8 +610,8 @@
    some line of code                      some line of code
    some other line of code                some other line of code
    yet a third line of code               yet a third line of code
-##         second change, left
-##         third change, left
+        second change, right
+        third change, right
    some line of code                      some line of code
    some other line of code                some other line of code
    yet a third line of code               yet a third line of code
\ No newline at end of file
Index: file2.py
===================================================================
--- file2.py    (revision 3)
+++ file2.py    (working copy)
@@ -3607,22 +3630,22 @@
    some line of code                      some line of code
    some other line of code                some other line of code
    yet a third line of code               yet a third line of code
-##   first change, left             +     first change, right
-##   second change, left            +     second change, right
    some line of code                      some line of code
    some other line of code                some other line of code
    yet a third line of code               yet a third line of code
@@ -7988,7 +8011,7 @@
    some line of code                      some line of code
    some other line of code                some other line of code
    yet a third line of code               yet a third line of code
-   third change, left                 +   third change, right
    some line of code                      some line of code
    some other line of code                some other line of code
    yet a third line of code               yet a third line of code

или еще лучше вот это:

Index: file1.py
===================================================================
--- file1.py    (revision 2)
+++ file1.py    (working copy)
@@ -227,7 +229,7 @@
                     some line of code
                     some other line of code
                     yet a third line of code
-        first change, left             +        first change, right
                     some line of code
                     some other line of code
                     yet a third line of code
@@ -608,8 +610,8 @@
                     some line of code
                     some other line of code
                     yet a third line of code
-##         second change, left         +        second change, right
-##         third change, left          +        third change, right
                     some line of code
                     some other line of code
                     yet a third line of code
\ No newline at end of file
Index: file2.py
===================================================================
--- file2.py    (revision 3)
+++ file2.py    (working copy)
@@ -3607,22 +3630,22 @@
                     some line of code
                     some other line of code
                     yet a third line of code
-##         first change, left          +        first change, right
-##         second change, left         +        second change, right
                     some line of code
                     some other line of code
                     yet a third line of code
@@ -7988,7 +8011,7 @@
                     some line of code
                     some other line of code
                     yet a third line of code
-        third change, left             +        third change, right
                     some line of code
                     some other line of code
                     yet a third line of code

Я работаю в MS Windows, поэтому я посмотрел на winmerge, tortoiseudiff, tortoiseidff, ни один из них не поддерживает это. Я искал в Интернете другие варианты, но безуспешно.

Кто-нибудь знает инструмент, который делает это?

Ответы (1)

Я думаю, что Beyond Compare удовлетворит ваши потребности. Функция сравнения папок показывает, какие файлы различаются между двумя наборами папок, а затем вы можете выбрать все файлы и создать отчет о различиях файлов, что, я думаю, вам нужно. На простом примере графический интерфейс выглядит так:

Сравнение папок Beyond Compare

и отчет выглядит так:

FILE COMPARISON
Produced: 15/05/2014 12:27:16

Mode:  All Lines
Left base folder: C:\Example
Right base folder: C:\Example2

File: Subfolder\File3.txt
1 Test         =  1 Test
2 Another test    2 Another test
----------------------------------------------
               -+ 3 Extra line
----------------------------------------------
3 More testing =  4 More testing
----------------------------------------------

File: File1.txt
1 Test         <> 1 Deleted line
                  2 Another modified line test
2 Another test    3 Extra line
----------------------------------------------
3 More testing =  4 More testing
----------------------------------------------

File: File2.txt
1 Test         =  1 Test
2 Another test    2 Another test
3 More testing    3 More testing
----------------------------------------------

В этом примере я отобразил все строки, даже если они одинаковые, но при желании можно отфильтровать, чтобы отображались только измененные строки. Существует также интерфейс сценариев, если вы не хотите использовать графический интерфейс и 30-дневную бесплатную пробную версию.