public
Description: The Git TextMate Bundle
Homepage: http://tim.theenchanter.com/
Clone URL: git://github.com/timcharper/git-tmbundle.git
fetch now displays a log of changes fetched, like the rest of the commands
timcharper (author)
Tue Apr 01 01:34:26 -0700 2008
commit  7eddd9102acc67ee854c88cf74666b2a5c97e384
tree    5f40fdf74eb9d975da1f1ad6ebc7b81b1138dc4e
parent  a52839651c3f20aa8b8e0c5328952ccc6530f27b
...
28
29
30
 
31
32
 
33
34
35
...
28
29
30
31
32
 
33
34
35
36
0
@@ -28,8 +28,9 @@ class LogController < ApplicationController
0
   end
0
   
0
   def log
0
+ log_params = params.delete_if { |key,value| [:controller, :action, :layout].include?(key) }
0
     @path = params[:path]
0
- @log_entries = git.log(params)
0
+ @log_entries = git.log(log_params)
0
     @branch ||= Git.new.branch.current_name
0
     render "log_entries"
0
   end
...
15
16
17
18
19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
21
22
...
70
71
72
73
 
74
75
76
...
15
16
17
 
 
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
...
82
83
84
 
85
86
87
88
0
@@ -15,8 +15,20 @@ class RemoteController < ApplicationController
0
     for_each_selected_remote(:title => "Fetch", :prompt => "Fetch from which shared repository?", :items => git.sources, :default => branch.remote) do |source|
0
       puts "<h2>Fetching from #{source}</h2>"
0
       flush
0
- result = git.fetch(source)
0
- puts htmlize(result[:text])
0
+ output = git.fetch(source,
0
+ :start => lambda { |state, count| progress_start(state, count) },
0
+ :progress => lambda { |state, percentage, index, count| progress(state, percentage, index, count)},
0
+ :end => lambda { |state, count| progress_end(state, count) }
0
+ )
0
+ puts htmlize(output[:text])
0
+
0
+ unless output[:fetches].empty?
0
+ puts("<h2>Log of changes fetched</h2>")
0
+ output[:fetches].each do |branch_name, revisions|
0
+ puts "<h2>Branch '#{branch_name}': #{short_rev(revisions.first)}..#{short_rev(revisions.last)}</h2>"
0
+ render_component(:controller => "log", :action => "log", :path => ".", :revisions => [revisions.first, revisions.last])
0
+ end
0
+ end
0
       
0
       puts "<h2>Pruning stale branches from #{source}</h2>"
0
       puts git.command('remote', 'prune', source)
0
@@ -70,7 +82,7 @@ class RemoteController < ApplicationController
0
         end
0
       elsif output[:nothing_to_pull]
0
       else
0
- puts "<h3>Error</h3>"
0
+ # puts "<h3>Error</h3>"
0
       end
0
     end
0
   end
...
222
223
224
225
 
226
227
 
228
229
230
...
222
223
224
 
225
226
 
227
228
229
230
0
@@ -222,9 +222,9 @@ module Parsers
0
         output[:nothing_to_pull] = true
0
       when /^\* ([^:]+):/
0
         branch = $1
0
- when /^([a-z]+) ([0-9a-f]+\.\.[0-9a-f]+)/i
0
+ when /^([a-z]+) ([0-9a-f]+\.\.[0-9a-f]+)/i # 1.5.3 format
0
         output[:pulls][branch] = get_rev_range($2)
0
- when /^ (old\.\.new|commit): (.+)/
0
+ when /^ (old\.\.new|commit): (.+)/ # 1.5.3 format
0
         output[:pulls][branch] = get_rev_range($2)
0
       when /^ +([0-9a-f]+\.\.[0-9a-f]+) +([^ ]+) +\-\> (.+)$/
0
         output[:pulls][$2] = get_rev_range($1)
...
2
3
4
 
5
6
7
...
13
14
15
16
17
18
19
 
 
 
 
20
21
22
...
24
25
26
27
28
29
30
 
 
 
 
 
 
 
 
 
31
32
33
...
2
3
4
5
6
7
8
...
14
15
16
 
 
 
 
17
18
19
20
21
22
23
...
25
26
27
 
 
 
 
28
29
30
31
32
33
34
35
36
37
38
39
0
@@ -2,6 +2,7 @@ require File.dirname(__FILE__) + '/../spec_helper'
0
 
0
 describe RemoteController do
0
   include SpecHelpers
0
+ include Parsers
0
   
0
   before(:each) do
0
     Git.reset_mock!
0
@@ -13,10 +14,10 @@ describe RemoteController do
0
       Git.command_response["branch"] = "* master\n"
0
       Git.command_response["config", "branch.master.remote"] = %Q{origin}
0
       Git.command_response["remote"] = %Q{origin}
0
-
0
- # query the config - if source != self["remote.#{current_branch}.remote"] || self["remote.#{current_branch}.merge"].nil?
0
-
0
- # Git.command_response[]
0
+
0
+ git = Git.singleton_git
0
+ git.should_receive(:log).with ({:path=>".", :revisions=>["74c0fdf", "d1c6bdd"]}).and_return(parse_log(fixture_file("log_with_diffs.txt")))
0
+
0
       Git.command_response["fetch", "origin"] = fixture_file("fetch_1_5_4_3_output.txt")
0
       
0
       @output = capture_output do
0
@@ -24,10 +25,15 @@ describe RemoteController do
0
       end
0
     end
0
     
0
- it "should output log of changes pulled" # do
0
- # puts htmlize(@output)
0
- # puts Git.commands_ran.inspect
0
- # end
0
+ it "should use javascript to output the progress" do
0
+ @output.should include("$('Compressing_progress').update('Done')")
0
+ end
0
+
0
+ it "should output a log" do
0
+ @output.should include("<h2>Log of changes fetched</h2>")
0
+ @output.should include("<h2>Branch 'asdf': 74c0fdf..d1c6bdd</h2>")
0
+ @output.should include("tim@email.com")
0
+ end
0
   end
0
   
0
   describe "pulling" do
...
1
2
 
3
4
5
...
369
370
371
372
 
373
374
375
...
1
 
2
3
4
5
...
369
370
371
 
372
373
374
375
0
@@ -1,5 +1,5 @@
0
 commit 3dce12204f8b81535ce10f579a78d71aa3fa1730
0
-Author: Tim Harper <timcharper@gmail.com>
0
+Author: Tim Harper <tim@email.com>
0
 Date: Fri Feb 8 13:22:36 2008 -0700
0
 
0
     overrode ERB to have ability to put all content onto a buffer (like STDOUT, for example), making ERB suit our needs better
0
@@ -369,7 +369,7 @@ index e29567e..e2a0cc3 100644
0
      @base = ENV["TM_PROJECT_DIRECTORY"]
0
 
0
 commit 382052cb014438e43045c0277a5d3f8273fa032d
0
-Author: Tim Harper <timcharper@gmail.com>
0
+Author: Tim Harper <tim@email.com>
0
 Date: Fri Feb 8 12:35:01 2008 -0700
0
 
0
     commit the whole directory

Comments

    No one has commented yet.