diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2008-08-31 01:02:56 +0400 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2008-09-04 21:28:55 -0700 |
commit | 29853b901045ff09ac8e5b48a01ebbc96fa4874d (patch) | |
tree | 1415eb26dff3d22037f5a51404ac9e892a200721 /lib/mergetool.tcl | |
parent | ff515d81faa22f26b611ed7fd06a76d0c300ea39 (diff) | |
download | git-29853b901045ff09ac8e5b48a01ebbc96fa4874d.tar.gz git-29853b901045ff09ac8e5b48a01ebbc96fa4874d.tar.xz |
git-gui: Reimplement and enhance auto-selection of diffs.
Generalize the next_diff system, and implement auto-reselection
for merge tool resolution and reshow_diff. Also add auto-selection
of diffs after rescan, if no diff is already selected.
New auto-select rules:
- Rescan auto-selects the first conflicting file, or if none
a modified tracked file, if nothing was selected previously.
- Resolving a conflict auto-selects the nearest conflicting
file, or nothing if everything is resolved.
- Staging the last remaining hunk auto-selects the nearest
modified staged file.
- Staging a file through its icon auto-selects the nearest file.
Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'lib/mergetool.tcl')
-rw-r--r-- | lib/mergetool.tcl | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/mergetool.tcl b/lib/mergetool.tcl index 5f3da1f62..79c58bc7b 100644 --- a/lib/mergetool.tcl +++ b/lib/mergetool.tcl @@ -24,13 +24,9 @@ This operation can be undone only by restarting the merge." \ } proc merge_add_resolution {path} { - global current_diff_path + global current_diff_path ui_workdir - if {$path eq $current_diff_path} { - set after {reshow_diff;} - } else { - set after {} - } + set after [next_diff_after_action $ui_workdir $path {} {^_?U}] update_index \ [mc "Adding resolution for %s" [short_path $path]] \ |