Code

git-gui: Change the main window progress bar to use status_bar
[git.git] / lib / transport.tcl
index ce6fc45eba1d26a9d4221793f1da8ae1ebf06a66..3a22bd40d4df6f18204afc154cef82d5e3d52f58 100644 (file)
@@ -2,22 +2,32 @@
 # Copyright (C) 2006, 2007 Shawn Pearce
 
 proc fetch_from {remote} {
-       set w [new_console \
+       set w [console::new \
                "fetch $remote" \
                "Fetching new changes from $remote"]
-       set cmd [list git fetch]
-       lappend cmd $remote
-       console_exec $w $cmd console_done
+       set cmds [list]
+       lappend cmds [list exec git fetch $remote]
+       if {[is_config_true gui.pruneduringfetch]} {
+               lappend cmds [list exec git remote prune $remote]
+       }
+       console::chain $w $cmds
+}
+
+proc prune_from {remote} {
+       set w [console::new \
+               "remote prune $remote" \
+               "Pruning tracking branches deleted from $remote"]
+       console::exec $w [list git remote prune $remote]
 }
 
 proc push_to {remote} {
-       set w [new_console \
+       set w [console::new \
                "push $remote" \
                "Pushing changes to $remote"]
        set cmd [list git push]
        lappend cmd -v
        lappend cmd $remote
-       console_exec $w $cmd console_done
+       console::exec $w $cmd
 }
 
 proc start_push_anywhere_action {w} {
@@ -53,8 +63,10 @@ proc start_push_anywhere_action {w} {
                set unit branches
        }
 
-       set cons [new_console "push $r_url" "Pushing $cnt $unit to $r_url"]
-       console_exec $cons $cmd console_done
+       set cons [console::new \
+               "push $r_url" \
+               "Pushing $cnt $unit to $r_url"]
+       console::exec $cons $cmd
        destroy $w
 }
 
@@ -62,7 +74,7 @@ trace add variable push_remote write \
        [list radio_selector push_urltype remote]
 
 proc do_push_anywhere {} {
-       global all_heads all_remotes current_branch
+       global all_remotes current_branch
        global push_urltype push_remote push_url push_thin push_tags
 
        set w .push_setup
@@ -89,7 +101,7 @@ proc do_push_anywhere {} {
                -width 70 \
                -selectmode extended \
                -yscrollcommand [list $w.source.sby set]
-       foreach h $all_heads {
+       foreach h [load_all_heads] {
                $w.source.l insert end $h
                if {$h eq $current_branch} {
                        $w.source.l select set end