Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 1 | # git-gui branch merge support |
| 2 | # Copyright (C) 2006, 2007 Shawn Pearce |
| 3 | |
Shawn O. Pearce | ff749c1 | 2007-07-18 02:56:44 -0400 | [diff] [blame] | 4 | class merge { |
Shawn O. Pearce | a6c9b08 | 2007-05-02 13:56:27 -0400 | [diff] [blame] | 5 | |
Shawn O. Pearce | ff749c1 | 2007-07-18 02:56:44 -0400 | [diff] [blame] | 6 | field w ; # top level window |
Shawn O. Pearce | 350a35f | 2007-07-25 03:44:50 -0400 | [diff] [blame] | 7 | field w_rev ; # mega-widget to pick the revision to merge |
Shawn O. Pearce | ff749c1 | 2007-07-18 02:56:44 -0400 | [diff] [blame] | 8 | |
| 9 | method _can_merge {} { |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 10 | global HEAD commit_type file_states |
| 11 | |
| 12 | if {[string match amend* $commit_type]} { |
Christian Stimming | 1ac1795 | 2007-07-21 14:21:34 +0200 | [diff] [blame] | 13 | info_popup [mc "Cannot merge while amending. |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 14 | |
| 15 | You must finish amending this commit before starting any type of merge. |
Christian Stimming | 1ac1795 | 2007-07-21 14:21:34 +0200 | [diff] [blame] | 16 | "] |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 17 | return 0 |
| 18 | } |
| 19 | |
| 20 | if {[committer_ident] eq {}} {return 0} |
| 21 | if {![lock_index merge]} {return 0} |
| 22 | |
| 23 | # -- Our in memory state should match the repository. |
| 24 | # |
| 25 | repository_state curType curHEAD curMERGE_HEAD |
| 26 | if {$commit_type ne $curType || $HEAD ne $curHEAD} { |
Christian Stimming | 1ac1795 | 2007-07-21 14:21:34 +0200 | [diff] [blame] | 27 | info_popup [mc "Last scanned state does not match repository state. |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 28 | |
| 29 | Another Git program has modified this repository since the last scan. A rescan must be performed before a merge can be performed. |
| 30 | |
| 31 | The rescan will be automatically started now. |
Christian Stimming | 1ac1795 | 2007-07-21 14:21:34 +0200 | [diff] [blame] | 32 | "] |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 33 | unlock_index |
Shawn O. Pearce | 699d560 | 2007-07-05 23:16:13 -0400 | [diff] [blame] | 34 | rescan ui_ready |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 35 | return 0 |
| 36 | } |
| 37 | |
| 38 | foreach path [array names file_states] { |
| 39 | switch -glob -- [lindex $file_states($path) 0] { |
| 40 | _O { |
| 41 | continue; # and pray it works! |
| 42 | } |
Johannes Sixt | a910898 | 2008-10-08 10:03:54 +0200 | [diff] [blame] | 43 | _U - |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 44 | U? { |
Christian Stimming | 1ac1795 | 2007-07-21 14:21:34 +0200 | [diff] [blame] | 45 | error_popup [mc "You are in the middle of a conflicted merge. |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 46 | |
Christian Stimming | 1ac1795 | 2007-07-21 14:21:34 +0200 | [diff] [blame] | 47 | File %s has merge conflicts. |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 48 | |
Christian Stimming | 360cc10 | 2007-07-28 22:17:10 +0200 | [diff] [blame] | 49 | You must resolve them, stage the file, and commit to complete the current merge. Only then can you begin another merge. |
Christian Stimming | 1ac1795 | 2007-07-21 14:21:34 +0200 | [diff] [blame] | 50 | " [short_path $path]] |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 51 | unlock_index |
| 52 | return 0 |
| 53 | } |
| 54 | ?? { |
Christian Stimming | 1ac1795 | 2007-07-21 14:21:34 +0200 | [diff] [blame] | 55 | error_popup [mc "You are in the middle of a change. |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 56 | |
Christian Stimming | 1ac1795 | 2007-07-21 14:21:34 +0200 | [diff] [blame] | 57 | File %s is modified. |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 58 | |
| 59 | You should complete the current commit before starting a merge. Doing so will help you abort a failed merge, should the need arise. |
Christian Stimming | 1ac1795 | 2007-07-21 14:21:34 +0200 | [diff] [blame] | 60 | " [short_path $path]] |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 61 | unlock_index |
| 62 | return 0 |
| 63 | } |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | return 1 |
| 68 | } |
| 69 | |
Shawn O. Pearce | 5dc2cae | 2007-07-19 02:24:25 -0400 | [diff] [blame] | 70 | method _rev {} { |
Shawn O. Pearce | 350a35f | 2007-07-25 03:44:50 -0400 | [diff] [blame] | 71 | if {[catch {$w_rev commit_or_die}]} { |
| 72 | return {} |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 73 | } |
Shawn O. Pearce | 350a35f | 2007-07-25 03:44:50 -0400 | [diff] [blame] | 74 | return [$w_rev get] |
Shawn O. Pearce | 1fc4ba8 | 2007-05-03 18:21:39 -0400 | [diff] [blame] | 75 | } |
| 76 | |
Shawn O. Pearce | ff749c1 | 2007-07-18 02:56:44 -0400 | [diff] [blame] | 77 | method _visualize {} { |
Shawn O. Pearce | 5dc2cae | 2007-07-19 02:24:25 -0400 | [diff] [blame] | 78 | set rev [_rev $this] |
| 79 | if {$rev ne {}} { |
| 80 | do_gitk [list $rev --not HEAD] |
| 81 | } |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 82 | } |
| 83 | |
Shawn O. Pearce | ff749c1 | 2007-07-18 02:56:44 -0400 | [diff] [blame] | 84 | method _start {} { |
Shawn O. Pearce | ead49f5 | 2007-07-25 04:54:53 -0400 | [diff] [blame] | 85 | global HEAD current_branch remote_url |
Heiko Voigt | 9d04278 | 2011-02-12 17:44:58 +0100 | [diff] [blame] | 86 | global _last_merged_branch |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 87 | |
Shawn O. Pearce | 5dc2cae | 2007-07-19 02:24:25 -0400 | [diff] [blame] | 88 | set name [_rev $this] |
| 89 | if {$name eq {}} { |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 90 | return |
| 91 | } |
| 92 | |
Shawn O. Pearce | ead49f5 | 2007-07-25 04:54:53 -0400 | [diff] [blame] | 93 | set spec [$w_rev get_tracking_branch] |
| 94 | set cmit [$w_rev get_commit] |
Shawn O. Pearce | ead49f5 | 2007-07-25 04:54:53 -0400 | [diff] [blame] | 95 | |
| 96 | set fh [open [gitdir FETCH_HEAD] w] |
| 97 | fconfigure $fh -translation lf |
| 98 | if {$spec eq {}} { |
| 99 | set remote . |
| 100 | set branch $name |
| 101 | set stitle $branch |
| 102 | } else { |
| 103 | set remote $remote_url([lindex $spec 1]) |
Shawn O. Pearce | bc318ea | 2007-07-25 05:02:38 -0400 | [diff] [blame] | 104 | if {[regexp {^[^:@]*@[^:]*:/} $remote]} { |
| 105 | regsub {^[^:@]*@} $remote {} remote |
| 106 | } |
Shawn O. Pearce | ead49f5 | 2007-07-25 04:54:53 -0400 | [diff] [blame] | 107 | set branch [lindex $spec 2] |
Christian Stimming | 1ac1795 | 2007-07-21 14:21:34 +0200 | [diff] [blame] | 108 | set stitle [mc "%s of %s" $branch $remote] |
Shawn O. Pearce | ead49f5 | 2007-07-25 04:54:53 -0400 | [diff] [blame] | 109 | } |
| 110 | regsub ^refs/heads/ $branch {} branch |
| 111 | puts $fh "$cmit\t\tbranch '$branch' of $remote" |
| 112 | close $fh |
Heiko Voigt | 9d04278 | 2011-02-12 17:44:58 +0100 | [diff] [blame] | 113 | set _last_merged_branch $branch |
Shawn O. Pearce | ead49f5 | 2007-07-25 04:54:53 -0400 | [diff] [blame] | 114 | |
Pat Thoyts | 82fbd8a | 2016-10-04 12:49:05 +0100 | [diff] [blame] | 115 | if {[git-version >= "2.5.0"]} { |
| 116 | set cmd [list git merge --strategy=recursive FETCH_HEAD] |
| 117 | } else { |
| 118 | set cmd [list git] |
| 119 | lappend cmd merge |
| 120 | lappend cmd --strategy=recursive |
| 121 | lappend cmd [git fmt-merge-msg <[gitdir FETCH_HEAD]] |
| 122 | lappend cmd HEAD |
| 123 | lappend cmd $name |
| 124 | } |
Shawn O. Pearce | ead49f5 | 2007-07-25 04:54:53 -0400 | [diff] [blame] | 125 | |
Christian Stimming | 5e6d776 | 2008-02-02 10:20:17 +0100 | [diff] [blame] | 126 | ui_status [mc "Merging %s and %s..." $current_branch $stitle] |
Christian Stimming | 1ac1795 | 2007-07-21 14:21:34 +0200 | [diff] [blame] | 127 | set cons [console::new [mc "Merge"] "merge $stitle"] |
Shawn O. Pearce | 5dc2cae | 2007-07-19 02:24:25 -0400 | [diff] [blame] | 128 | console::exec $cons $cmd [cb _finish $cons] |
Shawn O. Pearce | 39fa2a9 | 2007-06-11 23:52:43 -0400 | [diff] [blame] | 129 | |
| 130 | wm protocol $w WM_DELETE_WINDOW {} |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 131 | destroy $w |
| 132 | } |
| 133 | |
Shawn O. Pearce | 5dc2cae | 2007-07-19 02:24:25 -0400 | [diff] [blame] | 134 | method _finish {cons ok} { |
Shawn O. Pearce | ff749c1 | 2007-07-18 02:56:44 -0400 | [diff] [blame] | 135 | console::done $cons $ok |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 136 | if {$ok} { |
Christian Stimming | 1ac1795 | 2007-07-21 14:21:34 +0200 | [diff] [blame] | 137 | set msg [mc "Merge completed successfully."] |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 138 | } else { |
Christian Stimming | 1ac1795 | 2007-07-21 14:21:34 +0200 | [diff] [blame] | 139 | set msg [mc "Merge failed. Conflict resolution is required."] |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 140 | } |
| 141 | unlock_index |
Shawn O. Pearce | 699d560 | 2007-07-05 23:16:13 -0400 | [diff] [blame] | 142 | rescan [list ui_status $msg] |
Shawn O. Pearce | ff749c1 | 2007-07-18 02:56:44 -0400 | [diff] [blame] | 143 | delete_this |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 144 | } |
| 145 | |
Shawn O. Pearce | ff749c1 | 2007-07-18 02:56:44 -0400 | [diff] [blame] | 146 | constructor dialog {} { |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 147 | global current_branch |
Pat Thoyts | c80d7be | 2010-01-26 00:05:31 +0000 | [diff] [blame] | 148 | global M1B use_ttk NS |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 149 | |
Shawn O. Pearce | ff749c1 | 2007-07-18 02:56:44 -0400 | [diff] [blame] | 150 | if {![_can_merge $this]} { |
| 151 | delete_this |
| 152 | return |
| 153 | } |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 154 | |
Pat Thoyts | c80d7be | 2010-01-26 00:05:31 +0000 | [diff] [blame] | 155 | make_dialog top w |
Vasco Almeida | a3d97af | 2016-05-08 10:52:57 +0000 | [diff] [blame] | 156 | wm title $top [mc "%s (%s): Merge" [appname] [reponame]] |
Shawn O. Pearce | ff749c1 | 2007-07-18 02:56:44 -0400 | [diff] [blame] | 157 | if {$top ne {.}} { |
| 158 | wm geometry $top "+[winfo rootx .]+[winfo rooty .]" |
| 159 | } |
Shawn O. Pearce | 1fc4ba8 | 2007-05-03 18:21:39 -0400 | [diff] [blame] | 160 | |
Shawn O. Pearce | ff749c1 | 2007-07-18 02:56:44 -0400 | [diff] [blame] | 161 | set _start [cb _start] |
Shawn O. Pearce | ebcaada | 2007-05-05 02:28:41 -0400 | [diff] [blame] | 162 | |
Pat Thoyts | c80d7be | 2010-01-26 00:05:31 +0000 | [diff] [blame] | 163 | ${NS}::label $w.header \ |
Christian Stimming | 1ac1795 | 2007-07-21 14:21:34 +0200 | [diff] [blame] | 164 | -text [mc "Merge Into %s" $current_branch] \ |
Shawn O. Pearce | 1fc4ba8 | 2007-05-03 18:21:39 -0400 | [diff] [blame] | 165 | -font font_uibold |
| 166 | pack $w.header -side top -fill x |
| 167 | |
Pat Thoyts | c80d7be | 2010-01-26 00:05:31 +0000 | [diff] [blame] | 168 | ${NS}::frame $w.buttons |
| 169 | ${NS}::button $w.buttons.visualize \ |
Christian Stimming | 1ac1795 | 2007-07-21 14:21:34 +0200 | [diff] [blame] | 170 | -text [mc Visualize] \ |
Shawn O. Pearce | 9feefbd | 2007-07-25 04:32:18 -0400 | [diff] [blame] | 171 | -command [cb _visualize] |
Shawn O. Pearce | 1fc4ba8 | 2007-05-03 18:21:39 -0400 | [diff] [blame] | 172 | pack $w.buttons.visualize -side left |
Pat Thoyts | c80d7be | 2010-01-26 00:05:31 +0000 | [diff] [blame] | 173 | ${NS}::button $w.buttons.merge \ |
Christian Stimming | 1ac1795 | 2007-07-21 14:21:34 +0200 | [diff] [blame] | 174 | -text [mc Merge] \ |
Shawn O. Pearce | 9feefbd | 2007-07-25 04:32:18 -0400 | [diff] [blame] | 175 | -command $_start |
| 176 | pack $w.buttons.merge -side right |
Pat Thoyts | c80d7be | 2010-01-26 00:05:31 +0000 | [diff] [blame] | 177 | ${NS}::button $w.buttons.cancel \ |
Christian Stimming | 1ac1795 | 2007-07-21 14:21:34 +0200 | [diff] [blame] | 178 | -text [mc "Cancel"] \ |
Shawn O. Pearce | ff749c1 | 2007-07-18 02:56:44 -0400 | [diff] [blame] | 179 | -command [cb _cancel] |
Shawn O. Pearce | 1fc4ba8 | 2007-05-03 18:21:39 -0400 | [diff] [blame] | 180 | pack $w.buttons.cancel -side right -padx 5 |
| 181 | pack $w.buttons -side bottom -fill x -pady 10 -padx 10 |
| 182 | |
Christian Stimming | 1ac1795 | 2007-07-21 14:21:34 +0200 | [diff] [blame] | 183 | set w_rev [::choose_rev::new_unmerged $w.rev [mc "Revision To Merge"]] |
Shawn O. Pearce | 350a35f | 2007-07-25 03:44:50 -0400 | [diff] [blame] | 184 | pack $w.rev -anchor nw -fill both -expand 1 -pady 5 -padx 5 |
Shawn O. Pearce | ebcaada | 2007-05-05 02:28:41 -0400 | [diff] [blame] | 185 | |
| 186 | bind $w <$M1B-Key-Return> $_start |
Shawn O. Pearce | 350a35f | 2007-07-25 03:44:50 -0400 | [diff] [blame] | 187 | bind $w <Key-Return> $_start |
Shawn O. Pearce | ff749c1 | 2007-07-18 02:56:44 -0400 | [diff] [blame] | 188 | bind $w <Key-Escape> [cb _cancel] |
| 189 | wm protocol $w WM_DELETE_WINDOW [cb _cancel] |
Shawn O. Pearce | 9feefbd | 2007-07-25 04:32:18 -0400 | [diff] [blame] | 190 | |
| 191 | bind $w.buttons.merge <Visibility> [cb _visible] |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 192 | tkwait window $w |
| 193 | } |
| 194 | |
Shawn O. Pearce | ff749c1 | 2007-07-18 02:56:44 -0400 | [diff] [blame] | 195 | method _visible {} { |
| 196 | grab $w |
Shawn O. Pearce | 350a35f | 2007-07-25 03:44:50 -0400 | [diff] [blame] | 197 | if {[is_config_true gui.matchtrackingbranch]} { |
| 198 | $w_rev pick_tracking_branch |
| 199 | } |
| 200 | $w_rev focus_filter |
Shawn O. Pearce | ff749c1 | 2007-07-18 02:56:44 -0400 | [diff] [blame] | 201 | } |
| 202 | |
| 203 | method _cancel {} { |
| 204 | wm protocol $w WM_DELETE_WINDOW {} |
| 205 | unlock_index |
| 206 | destroy $w |
| 207 | delete_this |
| 208 | } |
| 209 | |
| 210 | } |
| 211 | |
| 212 | namespace eval merge { |
| 213 | |
Shawn O. Pearce | a6c9b08 | 2007-05-02 13:56:27 -0400 | [diff] [blame] | 214 | proc reset_hard {} { |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 215 | global HEAD commit_type file_states |
| 216 | |
| 217 | if {[string match amend* $commit_type]} { |
Christian Stimming | 1ac1795 | 2007-07-21 14:21:34 +0200 | [diff] [blame] | 218 | info_popup [mc "Cannot abort while amending. |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 219 | |
| 220 | You must finish amending this commit. |
Christian Stimming | 1ac1795 | 2007-07-21 14:21:34 +0200 | [diff] [blame] | 221 | "] |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 222 | return |
| 223 | } |
| 224 | |
| 225 | if {![lock_index abort]} return |
| 226 | |
| 227 | if {[string match *merge* $commit_type]} { |
Christian Stimming | 1ac1795 | 2007-07-21 14:21:34 +0200 | [diff] [blame] | 228 | set op_question [mc "Abort merge? |
Christian Stimming | 360cc10 | 2007-07-28 22:17:10 +0200 | [diff] [blame] | 229 | |
| 230 | Aborting the current merge will cause *ALL* uncommitted changes to be lost. |
| 231 | |
Christian Stimming | 1ac1795 | 2007-07-21 14:21:34 +0200 | [diff] [blame] | 232 | Continue with aborting the current merge?"] |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 233 | } else { |
Christian Stimming | 1ac1795 | 2007-07-21 14:21:34 +0200 | [diff] [blame] | 234 | set op_question [mc "Reset changes? |
Christian Stimming | 360cc10 | 2007-07-28 22:17:10 +0200 | [diff] [blame] | 235 | |
| 236 | Resetting the changes will cause *ALL* uncommitted changes to be lost. |
| 237 | |
Christian Stimming | 1ac1795 | 2007-07-21 14:21:34 +0200 | [diff] [blame] | 238 | Continue with resetting the current changes?"] |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 239 | } |
| 240 | |
Christian Stimming | 360cc10 | 2007-07-28 22:17:10 +0200 | [diff] [blame] | 241 | if {[ask_popup $op_question] eq {yes}} { |
Shawn O. Pearce | 0fe055c | 2007-07-29 04:06:51 -0400 | [diff] [blame] | 242 | set fd [git_read --stderr read-tree --reset -u -v HEAD] |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 243 | fconfigure $fd -blocking 0 -translation binary |
Jonathan Gilbert | d9c6469 | 2019-12-01 02:28:32 +0000 | [diff] [blame] | 244 | set status_bar_operation [$::main_status \ |
| 245 | start \ |
| 246 | [mc "Aborting"] \ |
| 247 | [mc "files reset"] |
| 248 | fileevent $fd readable [namespace code [list \ |
| 249 | _reset_wait $fd $status_bar_operation]] |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 250 | } else { |
| 251 | unlock_index |
| 252 | } |
| 253 | } |
| 254 | |
Jonathan Gilbert | d9c6469 | 2019-12-01 02:28:32 +0000 | [diff] [blame] | 255 | proc _reset_wait {fd status_bar_operation} { |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 256 | global ui_comm |
| 257 | |
Jonathan Gilbert | d9c6469 | 2019-12-01 02:28:32 +0000 | [diff] [blame] | 258 | $status_bar_operation update_meter [read $fd] |
Shawn O. Pearce | 0fe055c | 2007-07-29 04:06:51 -0400 | [diff] [blame] | 259 | |
| 260 | fconfigure $fd -blocking 1 |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 261 | if {[eof $fd]} { |
Shawn O. Pearce | 0fe055c | 2007-07-29 04:06:51 -0400 | [diff] [blame] | 262 | set fail [catch {close $fd} err] |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 263 | unlock_index |
Jonathan Gilbert | d9c6469 | 2019-12-01 02:28:32 +0000 | [diff] [blame] | 264 | $status_bar_operation stop |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 265 | |
| 266 | $ui_comm delete 0.0 end |
| 267 | $ui_comm edit modified false |
| 268 | |
| 269 | catch {file delete [gitdir MERGE_HEAD]} |
| 270 | catch {file delete [gitdir rr-cache MERGE_RR]} |
Johannes Schindelin | f049e09 | 2008-07-12 15:56:59 +0100 | [diff] [blame] | 271 | catch {file delete [gitdir MERGE_RR]} |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 272 | catch {file delete [gitdir SQUASH_MSG]} |
| 273 | catch {file delete [gitdir MERGE_MSG]} |
| 274 | catch {file delete [gitdir GITGUI_MSG]} |
| 275 | |
Shawn O. Pearce | 0fe055c | 2007-07-29 04:06:51 -0400 | [diff] [blame] | 276 | if {$fail} { |
Christian Stimming | 1ac1795 | 2007-07-21 14:21:34 +0200 | [diff] [blame] | 277 | warn_popup "[mc "Abort failed."]\n\n$err" |
Shawn O. Pearce | 0fe055c | 2007-07-29 04:06:51 -0400 | [diff] [blame] | 278 | } |
Christian Stimming | 1ac1795 | 2007-07-21 14:21:34 +0200 | [diff] [blame] | 279 | rescan {ui_status [mc "Abort completed. Ready."]} |
Shawn O. Pearce | 0fe055c | 2007-07-29 04:06:51 -0400 | [diff] [blame] | 280 | } else { |
| 281 | fconfigure $fd -blocking 0 |
Shawn O. Pearce | f522c9b | 2007-05-07 23:35:48 -0400 | [diff] [blame] | 282 | } |
| 283 | } |
Shawn O. Pearce | a6c9b08 | 2007-05-02 13:56:27 -0400 | [diff] [blame] | 284 | |
| 285 | } |