#
#
# patch "lib/perl/Common.pm"
# from [f664db33d3603907d16c4bffe35bb2db6ebb5031]
# to [f518860a5ef672eb6eede246df1250cd76e5287d]
#
# patch "lib/perl/Preferences.pm"
# from [4671f66358132971e299bfb358dfac0eeec1c24f]
# to [c948f20d86d761a439331553dbba6c6d283b688d]
#
# patch "lib/ui/mtn-browse.glade"
# from [5960817326b15c71e60d220a9a17282b74dea08f]
# to [a3bf967092a7b37ea5ed81d21f8fe0c4788490ed]
#
============================================================
--- lib/perl/Common.pm f664db33d3603907d16c4bffe35bb2db6ebb5031
+++ lib/perl/Common.pm f518860a5ef672eb6eede246df1250cd76e5287d
@@ -48,10 +48,10 @@ use warnings;
# ***** GLOBAL DATA DECLARATIONS *****
-# Constants for various parameters used in detecting binary data.
+# Constant for the size, in bytes, that data is chopped into when detecting
+# binary data.
use constant CHUNK_SIZE => 10240;
-use constant THRESHOLD => 20;
# Constant used to represent the exception thrown when interrupting waitpid().
@@ -1729,8 +1729,11 @@ sub data_is_binary($)
$chunk = substr($$data, $offset, CHUNK_SIZE);
$offset += CHUNK_SIZE;
$length = length($chunk);
- $non_printable = grep(/[^[:print:][:space:]]/, split(//, $chunk));
- return 1 if (((100 * $non_printable) / $length) > THRESHOLD);
+ $non_printable =
+ scalar(grep(/[^[:print:][:space:]]/, split(//, $chunk)));
+ return 1
+ if (((100 * $non_printable) / $length)
+ > $user_preferences->{binary_threshold});
}
return;
============================================================
--- lib/perl/Preferences.pm 4671f66358132971e299bfb358dfac0eeec1c24f
+++ lib/perl/Preferences.pm c948f20d86d761a439331553dbba6c6d283b688d
@@ -458,12 +458,13 @@ sub defaults_button_clicked_cb($$)
"auto_select_head",
"query",
"history_size",
+ "static_lists",
+ "completion_tooltips",
"show_suspended",
"show_file_details",
"folders_come_first",
"show_line_numbers",
- "static_lists",
- "completion_tooltips",
+ "binary_threshold",
"list_search_as_re",
"diffs_application");
}
@@ -1039,12 +1040,13 @@ sub get_preferences_window($$)
"id_lists_sort_chronologically_radiobutton",
"id_lists_sort_by_id_radiobutton",
"history_size_spinbutton",
+ "static_lists_checkbutton",
+ "show_tooltips_checkbutton",
"show_suspended_revisions_checkbutton",
"detailed_file_listing_checkbutton",
"folders_come_first_checkbutton",
"show_line_numbers_checkbutton",
- "static_lists_checkbutton",
- "show_completion_tooltips_checkbutton",
+ "binary_threshold_spinbutton",
"search_as_regular_expression_checkbutton",
"external_diffs_app_entry",
@@ -1282,6 +1284,11 @@ sub load_preferences_into_gui($)
}
$instance->{history_size_spinbutton}->
set_value($instance->{preferences}->{history_size});
+ $instance->{static_lists_checkbutton}->
+ set_active($instance->{preferences}->{static_lists} ? TRUE : FALSE);
+ $instance->{show_tooltips_checkbutton}->
+ set_active($instance->{preferences}->{completion_tooltips} ?
+ TRUE : FALSE);
$instance->{show_suspended_revisions_checkbutton}->
set_active($instance->{preferences}->{show_suspended} ? TRUE : FALSE);
$instance->{detailed_file_listing_checkbutton}->
@@ -1293,11 +1300,8 @@ sub load_preferences_into_gui($)
$instance->{show_line_numbers_checkbutton}->
set_active($instance->{preferences}->{show_line_numbers} ?
TRUE : FALSE);
- $instance->{static_lists_checkbutton}->
- set_active($instance->{preferences}->{static_lists} ? TRUE : FALSE);
- $instance->{show_completion_tooltips_checkbutton}->
- set_active($instance->{preferences}->{completion_tooltips} ?
- TRUE : FALSE);
+ $instance->{binary_threshold_spinbutton}->
+ set_value($instance->{preferences}->{binary_threshold});
$instance->{search_as_regular_expression_checkbutton}->
set_active($instance->{preferences}->{list_search_as_re} ?
TRUE : FALSE);
@@ -1477,6 +1481,10 @@ sub save_preferences_from_gui($)
$instance->{history_size_spinbutton}->update();
$instance->{preferences}->{history_size} =
$instance->{history_size_spinbutton}->get_value_as_int();
+ $instance->{preferences}->{static_lists} =
+ $instance->{static_lists_checkbutton}->get_active() ? 1 : 0;
+ $instance->{preferences}->{completion_tooltips} =
+ $instance->{show_tooltips_checkbutton}->get_active() ? 1 : 0;
$instance->{preferences}->{show_suspended} =
$instance->{show_suspended_revisions_checkbutton}->get_active() ?
1 : 0;
@@ -1486,11 +1494,9 @@ sub save_preferences_from_gui($)
$instance->{folders_come_first_checkbutton}->get_active() ? 1 : 0;
$instance->{preferences}->{show_line_numbers} =
$instance->{show_line_numbers_checkbutton}->get_active() ? 1 : 0;
- $instance->{preferences}->{static_lists} =
- $instance->{static_lists_checkbutton}->get_active() ? 1 : 0;
- $instance->{preferences}->{completion_tooltips} =
- $instance->{show_completion_tooltips_checkbutton}->get_active() ?
- 1 : 0;
+ $instance->{binary_threshold_spinbutton}->update();
+ $instance->{preferences}->{binary_threshold} =
+ $instance->{binary_threshold_spinbutton}->get_value_as_int();
$instance->{preferences}->{list_search_as_re} =
$instance->{search_as_regular_expression_checkbutton}->get_active() ?
1 : 0;
@@ -1687,6 +1693,7 @@ sub upgrade_preferences($)
{
$preferences->{folders_come_first} = 1;
$preferences->{completion_tooltips} = 1;
+ $preferences->{binary_threshold} = 20;
$preferences->{version} = 10;
}
@@ -1727,12 +1734,13 @@ sub initialise_preferences()
id => {limit => 200,
sort_chronologically => 1}},
history_size => 20,
+ static_lists => 0,
+ completion_tooltips => 1,
show_suspended => 0,
show_file_details => 1,
folders_come_first => 1,
show_line_numbers => 0,
- static_lists => 0,
- completion_tooltips => 1,
+ binary_threshold => 20,
list_search_as_re => 0,
diffs_application => FILE_COMPARE_CMD . " '{file1}' '{file2}'",
fixed_font => "monospace 10",
============================================================
--- lib/ui/mtn-browse.glade 5960817326b15c71e60d220a9a17282b74dea08f
+++ lib/ui/mtn-browse.glade a3bf967092a7b37ea5ed81d21f8fe0c4788490ed
@@ -4529,7 +4529,7 @@ search patterns
GTK_WIN_POS_CENTER_ON_PARENT
False
970
- 495
+ 550
True
False
mtn-browse.png
@@ -4939,7 +4939,7 @@ by their tags)
5
True
- 3
+ 4
4
False
5
@@ -4997,7 +4997,7 @@ the most recent, 0 = unlimited)GTK_JUSTIFY_LEFT
False
False
- 0.5
+ 0
0.5
0
0
@@ -5321,7 +5321,7 @@ history stored in ComboBox menusTrue
1
0
- False
+ True
GTK_UPDATE_ALWAYS
False
False
@@ -5336,6 +5336,101 @@ history stored in ComboBox menus
+
+
+
+ True
+ False
+ 5
+
+
+
+ True
+ Select this if you do not want the
+branch and revision ComboBox entry
+lists to update as you type in values
+(can help with speed when dealing
+with large lists)
+ True
+ Static lists
+ True
+ GTK_RELIEF_NORMAL
+ True
+ False
+ False
+ True
+
+
+ 0
+ False
+ False
+
+
+
+
+
+ True
+ Select this if you want feedback in the
+form of special tooltips when typing in
+values into ComboBox entry fields
+ True
+ Show tooltips
+ True
+ GTK_RELIEF_NORMAL
+ True
+ False
+ False
+ True
+
+
+ 0
+ False
+ False
+
+
+
+
+ 1
+ 4
+ 3
+ 4
+ fill
+
+
+
+
+
+ True
+ Settings for controlling the behaviour of
+auto-completion in ComboBox entry fields
+ True
+ False
+
+
+
+ True
+ Auto-completion:
+ False
+ False
+ GTK_JUSTIFY_LEFT
+ False
+ False
+ 0
+ 0.5
+ 0
+ 0
+
+
+
+
+ 0
+ 1
+ 3
+ 4
+ fill
+ fill
+
+
@@ -5387,38 +5482,44 @@ history stored in ComboBox menus0
-
+
5
True
False
5
-
+
True
- Select this if you want suspended
+ False
+ 5
+
+
+
+ True
+ Select this if you want suspended
revisions and their related branches
to be displayed
- True
- Show suspended revisions
- True
- GTK_RELIEF_NORMAL
- True
- False
- False
- True
-
-
- 0
- False
- False
-
-
+ True
+ Show suspended revisions
+ True
+ GTK_RELIEF_NORMAL
+ True
+ False
+ False
+ True
+
+
+ 0
+ False
+ False
+
+
-
-
- True
- Select this if you want a file's
+
+
+ True
+ Select this if you want a file's
latest modification time and
author to be displayed
alongside the file name
@@ -5428,108 +5529,153 @@ that you are using
performance penalty depending
upon the version of Monotone
that you are using
- True
- Detailed file listings
- True
- GTK_RELIEF_NORMAL
- True
- False
- False
- True
-
-
- 0
- False
- False
-
-
+ True
+ Detailed file listings
+ True
+ GTK_RELIEF_NORMAL
+ True
+ False
+ False
+ True
+
+
+ 0
+ False
+ False
+
+
-
-
- True
- Select this if you want all folders
+
+
+ True
+ Select this if you want all folders
to be listed before any files
- True
- Folders come first
- True
- GTK_RELIEF_NORMAL
- True
- False
- False
- True
-
-
- 0
- False
- False
-
-
+ True
+ Folders come first
+ True
+ GTK_RELIEF_NORMAL
+ True
+ False
+ False
+ True
+
+
+ 0
+ False
+ False
+
+
-
-
- True
- Select this if you want line numbers
+
+
+ True
+ Select this if you want line numbers
to be shown in file listings by default
- True
- Show line numbers
- True
- GTK_RELIEF_NORMAL
- True
- False
- False
- True
+ True
+ Show line numbers
+ True
+ GTK_RELIEF_NORMAL
+ True
+ False
+ False
+ True
+
+
+ 0
+ False
+ False
+
+
0
- False
- False
+ True
+ True
-
+
True
- Select this if you do not want the
-branch and revision combobox entry
-lists to update as you type in values
-(can help with speed when dealing
-with large lists)
- True
- Static completion lists
- True
- GTK_RELIEF_NORMAL
- True
- False
- False
- True
-
-
- 0
- False
- False
-
-
+ False
+ 5
-
-
- True
- Select this if you want feedback in the
-form of special tooltips when typing in
-values into either the branch or revision
-combobox entry fields
- True
- Show completion tooltips
- True
- GTK_RELIEF_NORMAL
- True
- False
- False
- True
+
+
+ True
+ The binary threshold, above which
+a file's contents are considered to be
+binary in nature
+ True
+ False
+
+
+
+ True
+ Binary threshold:
+ False
+ False
+ GTK_JUSTIFY_LEFT
+ False
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+
+
+
+
+ 0
+ False
+ True
+
+
+
+
+
+ True
+ True
+ 1
+ 0
+ True
+ GTK_UPDATE_ALWAYS
+ False
+ False
+ 1 0 100 1 10 0
+
+
+ 0
+ False
+ True
+
+
+
+
+
+ True
+ %
+ False
+ False
+ GTK_JUSTIFY_LEFT
+ False
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+
+
+ 0
+ False
+ False
+
+
0
- False
- False
+ True
+ True