MAC OS X 下配置 SVN 使用 DiffMerge

來源:互聯網
上載者:User

記錄幾個指令碼便於以後查看

diff-wrap.py:

#!/usr/bin/env python

import sys

import os

# Configure your favorite three-way diff program here.

DIFF3 = "/Applications/DiffMerge.app/Contents/MacOS/DiffMerge"

# Subversion provides the paths we need as the last three parameters.

LABEL_LEFT = sys.argv[-5]

LABEL_RIGHT = sys.argv[-3]

FILE_LEFT = sys.argv[-2]

FILE_RIGHT = sys.argv[-1]

# Call the three-way diff command (change the following line to make

# sense for your three-way diff program).

cmd = [DIFF3, '--nosplash', '-t1', LABEL_LEFT, '-t2', LABEL_RIGHT, FILE_LEFT, FILE_RIGHT]

os.execv(cmd[0], cmd)

diff3-wrap.py:

#!/usr/bin/env python

import sys

import os

# Configure your favorite three-way diff program here.

DIFF3 = "/Applications/DiffMerge.app/Contents/MacOS/DiffMerge"

# Subversion provides the paths we need as the last three parameters.

LABEL_MINE = sys.argv[-8]

LABEL_OLDER = sys.argv[-6]

LABEL_YOURS = sys.argv[-4]

FILE_MINE  = sys.argv[-3]

FILE_OLDER = sys.argv[-2]

FILE_YOURS = sys.argv[-1]

# Call the three-way diff command (change the following line to make

# sense for your three-way diff program).

cmd = [DIFF3, '--nosplash', '-t1', LABEL_MINE, '-t2', LABEL_OLDER, '-t3', LABEL_YOURS, FILE_MINE, FILE_OLDER, FILE_YOURS]

os.execv(cmd[0], cmd)

merge-wrap.py:

#!/usr/bin/env python

import sys

import os

# Configure your favorite three-way diff program here.

DIFF3 = "/Applications/DiffMerge.app/Contents/MacOS/DiffMerge"

# Subversion provides the paths we need as the last three parameters.

FILE_BASE   = sys.argv[1]

FILE_THEIRS = sys.argv[2]

FILE_MINE   = sys.argv[3]

FILE_MERGED = sys.argv[4]

FILE_WCPATH = sys.argv[5]

# Call the three-way diff command (change the following line to make

# sense for your three-way diff program).

cmd = [DIFF3, '--nosplash', '-m', '-t1', 'Incoming Merge Changes', '-t2', 'Original (merged)', '-t3', 'Current Working Copy changes', '-r', FILE_MERGED, FILE_THEIRS, FILE_BASE, FILE_MINE]

os.execv(cmd[0], cmd)

.subversion/config(在[helpers]下):

diff-cmd = /full-path-to-script-dir/bash-scripts/diff-wrap.py

diff3-cmd = /full-path-to-script-dir/bash-scripts/diff3-wrap.py

diff3-has-program-arg=yes

merge-tool-cmd = /full-path-to-script-dir/bash-scripts/merge-wrap.py


相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.