├── Support └── bin │ └── filemerge.sh ├── info.plist ├── README.mdown └── Commands ├── Working Copy (BASE).plist ├── Latest Revision (HEAD).plist ├── Previous Revision (PREV).plist ├── Revision....plist └── Revisions....plist /Support/bin/filemerge.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # $1 = svn old revision 4 | # $2 = svn new revision ('-' for working copy) 5 | # 6 | # $Id$ 7 | # 8 | 9 | # Build the revision spec 10 | REVS="$1" 11 | 12 | if [ "$2" != "-" ]; then 13 | REVS="${REVS}:$2" 14 | fi 15 | 16 | # See if there is any difference between the revisions 17 | FILE=`basename "$TM_FILEPATH"` 18 | SIZE=`${TM_SVN:-svn} diff -r "$REVS" "$FILE" | wc -m` 19 | 20 | if [ $SIZE -eq 0 ]; then 21 | echo "No difference" 22 | exit 206 23 | fi 24 | 25 | # Get a random number 26 | RAND=`awk 'BEGIN {srand(); print rand()}' | cut -d . -f 2` 27 | 28 | # Save a temporary copy of the old revision 29 | OLDPATH="/tmp/tm-opendiff-$RAND.tmp" 30 | svn cat -r "$1" "$FILE" > "$OLDPATH" 31 | 32 | # If the new revision is not the working copy, save a temporary copy 33 | # of it with which to compare. 34 | if [ "$2" != "-" ]; then 35 | NEWPATH=${OLDPATH}.2 36 | ${TM_SVN:-svn} cat -r "$2" "$FILE" > "$NEWPATH" 37 | else 38 | NEWPATH="$TM_FILEPATH" 39 | fi 40 | 41 | ${TM_OPENDIFF:-opendiff} "$OLDPATH" "$NEWPATH" &>/dev/null & -------------------------------------------------------------------------------- /info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | contactEmailRot13 6 | ncnenwvgn@ncnenwvgnjbeyq.pbz 7 | contactName 8 | Aparajita Fishman 9 | description 10 | Subversion diff commands that use <a href="http://developer.apple.com/documentation/DeveloperTools/Conceptual/XcodeUserGuide/Contents/Resources/en.lproj/04_03_SCMManagingFiles/chapter_28_section_8.html#//apple_ref/doc/uid/TP40002687-CJBHDBJD">FileMerge</a>. 11 | name 12 | FileMerge 13 | ordering 14 | 15 | 9F8B60D0-0535-4B92-8A02-A5AF47BE5306 16 | BA930D7C-7B5E-4BFE-9293-6B8FAF962990 17 | 3FA49AEC-79AA-4E3A-BFDA-FD7E4EF8D0FE 18 | F0B1A94F-3FC5-47B8-8771-FFF4EF230156 19 | 9029E141-4526-4ED8-95B2-2A4E19BAD402 20 | 21 | uuid 22 | 95761F74-1A3D-4B51-BA03-41537C38C792 23 | 24 | 25 | -------------------------------------------------------------------------------- /README.mdown: -------------------------------------------------------------------------------- 1 | # Installation 2 | 3 | You can install this bundle in TextMate by opening the preferences and going to the bundles tab. After installation it will be automatically updated for you. 4 | 5 | # General 6 | 7 | * [Bundle Styleguide](http://kb.textmate.org/bundle_styleguide) — _before you make changes_ 8 | * [Commit Styleguide](http://kb.textmate.org/commit_styleguide) — _before you send a pull request_ 9 | * [Writing Bug Reports](http://kb.textmate.org/writing_bug_reports) — _before you report an issue_ 10 | 11 | # License 12 | 13 | If not otherwise specified (see below), files in this repository fall under the following license: 14 | 15 | Permission to copy, use, modify, sell and distribute this 16 | software is granted. This software is provided "as is" without 17 | express or implied warranty, and with no claim as to its 18 | suitability for any purpose. 19 | 20 | An exception is made for files in readable text which contain their own license information, or files where an accompanying file exists (in the same directory) with a “-license” suffix added to the base-name name of the original file, and an extension of txt, html, or similar. For example “tidy” is accompanied by “tidy-license.txt”. -------------------------------------------------------------------------------- /Commands/Working Copy (BASE).plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | saveActiveFile 7 | command 8 | #!/usr/bin/env bash 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | 11 | # See if the current file is under svn control 12 | FILE=`basename "$TM_FILEPATH"` 13 | INFO_LINES=`${TM_SVN:-svn} info "$FILE" 2>&1 | grep "^Path\: .*\$" | wc -l` 14 | 15 | if [ $INFO_LINES -eq 0 ]; then 16 | echo "The current file is not under subversion control" 17 | exit_show_tool_tip 18 | fi 19 | 20 | "$TM_BUNDLE_SUPPORT/bin/filemerge.sh" BASE - 21 | 22 | input 23 | none 24 | inputFormat 25 | text 26 | keyEquivalent 27 | ^@A 28 | name 29 | Working Copy (BASE) 30 | outputCaret 31 | afterOutput 32 | outputFormat 33 | text 34 | outputLocation 35 | discard 36 | requiredCommands 37 | 38 | 39 | command 40 | opendiff 41 | locations 42 | 43 | /usr/bin/opendiff 44 | 45 | variable 46 | TM_OPENDIFF 47 | 48 | 49 | command 50 | svn 51 | locations 52 | 53 | /usr/local/bin/svn 54 | /opt/local/bin/svn 55 | 56 | variable 57 | TM_SVN 58 | 59 | 60 | uuid 61 | 9F8B60D0-0535-4B92-8A02-A5AF47BE5306 62 | version 63 | 2 64 | 65 | 66 | -------------------------------------------------------------------------------- /Commands/Latest Revision (HEAD).plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | saveActiveFile 7 | command 8 | #!/usr/bin/env bash 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | 11 | # See if the current file is under svn control 12 | FILE=`basename "$TM_FILEPATH"` 13 | INFO_LINES=`${TM_SVN:-svn} info "$FILE" 2>&1 | grep "^Path\: .*\$" | wc -l` 14 | 15 | if [ $INFO_LINES -eq 0 ]; then 16 | echo "The current file is not under subversion control" 17 | exit_show_tool_tip 18 | fi 19 | 20 | "$TM_BUNDLE_SUPPORT/bin/filemerge.sh" HEAD - 21 | 22 | input 23 | none 24 | inputFormat 25 | text 26 | keyEquivalent 27 | ^@A 28 | name 29 | Latest Revision (HEAD) 30 | outputCaret 31 | afterOutput 32 | outputFormat 33 | text 34 | outputLocation 35 | discard 36 | requiredCommands 37 | 38 | 39 | command 40 | opendiff 41 | locations 42 | 43 | /usr/bin/opendiff 44 | 45 | variable 46 | TM_OPENDIFF 47 | 48 | 49 | command 50 | svn 51 | locations 52 | 53 | /usr/local/bin/svn 54 | /opt/local/bin/svn 55 | 56 | variable 57 | TM_SVN 58 | 59 | 60 | uuid 61 | BA930D7C-7B5E-4BFE-9293-6B8FAF962990 62 | version 63 | 2 64 | 65 | 66 | -------------------------------------------------------------------------------- /Commands/Previous Revision (PREV).plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | saveActiveFile 7 | command 8 | #!/usr/bin/env bash 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | 11 | # See if the current file is under svn control 12 | FILE=`basename "$TM_FILEPATH"` 13 | INFO_LINES=`${TM_SVN:-svn} info "$FILE" 2>&1 | grep "^Path\: .*\$" | wc -l` 14 | 15 | if [ $INFO_LINES -eq 0 ]; then 16 | echo "The current file is not under subversion control" 17 | exit_show_tool_tip 18 | fi 19 | 20 | "$TM_BUNDLE_SUPPORT/bin/filemerge.sh" PREV - 21 | 22 | input 23 | none 24 | inputFormat 25 | text 26 | keyEquivalent 27 | ^@A 28 | name 29 | Previous Revision (PREV) 30 | outputCaret 31 | afterOutput 32 | outputFormat 33 | text 34 | outputLocation 35 | discard 36 | requiredCommands 37 | 38 | 39 | command 40 | opendiff 41 | locations 42 | 43 | /usr/bin/opendiff 44 | 45 | variable 46 | TM_OPENDIFF 47 | 48 | 49 | command 50 | svn 51 | locations 52 | 53 | /usr/local/bin/svn 54 | /opt/local/bin/svn 55 | 56 | variable 57 | TM_SVN 58 | 59 | 60 | uuid 61 | 3FA49AEC-79AA-4E3A-BFDA-FD7E4EF8D0FE 62 | version 63 | 2 64 | 65 | 66 | -------------------------------------------------------------------------------- /Commands/Revision....plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | saveActiveFile 7 | command 8 | #!/usr/bin/env bash 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | 11 | # See if the current file is under svn control 12 | FILE=`basename "$TM_FILEPATH"` 13 | INFO_LINES=`${TM_SVN:-svn} info "$FILE" 2>&1 | grep "^Path\: .*\$" | wc -l` 14 | 15 | if [ $INFO_LINES -eq 0 ]; then 16 | echo "The current file is not under subversion control" 17 | exit_show_tool_tip 18 | fi 19 | 20 | revs=$("$TM_SVN" log -q "$TM_FILEPATH"|grep -v '^-*$' \ 21 | 2> >(CocoaDialog progressbar --indeterminate \ 22 | --title "Diff Revision…" \ 23 | --text "Retrieving List of Revisions…" \ 24 | )) 25 | 26 | revs=`osascript<<END 27 | set AppleScript's text item delimiters to {"\n","\r"} 28 | tell app "SystemUIServer" 29 | activate 30 | set ourList to (every text item of "$revs") 31 | if the count of items in ourList is 0 then 32 | display dialog "No older revisions of file '$(basename "$TM_FILEPATH")' found" buttons ("OK") 33 | set the result to false 34 | else 35 | choose from list ourList with prompt "Diff '$(basename "$TM_FILEPATH")' with older revision:" 36 | end if 37 | end tell 38 | END` 39 | 40 | # exit if user canceled 41 | if [[ $revs = "false" ]]; then 42 | osascript -e 'tell app "TextMate" to activate' &>/dev/null & exit_discard 43 | fi 44 | 45 | REV=`echo "$revs" | tr '\r' '\n' | awk -F '|' '{ print substr($1, 2) }'` 46 | "$TM_BUNDLE_SUPPORT/bin/filemerge.sh" $REV - 47 | input 48 | none 49 | inputFormat 50 | text 51 | keyEquivalent 52 | ^@A 53 | name 54 | Revision... 55 | outputCaret 56 | afterOutput 57 | outputFormat 58 | text 59 | outputLocation 60 | discard 61 | requiredCommands 62 | 63 | 64 | command 65 | opendiff 66 | locations 67 | 68 | /usr/bin/opendiff 69 | 70 | variable 71 | TM_OPENDIFF 72 | 73 | 74 | command 75 | svn 76 | locations 77 | 78 | /usr/local/bin/svn 79 | /opt/local/bin/svn 80 | 81 | variable 82 | TM_SVN 83 | 84 | 85 | uuid 86 | F0B1A94F-3FC5-47B8-8771-FFF4EF230156 87 | version 88 | 2 89 | 90 | 91 | -------------------------------------------------------------------------------- /Commands/Revisions....plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | saveActiveFile 7 | command 8 | #!/usr/bin/env bash 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | 11 | # See if the current file is under svn control 12 | FILE=`basename "$TM_FILEPATH"` 13 | INFO_LINES=`${TM_SVN:-svn} info "$FILE" 2>&1 | grep "^Path\: .*\$" | wc -l` 14 | 15 | if [ $INFO_LINES -eq 0 ]; then 16 | echo "The current file is not under subversion control" 17 | exit_show_tool_tip 18 | fi 19 | 20 | revs=$("$TM_SVN" log -q "$TM_FILEPATH"|grep -v '^-*$' \ 21 | 2> >(CocoaDialog progressbar --indeterminate \ 22 | --title "Diff Revisions…" \ 23 | --text "Retrieving List of Revisions…" \ 24 | )) 25 | 26 | revs=`osascript <<END 27 | set theResult to false 28 | set AppleScript's text item delimiters to {"\n","\r"} 29 | tell app "SystemUIServer" 30 | activate 31 | set ourList to (every text item of "$revs") 32 | if the count of items in ourList is 0 then 33 | display dialog "No revisions of file '$TM_FILENAME' found" buttons ("Continue") default button 1 34 | else 35 | tell app "SystemUIServer" to choose from list (every text item of "$revs") with prompt "Please choose two revisions of '$TM_FILENAME':" with multiple selections allowed 36 | 37 | set theitems to the result 38 | if theitems is not false then 39 | if the count of items in the theitems is not 2 then 40 | display dialog "Please select exactly two revisions (hold down the Apple key to select multiple revisions)." buttons ("Continue") default button 1 41 | else 42 | set theResult to (item 1 of theitems) & return & (item 2 of theitems) 43 | end if 44 | end if 45 | end if 46 | set the result to theResult 47 | end tell 48 | END` 49 | 50 | # exit if user canceled 51 | if [[ $revs = "false" ]]; then 52 | osascript -e 'tell app "TextMate" to activate' &>/dev/null & exit_discard 53 | fi 54 | 55 | revs=`echo -n "$revs" | awk -F '|' 'BEGIN { RS="\r"} { print substr($1, 2) }'` 56 | revs=( $revs ) 57 | "$TM_BUNDLE_SUPPORT/bin/filemerge.sh" ${revs[1]} ${revs[0]} 58 | 59 | input 60 | none 61 | inputFormat 62 | text 63 | keyEquivalent 64 | ^@A 65 | name 66 | Revisions... 67 | outputCaret 68 | afterOutput 69 | outputFormat 70 | text 71 | outputLocation 72 | discard 73 | requiredCommands 74 | 75 | 76 | command 77 | opendiff 78 | locations 79 | 80 | /usr/bin/opendiff 81 | 82 | variable 83 | TM_OPENDIFF 84 | 85 | 86 | command 87 | svn 88 | locations 89 | 90 | /usr/local/bin/svn 91 | /opt/local/bin/svn 92 | 93 | variable 94 | TM_SVN 95 | 96 | 97 | uuid 98 | 9029E141-4526-4ED8-95B2-2A4E19BAD402 99 | version 100 | 2 101 | 102 | 103 | --------------------------------------------------------------------------------