2

Mercurialリポジトリにいくつかの-small-バイナリファイルを追加しました。これらのファイルは、私の開発ツールの1つ(レポート/フォーム/クラス定義)の「ソース」ファイルです。

このバイナリファイルをテキストファイルにダンプして、それらを簡単に比較できるようにするプログラムを作成しました。特定のファイル拡張子がdiffプログラムを実行する前にこの変換を実行する必要があることをMercurialに伝える方法はありますか?または、変換プログラムをメインのdiffツールとして設定し、変換を実行するか、実行しないでから、実際のdiffプログラムを実行する必要がありますか?

4

2 に答える 2

2

(TBT)純粋なMercurialにExtDiff拡張機能を使用できます。TortoiseHGの場合

[diff-patterns]
**.ext = difftool

hgrcでゲームをプレイします

于 2011-10-10T01:12:17.530 に答える
0

私はdiffプログラムの前に小さなバッチで終わった:

@echo off
set f1=%1
set f2=%2
::Temporary dir created by hg to copy the snapshot file
set tdir=%~dp1
::Original repository dir
set repo=%~dp2
::Filename extension
set ext=%~x1
::The binary files comes in pairs: scx/sct \ vcx/vct ...
set ex2=%ext:~0,-1%t

::Check if "dumpable" extension
echo %ext% | grep -iE "(vcx|vct|scx|sct|pjx|pjt|frx|frt)" > nul && goto DumpFile
goto diff

:DumpFile
set f1="%tdir%\_Dump1.prg"
set f2="%tdir%\_Dump2.prg"
::Get the pair file from the repository
hg cat %repo%\%~n1%ex2% -o "%~dpn1%ex2%" -R %repo%

::Do the dump, then the diff
MyDumpProgram.exe %1 %f1%
MyDumpProgram.exe %2 %f2%
goto diff

:diff
ExamDiff.exe %f1% %f2%
pause

次に、%UserProfile%\。hgrcでバッチを構成します

[extdiff]
cmd.ediff = d:\Utiles\diff2.bat
于 2011-10-10T14:22:28.360 に答える