Ответ 1
Вы можете настроить инструменты сравнения (diff) и merge для каждого типа файла (расширение). Это доступно с помощью Инструменты → Параметры → Контроль источника → Visual Studio Team Foundation Server → Настройка пользовательских инструментов " или через командную строку с tf diff /configure
Чтобы настроить инструмент сравнения, вы укажете расширение (используйте .*
, если вы хотите, чтобы он использовался для всех файлов, не указанных иначе), операцию, которую вы настраиваете (сравнение или слияние), команду для вызова и аргументы команды. Для аргументов переменные, доступные для использования, следующие:
%1 = Original file (in diff, the pre-changes file, in merge, the "server" or "theirs" file, the file that is the base file after "their" changes were applied)
%2 = Modified file (in diff, the post-changes file, in merge the "yours" file - the base file with "your" changes applied)
%3 = Base file (in the 3-way merge operation, the file which both "theirs" and "yours" are derived from - the common ancestor. This doesn't mean it the version the changes were based from, since this may be a cherry-pick merge)
%4 = Merged file (The output file for the merge operation - the filename that the merge tool should write to)
%5 = Diff options (any additional command-line options you want to pass to your diff tool - this comes into play only when using "tf diff /options" from the command-line)
%6 = Original file label (The label for the %1 file)
%7 = Modified file label (The label for the %2 file)
%8 = Base file label (The label for the %3 file)
%9 = Merged file label (The label for the %4 file)
Чтобы использовать TortoiseSVN - похоже, что он делает то, что вы хотите - вы должны указать команду как путь к файлу TortoiseMerge.exe
Для сравнения укажите аргументы: /base:%1 /mine:%2 /basename:%6 /minename:%7
Для слияния укажите аргументы: /base:%3 /mine:%2 /theirs:%1 /basename:%8 /minename:%7 /theirsname:%6 /merged:%4 /mergedname:%9
Эта и другая информация о аргументах для различных инструментов слияния (включая другие инструменты сравнения слов, такие как DiffDoc.exe
) можно найти в блоге MSDN Джеймса Мэннинга. Вы также можете найти в другом вопросе stackoverflow на вызов инструмента сравнения слов из командной строки.