2006年09月10日
WinMerge檔案濾鏡的使用方法
當我們在比對CVS或 Subversion的工作目錄(CVS使用,Working Directory)或工作複本(SVN使用,Working Copy)時,若不將其內部使用的CVS或.svn子目錄忽略掉,則經常會出現許多不必要的檔案;使用下列步驟則可將之忽略掉不比對:
-
比 對時必須指定檔案濾鏡(File Filter)
-
【工 具→濾鏡】,在檔案濾鏡頁籤上按新增,給一個新的檔名,例如wwwroot.flt
-
wwwroot.flt內容如下:
c:\Program files\WinMerge\Filters\wwwroot.flt
## This is a directory/file filter template for WinMerge
name: wwwroot
desc: JSP/JSPF/XML,...
## Select if filter is inclusive or exclusive
## Inclusive (loose) filter lets through all items not matching rules
## Exclusive filter lets through only items that match to rule
## include or exclude
def: include
## Filters for filenames begin with f:
## Filters for directories begin with d:
## (Inline comments begin with " ##" and extend to the end of the line)
## 以下副檔名的檔案不比對
f: \.bak$
f: \.class$
f: \.~*$d: \\images$
d: \\WEB-INF\\work$
d: \\web-inf\\work$
d: \\WEB-INF\\classes$
d: \\web-inf\\classes$
d: \\web-inf\\lib$
d: \\WEB-INF\\tmp$
d: \\\.svn$
d: \\CVS$
include的意思是下列的檔案(f:)與目錄(d:)設定要加入過濾條件裡,符合的檔案不會被比對
f:指定副檔名,因為點(.)是Regular expression的 特殊符號,副檔名的點要用\.來表示;結尾注 意要有Dollar-sign($)
d:指定不要比對的目錄,必須以\\開頭,$結尾
\\\.svn前兩個反斜線表示目錄, 第三個反斜線和.構成
.符 號
