Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added basic support for a few CVS commands by ripping them off the Su…

…bversion bundle and modifying them slightly.

git-svn-id: http://svn.textmate.org/trunk/Bundles/CVS.tmbundle@2568 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
  • Loading branch information...
commit 29406dbbf3a18cb8cd308c348ca4855ff5248dc6 0 parents
Brian Donovan authored
27 Commands/Add to Repository.plist
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>beforeRunningCommand</key>
+ <string>nop</string>
+ <key>command</key>
+ <string>require_cmd "${TM_CVS:=cvs}" "If you have installed cvs, then you need to either update your &lt;tt&gt;PATH&lt;/tt&gt; or set the &lt;tt&gt;TM_CVS&lt;/tt&gt; shell variable (e.g. in Preferences / Advanced)"
+
+"${TM_RUBY:-ruby}" -r "$TM_SUPPORT_PATH/bin/shelltokenize.rb" &lt;&lt;END
+ cvs = ENV['TM_CVS'] || "cvs"
+ TextMate.selected_paths_array.each do |path|
+ puts %x{cd "#{File.dirname path}" &amp;&amp; #{cvs} add "#{File.basename path}"}
+ end
+END</string>
+ <key>input</key>
+ <string>none</string>
+ <key>keyEquivalent</key>
+ <string>^Z</string>
+ <key>name</key>
+ <string>Add to Repository</string>
+ <key>output</key>
+ <string>showAsTooltip</string>
+ <key>uuid</key>
+ <string>ADCD4FCD-D39D-41B3-88D0-84C5BE115535</string>
+</dict>
+</plist>
23 Commands/Diff With Newest (HEAD).plist
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>beforeRunningCommand</key>
+ <string>nop</string>
+ <key>command</key>
+ <string>require_cmd "${TM_CVS:=cvs}" "If you have installed cvs, then you need to either update your &lt;tt&gt;PATH&lt;/tt&gt; or set the &lt;tt&gt;TM_CVS&lt;/tt&gt; shell variable (e.g. in Preferences / Advanced)"
+
+cd "$TM_DIRECTORY" &amp;&amp;
+cvs diff -r HEAD "$TM_FILENAME"</string>
+ <key>input</key>
+ <string>none</string>
+ <key>keyEquivalent</key>
+ <string>^Z</string>
+ <key>name</key>
+ <string>Diff With Newest (HEAD)</string>
+ <key>output</key>
+ <string>openAsNewDocument</string>
+ <key>uuid</key>
+ <string>22FC4CAB-4664-4CFC-BC8E-C2294616E464</string>
+</dict>
+</plist>
23 Commands/Diff With Previous Revision (PREV).plist
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>beforeRunningCommand</key>
+ <string>nop</string>
+ <key>command</key>
+ <string>require_cmd "${TM_CVS:=cvs}" "If you have installed cvs, then you need to either update your &lt;tt&gt;PATH&lt;/tt&gt; or set the &lt;tt&gt;TM_CVS&lt;/tt&gt; shell variable (e.g. in Preferences / Advanced)"
+
+cd "$TM_DIRECTORY" &amp;&amp;
+cvs diff -r PREV "$TM_FILENAME"</string>
+ <key>input</key>
+ <string>none</string>
+ <key>keyEquivalent</key>
+ <string>^Z</string>
+ <key>name</key>
+ <string>Diff With Previous Revision (PREV)</string>
+ <key>output</key>
+ <string>openAsNewDocument</string>
+ <key>uuid</key>
+ <string>E29C9E3B-B7FB-4ED1-94C3-2F702CD090B5</string>
+</dict>
+</plist>
51 Commands/Diff With Revision....plist
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>beforeRunningCommand</key>
+ <string>nop</string>
+ <key>command</key>
+ <string>require_cmd "${TM_CVS:=cvs}" "If you have installed cvs, then you need to either update your &lt;tt&gt;PATH&lt;/tt&gt; or set the &lt;tt&gt;TM_CVS&lt;/tt&gt; shell variable (e.g. in Preferences / Advanced)"
+
+cd "$TM_DIRECTORY"
+revs=$("$TM_CVS" log "$TM_FILENAME"|grep '^revision' \
+ 2&gt; &gt;(CocoaDialog progressbar --indeterminate \
+ --title "Diff Revision…" \
+ --text "Retrieving List of Revisions…" \
+ ))
+
+revs=$(echo $revs|sed 's/revision //g')
+
+revs=`osascript&lt;&lt;END
+ set AppleScript's text item delimiters to {" "}
+ tell app "SystemUIServer"
+ activate
+ set ourList to (every text item of "$revs")
+ if the count of items in ourList is 0 then
+ display dialog "No older revisions of file '$(basename "$TM_FILEPATH")' found" buttons ("OK")
+ set the result to false
+ else
+ choose from list ourList with prompt "Diff '$(basename "$TM_FILEPATH")' with older revision:"
+ end if
+ end tell
+END`
+
+# exit if user canceled
+if [[ $revs = "false" ]]; then
+ osascript -e 'tell app "TextMate" to activate' &amp;&gt;/dev/null &amp; exit_discard
+fi
+
+cd $TM_DIRECTORY &amp;&amp;
+"$TM_CVS" diff -r $revs $TM_FILENAME</string>
+ <key>input</key>
+ <string>none</string>
+ <key>keyEquivalent</key>
+ <string>^Z</string>
+ <key>name</key>
+ <string>Diff With Revision...</string>
+ <key>output</key>
+ <string>openAsNewDocument</string>
+ <key>uuid</key>
+ <string>6416A49F-8B3E-47EE-81B4-F2F7F19C6B41</string>
+</dict>
+</plist>
23 Commands/Diff With Working Copy (BASE).plist
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>beforeRunningCommand</key>
+ <string>nop</string>
+ <key>command</key>
+ <string>require_cmd "${TM_CVS:=cvs}" "If you have installed cvs, then you need to either update your &lt;tt&gt;PATH&lt;/tt&gt; or set the &lt;tt&gt;TM_CVS&lt;/tt&gt; shell variable (e.g. in Preferences / Advanced)"
+
+cd "$TM_DIRECTORY" &amp;&amp;
+cvs diff -r BASE "$TM_FILENAME"</string>
+ <key>input</key>
+ <string>none</string>
+ <key>keyEquivalent</key>
+ <string>^Z</string>
+ <key>name</key>
+ <string>Diff With Working Copy (BASE)</string>
+ <key>output</key>
+ <string>openAsNewDocument</string>
+ <key>uuid</key>
+ <string>00C541DE-9A5C-4C59-A075-E754BAEB25C2</string>
+</dict>
+</plist>
30 Commands/Revert.plist
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>beforeRunningCommand</key>
+ <string>nop</string>
+ <key>command</key>
+ <string>require_cmd "${TM_CVS:=cvs}" "If you have installed cvs, then you need to either update your &lt;tt&gt;PATH&lt;/tt&gt; or set the &lt;tt&gt;TM_CVS&lt;/tt&gt; shell variable (e.g. in Preferences / Advanced)"
+
+rm "$TM_FILEPATH" &amp;&amp;
+cd "$TM_DIRECTORY" &amp;&amp;
+"$TM_CVS" update "$TM_FILENAME"
+
+# force TM to refresh the current file..
+osascript &amp;&gt;/dev/null \
+ -e 'tell application "Dock" to activate' \
+ -e 'tell application "TextMate" to activate' &amp;
+</string>
+ <key>input</key>
+ <string>none</string>
+ <key>keyEquivalent</key>
+ <string>^Z</string>
+ <key>name</key>
+ <string>Revert</string>
+ <key>output</key>
+ <string>showAsTooltip</string>
+ <key>uuid</key>
+ <string>20865252-80D2-4CA4-9834-391D09210C4F</string>
+</dict>
+</plist>
19 info.plist
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>name</key>
+ <string>CVS</string>
+ <key>ordering</key>
+ <array>
+ <string>ADCD4FCD-D39D-41B3-88D0-84C5BE115535</string>
+ <string>22FC4CAB-4664-4CFC-BC8E-C2294616E464</string>
+ <string>00C541DE-9A5C-4C59-A075-E754BAEB25C2</string>
+ <string>E29C9E3B-B7FB-4ED1-94C3-2F702CD090B5</string>
+ <string>6416A49F-8B3E-47EE-81B4-F2F7F19C6B41</string>
+ <string>20865252-80D2-4CA4-9834-391D09210C4F</string>
+ </array>
+ <key>uuid</key>
+ <string>62FB4173-A31D-41D6-8201-16C7866F567E</string>
+</dict>
+</plist>
Please sign in to comment.
Something went wrong with that request. Please try again.