Cornerstone 3 添加外部diff工具

因Mac上的svn工具Cornerstone的diff工具十分不好用,并且比对不精确,所以想在Cornerstone内调用第三方diff工具。个人使用DiffFork进行比对。

DiffFork还提供shell方式打开软件可以软链到/usr/local/bin/difffork

但是我通过shell方式打开后是生成了2个比对窗口,2个文件没能在一起比对,所以使用了applescript方式。

但是BeyondCompare可以通过shell方式正确打开,但是Mac下的BeyondCompare对中文不友好所以就用DiffFork了。

shell调用方式:

 
 
  1. #!/bin/bash 
  2.  
  3. original_path="$1" 
  4. modified_path="$3" 
  5.  
  6. /usr/local/bin/bcompare "$original_path" "$modified_path" 

DiffFork提供的applescript调用示例:

 
 
  1. (* 
  2. diff v: Diff 
  3.  diff item : the old item. 
  4.  against item : the new item. 
  5. *) 
  6.  
  7. set theOld to (choose file with prompt "Select Old:"
  8. set theNew to (choose file with prompt "Select New:"
  9.  
  10. tell application "DiffFork" 
  11.  activate 
  12.  diff theOld against theNew 
  13. end tell 

因为Cornerstone的外部工具只支持*.sh的所以修改了DiffFork提供的applescript以shell方式打开。

 
 
  1. #!/bin/bash 
  2.  
  3. osascript -e 'tell application "DiffFork"' -e "activate" -e "diff \"$1\" against \"$3\"" -e 'end tell' 

下面是BeyondCompare的调用方式:

 
 
  1. #!/bin/bash 
  2.  
  3. original_path="$1" 
  4. modified_path="$3" 
  5.  
  6. /usr/local/bin/bcompare "$original_path" "$modified_path" 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值