Permalink
Browse files

Update Darcs bundle (general fixes)

git-svn-id: http://svn.textmate.org/trunk/Bundles/Darcs.tmbundle@1667 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
  • Loading branch information...
1 parent f9748aa commit 3dd40c8efc9d0174731820990b244fdb72809fa4 David Powers committed Sep 2, 2005
@@ -5,13 +5,14 @@
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
- <string>if [[ -z $TM_SELECTED_FILES ]]; then
+ <string>cd "$TM_DIRECTORY"
+
+if [[ -z $TM_SELECTED_FILES ]]; then
DARCSPaths=`echo \'$TM_FILEPATH\'`;
else
DARCSPaths="$TM_SELECTED_FILES";
fi
-cd "$TM_DIRECTORY";
"${TM_RUBY:=ruby}" &lt;&lt;'EOF'
require 'pathname'
@@ -29,7 +30,7 @@ puts(output)</string>
<key>keyEquivalent</key>
<string>@d</string>
<key>name</key>
- <string>Add to repository</string>
+ <string>Add file(s) to repository</string>
<key>output</key>
<string>discard</string>
<key>uuid</key>
View
@@ -5,16 +5,52 @@
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
- <string>cd "$TM_DIRECTORY";
-darcs changes --xml</string>
+ <string>cd "${TM_PROJECT_DIRECTORY:=$TM_DIRECTORY}";
+
+"${TM_RUBY:=ruby}" &lt;&lt;'EOF'
+require 'rexml/document'
+require 'time'
+
+puts("&lt;html&gt;")
+puts("&lt;head&gt;")
+puts(" &lt;style type=\"text/css\"&gt;")
+puts(" html {")
+puts(" font-size: small;")
+puts(" }")
+puts(" body {")
+puts(" border: 0px;")
+puts(" margin: 0px;")
+puts(" }")
+puts(" .chunk {")
+puts(" padding: 7px;")
+puts(" }")
+puts(" &lt;/style&gt;")
+puts("&lt;/head&gt;")
+puts("&lt;body&gt;")
+output = `darcs changes --xml`
+xmldoc = REXML::Document.new(output)
+count = 0
+xmldoc.root.each_element('patch') { |patch|
+ print("&lt;div class=\"chunk\" ")
+ if(count % 2 == 0)
+ print("style=\"background-color: white\"")
+ else
+ print("style=\"background-color: lightblue\"")
+ end
+ print("&gt;&lt;tt style=\"color: gray\"&gt;#{Time.parse(patch.attributes['local_date']).strftime("%m/%d/%y %I:%M %p").downcase()}, #{patch.attributes['author']}&lt;/tt&gt;&lt;br/&gt; #{patch.elements['name'].text()}&lt;br/&gt;")
+ print("&lt;/div&gt;")
+ count = count + 1
+}
+puts("&lt;/body&gt;")
+puts("&lt;/html&gt;")</string>
<key>input</key>
<string>none</string>
<key>keyEquivalent</key>
<string>@d</string>
<key>name</key>
<string>Changes</string>
<key>output</key>
- <string>openAsNewDocument</string>
+ <string>showAsHTML</string>
<key>uuid</key>
<string>5CEA8FE0-E28A-11D9-9477-000A95A51A76</string>
</dict>
@@ -5,7 +5,8 @@
<key>beforeRunningCommand</key>
<string>saveModifiedFiles</string>
<key>command</key>
- <string>cd "$TM_DIRECTORY";
+ <string>cd "${TM_PROJECT_DIRECTORY:=$TM_DIRECTORY}"
+
darcs pull -a</string>
<key>input</key>
<string>none</string>
@@ -5,7 +5,8 @@
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
- <string>cd "$TM_DIRECTORY";
+ <string>cd "${TM_PROJECT_DIRECTORY:=$TM_DIRECTORY}"
+
darcs push -a </string>
<key>input</key>
<string>none</string>
@@ -5,7 +5,7 @@
<key>beforeRunningCommand</key>
<string>saveModifiedFiles</string>
<key>command</key>
- <string>cd "$TM_DIRECTORY";
+ <string>cd "${TM_PROJECT_DIRECTORY:=$TM_DIRECTORY}";
"${TM_RUBY:=ruby}" &lt;&lt;'EOF'
output = `CocoaDialog inputbox --title Input --informative-text 'Record Message' --button1 Record --button2 'Abort'`
View
@@ -6,12 +6,12 @@
<string>Darcs</string>
<key>ordering</key>
<array>
- <string>B2B2A814-DE60-11D9-823F-000A95A51A76</string>
- <string>81229AD0-DE5C-11D9-823F-000A95A51A76</string>
<string>5E76D8C8-DE61-11D9-823F-000A95A51A76</string>
<string>1C9B5F32-759D-4B3E-BA91-A83897C48026</string>
- <string>5CEA8FE0-E28A-11D9-9477-000A95A51A76</string>
<string>242ECD6E-DE5D-11D9-823F-000A95A51A76</string>
+ <string>B2B2A814-DE60-11D9-823F-000A95A51A76</string>
+ <string>5CEA8FE0-E28A-11D9-9477-000A95A51A76</string>
+ <string>81229AD0-DE5C-11D9-823F-000A95A51A76</string>
</array>
<key>uuid</key>
<string>6D19E21C-DE5C-11D9-823F-000A95A51A76</string>

0 comments on commit 3dd40c8

Please sign in to comment.