#
#
# patch "mtn-browse"
# from [ef3dec36196d4a756d6cbc96976bb635b256df5d]
# to [2f9cc86df7157a7eb26bb354b04a351da03c4054]
#
# patch "mtn-browse.glade"
# from [063bb2f85f9b906321f07e8b30ebd1d0c1eb6eff]
# to [f9bea6f7182a5d136274863c36fbe4101e582772]
#
============================================================
--- mtn-browse ef3dec36196d4a756d6cbc96976bb635b256df5d
+++ mtn-browse 2f9cc86df7157a7eb26bb354b04a351da03c4054
@@ -208,15 +208,16 @@ sub directory_up_button_clicked_cb($$);
sub delete_event_cb($$$);
sub destroy_event_cb($$;$);
sub directory_up_button_clicked_cb($$);
-sub file_change_log_button_clicked_cb($$);
+sub file_change_history_button_clicked_cb($$);
sub file_comparison_combobox_changed_cb($$);
-sub generate_revision_report($$$;$);
+sub generate_revision_report($$$$;$);
sub get_change_log_window();
sub get_completion($$$$;$);
sub get_dir_contents($$$);
sub get_file_history_helper($$$);
sub get_history_window();
sub get_revision_comparison_window();
+sub get_revision_history_helper($$$);
sub get_revision_ids($$);
sub gtk2_update();
sub history_list_button_clicked_cb($$);
@@ -227,6 +228,8 @@ sub populate_button_clicked_cb($$);
sub mtn_error_handler($$);
sub new_browser_instance();
sub populate_button_clicked_cb($$);
+sub revision_change_history_button_clicked_cb($$);
+sub revision_change_log_button_clicked_cb($$);
sub revisions_treeview_cursor_changed_cb($$);
sub revisions_treeview_row_activated_cb($$$$);
sub run_command($@);
@@ -234,7 +237,6 @@ sub simple_query_radiobutton_toggled_cb(
sub setup_sigchld_handler($);
sub sigchld_handler();
sub simple_query_radiobutton_toggled_cb($$);
-sub revision_change_log_button_clicked_cb($$);
sub term_combobox_changed_cb($$);
sub update_advanced_find_state($$);
sub update_browser_state($$);
@@ -596,6 +598,190 @@ sub advanced_find_button_clicked_cb($$)
#
##############################################################################
#
+# Routine - revision_change_history_button_clicked_cb
+#
+# Description - Callback routine called when the user clicks on the
+# revision change history button in a main browser window.
+#
+# Data - $widget : The widget object that received the signal.
+# $browser : The browser instance that is associated with
+# this widget.
+#
+##############################################################################
+
+
+
+sub revision_change_history_button_clicked_cb($$)
+{
+
+ my($widget, $browser) = @_;
+
+ return if ($browser->{in_cb});
+ local $browser->{in_cb} = 1;
+
+ my ($button,
+ @certs_list,
+ $counter,
+ $file_name,
+ %history_hash,
+ $instance,
+ @revision_ids);
+
+ $instance = get_history_window();
+ local $instance->{in_cb} = 1;
+
+ $instance->{mtn} = $browser->{mtn};
+ $instance->{file_name} = undef;
+ get_revision_ids($browser, address@hidden);
+ $instance->{first_revision_id} = "";
+ $instance->{second_revision_id} = "";
+ $instance->{window}->set_title("Revision History For " . $revision_ids[0]);
+ $instance->{history_label}->set_markup("Revision History");
+ $instance->{window}->show_all();
+
+ make_busy($instance, 1);
+ $instance->{appbar}->push("");
+ gtk2_update();
+
+ $instance->{stop_button}->set_sensitive(TRUE);
+
+ # Get the list of file change revisions. Remember to include the current
+ # revision in the history.
+
+ $instance->{appbar}->set_progress_percentage(0);
+ $instance->{appbar}->set_status("Fetching revision list");
+ gtk2_update();
+ $history_hash{$revision_ids[0]} = 1;
+ get_revision_history_helper($instance, \%history_hash, $revision_ids[0]);
+
+ # Sort the list.
+
+ $instance->{appbar}->set_status("Sorting revision list");
+ gtk2_update();
+ $instance->{history} = [];
+ $instance->{mtn}->toposort($instance->{history}, keys(%history_hash));
+ %history_hash = ();
+ @{$instance->{history}} = reverse(@{$instance->{history}});
+
+ # Display the file's history.
+
+ $instance->{appbar}->set_progress_percentage(0);
+ $instance->{appbar}->set_status("Displaying file history");
+ gtk2_update();
+ $counter = 1;
+ $instance->{stop} = 0;
+ $instance->{history_buffer}->set_text("");
+ for my $revision_id (@{$instance->{history}})
+ {
+
+ # Print out the revision summary.
+
+ $instance->{mtn}->certs(address@hidden, $revision_id);
+ generate_revision_report($instance->{history_buffer},
+ $revision_id,
+ address@hidden,
+ "");
+ $instance->{history_buffer}->
+ insert($instance->{history_buffer}->get_end_iter(), "\n\n ");
+
+ # Add the buttons.
+
+ $button = Gtk2::Button->new("Select As Revision 1");
+ $button->signal_connect("clicked",
+ \&history_list_button_clicked_cb,
+ {instance => $instance,
+ revision_id => $revision_id,
+ button_type => "1"});
+ $tooltips->set_tip($button,
+ "Select this revision for comparison\n"
+ . "as the first revision");
+ $instance->{history_textview}->add_child_at_anchor
+ ($button,
+ $instance->{history_buffer}->
+ create_child_anchor($instance->{history_buffer}->
+ get_end_iter()));
+ $button->show_all();
+ $instance->{history_buffer}->
+ insert($instance->{history_buffer}->get_end_iter(), " ");
+
+ $button = Gtk2::Button->new("Select As Revision 2");
+ $button->signal_connect("clicked",
+ \&history_list_button_clicked_cb,
+ {instance => $instance,
+ revision_id => $revision_id,
+ button_type => "2"});
+ $tooltips->set_tip($button,
+ "Select this revision for comparison\n"
+ . "as the second revision");
+ $instance->{history_textview}->add_child_at_anchor
+ ($button,
+ $instance->{history_buffer}->
+ create_child_anchor($instance->{history_buffer}->
+ get_end_iter()));
+ $button->show_all();
+ $instance->{history_buffer}->
+ insert($instance->{history_buffer}->get_end_iter(), " ");
+
+ $button = Gtk2::Button->new("View Full Revision Change Log");
+ $button->signal_connect("clicked",
+ \&history_list_button_clicked_cb,
+ {instance => $instance,
+ revision_id => $revision_id,
+ button_type => "revision-changelog"});
+ $tooltips->set_tip($button, "View the revision's full change log");
+ $instance->{history_textview}->add_child_at_anchor
+ ($button,
+ $instance->{history_buffer}->
+ create_child_anchor($instance->{history_buffer}->
+ get_end_iter()));
+ $button->show_all();
+
+ # Stop if the user wants to.
+
+ last if ($instance->{stop});
+
+ # If we aren't at the end, print out the revision separator.
+
+ if ($counter < scalar(@{$instance->{history}}))
+ {
+ $instance->{history_buffer}->
+ insert($instance->{history_buffer}->get_end_iter(), "\n");
+ $instance->{history_buffer}->
+ insert_pixbuf($instance->{history_buffer}->get_end_iter(),
+ $line_image);
+ $instance->{history_buffer}->
+ insert($instance->{history_buffer}->get_end_iter(), "\n");
+ }
+
+ if ($counter % 100 == 0)
+ {
+ $instance->{appbar}->set_progress_percentage
+ ($counter / scalar(@{$instance->{history}}));
+ gtk2_update();
+ }
+ ++ $counter;
+
+ }
+
+ $instance->{stop_button}->set_sensitive(FALSE);
+ set_label_value($instance->{numbers_label}, $counter)
+ if ($instance->{stop});
+
+ # Make sure we are at the top.
+
+ $instance->{history_scrolledwindow}->get_vadjustment()->set_value(0);
+ $instance->{history_scrolledwindow}->get_hadjustment()->set_value(0);
+ $instance->{appbar}->set_progress_percentage(0);
+ $instance->{appbar}->set_status("");
+ gtk2_update();
+
+ $instance->{appbar}->pop();
+ make_busy($instance, 0);
+
+}
+#
+##############################################################################
+#
# Routine - revision_change_log_button_clicked_cb
#
# Description - Callback routine called when the user clicks on the
@@ -638,6 +824,7 @@ sub revision_change_log_button_clicked_c
generate_revision_report($instance->{changelog_buffer},
$revision_ids[0],
address@hidden,
+ "",
address@hidden);
if ($instance->{changelog_scrolledwindow}->realized())
{
@@ -717,10 +904,10 @@ sub directory_up_button_clicked_cb($$)
#
##############################################################################
#
-# Routine - file_change_log_button_clicked_cb
+# Routine - file_change_history_button_clicked_cb
#
# Description - Callback routine called when the user clicks on the file
-# change log button in a main browser window.
+# change history button in a main browser window.
#
# Data - $widget : The widget object that received the signal.
# $browser : The browser instance that is associated with
@@ -730,7 +917,7 @@ sub directory_up_button_clicked_cb($$)
-sub file_change_log_button_clicked_cb($$)
+sub file_change_history_button_clicked_cb($$)
{
my($widget, $browser) = @_;
@@ -802,7 +989,8 @@ sub file_change_log_button_clicked_cb($$
$instance->{mtn}->certs(address@hidden, $revision_id);
generate_revision_report($instance->{history_buffer},
$revision_id,
- address@hidden);
+ address@hidden,
+ "");
$instance->{history_buffer}->
insert($instance->{history_buffer}->get_end_iter(), "\n\n ");
@@ -813,7 +1001,7 @@ sub file_change_log_button_clicked_cb($$
\&history_list_button_clicked_cb,
{instance => $instance,
revision_id => $revision_id,
- button_type => "file-1"});
+ button_type => "1"});
$tooltips->set_tip($button,
"Select this file revision for\n"
. "comparison as the first file");
@@ -831,7 +1019,7 @@ sub file_change_log_button_clicked_cb($$
\&history_list_button_clicked_cb,
{instance => $instance,
revision_id => $revision_id,
- button_type => "file-2"});
+ button_type => "2"});
$tooltips->set_tip($button,
"Select this file revision for\n"
. "comparison as the second file");
@@ -844,13 +1032,13 @@ sub file_change_log_button_clicked_cb($$
$instance->{history_buffer}->
insert($instance->{history_buffer}->get_end_iter(), " ");
- $button = Gtk2::Button->new("Full Revision Change Log");
+ $button = Gtk2::Button->new("View Full Revision Change Log");
$button->signal_connect("clicked",
\&history_list_button_clicked_cb,
{instance => $instance,
revision_id => $revision_id,
button_type => "revision-changelog"});
- $tooltips->set_tip($button, "View the revision's change log");
+ $tooltips->set_tip($button, "View the revision's full change log");
$instance->{history_textview}->add_child_at_anchor
($button,
$instance->{history_buffer}->
@@ -1338,10 +1526,9 @@ sub history_list_button_clicked_cb($$)
return if ($instance->{in_cb});
local $instance->{in_cb} = 1;
- if ($details->{button_type} eq "file-1"
- || $details->{button_type} eq "file-2")
+ if ($details->{button_type} eq "1" || $details->{button_type} eq "2")
{
- if ($details->{button_type} eq "file-1")
+ if ($details->{button_type} eq "1")
{
$instance->{first_revision_id} = $revision_id;
set_label_value($instance->{revision_id_1_label}, $revision_id);
@@ -1389,6 +1576,7 @@ sub history_list_button_clicked_cb($$)
generate_revision_report($cl_instance->{changelog_buffer},
$revision_id,
address@hidden,
+ "",
address@hidden);
if ($cl_instance->{changelog_scrolledwindow}->realized())
{
@@ -1507,6 +1695,7 @@ sub coloured_revision_change_log_button_
my(@certs_list,
$cl_instance,
+ $colour,
@revision_details,
$revision_id);
@@ -1515,10 +1704,12 @@ sub coloured_revision_change_log_button_
if ($widget == $instance->{red_revision_button})
{
$revision_id = $instance->{red_revision_id};
+ $colour = "red";
}
else
{
$revision_id = $instance->{green_revision_id};
+ $colour = "green";
}
# Display the full revision change log.
@@ -1531,6 +1722,7 @@ sub coloured_revision_change_log_button_
generate_revision_report($cl_instance->{changelog_buffer},
$revision_id,
address@hidden,
+ $colour,
address@hidden);
if ($cl_instance->{changelog_scrolledwindow}->realized())
{
@@ -1711,7 +1903,7 @@ sub new_browser_instance()
$browser->{glade}->get_widget($item . "_button"));
}
$browser->{revision_sensitive_group} = ();
- foreach my $item ("revision_change_log", "revision_compare")
+ foreach my $item ("revision_change_history", "revision_change_log")
{
push(@{$browser->{revision_sensitive_group}},
$browser->{glade}->get_widget($item . "_button"));
@@ -2411,11 +2603,11 @@ sub get_file_history_helper($$$)
my($instance, $hash, $revision_id) = @_;
+ return if ($instance->{stop});
+
my(@change_parents,
@parents);
- return if ($instance->{stop});
-
$instance->{mtn}->get_content_changed(address@hidden,
$revision_id,
$instance->{file_name});
@@ -2439,6 +2631,46 @@ sub get_file_history_helper($$$)
#
##############################################################################
#
+# Routine - get_revision_history_helper
+#
+# Description - Recursive routine for getting the revisions in a revision's
+# change history.
+#
+# Data - $instance : The revision history window instance.
+# $hash : A reference to a hash that is to contain the
+# list of revision ids.
+# $revision_id : The revision id from where the search is to
+# commence.
+#
+##############################################################################
+
+
+
+sub get_revision_history_helper($$$)
+{
+
+ my($instance, $hash, $revision_id) = @_;
+
+ return if ($instance->{stop});
+
+ my @parents;
+
+ $instance->{mtn}->parents(address@hidden, $revision_id);
+ foreach my $parent (@parents)
+ {
+ if (! exists($hash->{$parent}))
+ {
+ $hash->{$parent} = 1;
+ set_label_value($instance->{numbers_label}, scalar(keys(%$hash)));
+ gtk2_update();
+ get_revision_history_helper($instance, $hash, $parent);
+ }
+ }
+
+}
+#
+##############################################################################
+#
# Routine - get_revision_comparison_window
#
# Description - Creates or prepares an existing revision comparison window
@@ -2863,6 +3095,8 @@ sub compare_revisions($$$;$)
# on.
# $certs_list : A reference to a certs list as returned
# by $mtn->certs().
+# $colour : One of "red, "green" or "" depending
+# upon the desired colour of the text.
# $revision_details : Either a reference to a revision
# details list as returned by
# $mtn->get_revision() if a detailed
@@ -2873,13 +3107,17 @@ sub compare_revisions($$$;$)
-sub generate_revision_report($$$;$)
+sub generate_revision_report($$$$;$)
{
- my($text_buffer, $revision_id, $certs_list, $revision_details) = @_;
+ my($text_buffer, $revision_id, $certs_list, $colour, $revision_details)
+ = @_;
- my($change_log,
+ my($bold,
+ $change_log,
+ $italics,
$manifest_id,
+ $normal,
@parent_revision_ids,
%revision_data,
%seen,
@@ -2887,13 +3125,29 @@ sub generate_revision_report($$$;$)
my @types =
("Added", "Removed", "Changed", "Renamed", "Attributes");
+ # Sort out colour attributes.
+
+ if ($colour ne "")
+ {
+ $normal = $colour;
+ $bold = "bold-" . $colour;
+ $italics = "italics-" . $colour;
+ }
+ else
+ {
+ $normal = "normal";
+ $bold = "bold";
+ $italics = "italics";
+ }
+
# Revision id.
$text_buffer->insert_with_tags_by_name($text_buffer->get_end_iter(),
"Revision id: ",
- "bold");
- $text_buffer->insert($text_buffer->get_end_iter(),
- $revision_id . "\n\n");
+ $bold);
+ $text_buffer->insert_with_tags_by_name($text_buffer->get_end_iter(),
+ $revision_id . "\n\n",
+ $normal);
# Certs.
@@ -2910,18 +3164,22 @@ sub generate_revision_report($$$;$)
$text_buffer->insert_with_tags_by_name
($text_buffer->get_end_iter(),
sprintf("%s:\t", ucfirst($cert->{name})),
- "bold");
- $text_buffer->insert($text_buffer->get_end_iter(),
- sprintf("%s\n", $cert->{value}));
+ $bold);
+ $text_buffer->insert_with_tags_by_name
+ ($text_buffer->get_end_iter(),
+ sprintf("%s\n", $cert->{value}),
+ $normal);
}
}
# Change log.
- $text_buffer->insert_with_tags_by_name
- ($text_buffer->get_end_iter(), "\nChange Log:\n", "bold");
- $text_buffer->insert($text_buffer->get_end_iter(),
- sprintf("%s", $change_log));
+ $text_buffer->insert_with_tags_by_name($text_buffer->get_end_iter(),
+ "\nChange Log:\n",
+ $bold);
+ $text_buffer->insert_with_tags_by_name($text_buffer->get_end_iter(),
+ sprintf("%s", $change_log),
+ $normal);
# The rest is only provided if it is a detailed report.
@@ -2931,7 +3189,8 @@ sub generate_revision_report($$$;$)
# Revision details.
$text_buffer->insert_with_tags_by_name($text_buffer->get_end_iter(),
- "\n\nChanges Made:\n", "bold");
+ "\n\nChanges Made:\n",
+ $bold);
foreach my $type (@types)
{
$revision_data{$type} = [];
@@ -2989,14 +3248,17 @@ sub generate_revision_report($$$;$)
{
$text_buffer->insert_with_tags_by_name
($text_buffer->get_end_iter(),
- " " . $type . ":\n", "italics");
+ " " . $type . ":\n",
+ $italics);
%seen = ();
@unique = sort(grep { ! $seen{$_} ++ }
@{$revision_data{$type}});
foreach my $line (@unique)
{
- $text_buffer->insert($text_buffer->get_end_iter(),
- "\t" . $line . "\n");
+ $text_buffer->insert_with_tags_by_name
+ ($text_buffer->get_end_iter(),
+ "\t" . $line . "\n",
+ $normal);
}
}
}
@@ -3005,13 +3267,17 @@ sub generate_revision_report($$$;$)
$text_buffer->insert_with_tags_by_name($text_buffer->get_end_iter(),
"\nParent revision id(s):\t",
- "bold");
- $text_buffer->insert($text_buffer->get_end_iter(),
- join(" ", @parent_revision_ids) . "\n");
+ $bold);
+ $text_buffer->insert_with_tags_by_name
+ ($text_buffer->get_end_iter(),
+ join(" ", @parent_revision_ids) . "\n",
+ $normal);
$text_buffer->insert_with_tags_by_name($text_buffer->get_end_iter(),
"Manifest id:\t\t",
- "bold");
- $text_buffer->insert($text_buffer->get_end_iter(), $manifest_id);
+ $bold);
+ $text_buffer->insert_with_tags_by_name($text_buffer->get_end_iter(),
+ $manifest_id,
+ $normal);
}
@@ -3930,6 +4196,7 @@ sub update_advanced_find_state($$)
($advanced_find->{details_buffer},
$advanced_find->{revisions_treeview_details}->{value},
address@hidden,
+ "",
address@hidden);
# Scroll back up to the top left.
@@ -4651,14 +4918,42 @@ sub create_format_tags($)
my ($text_buffer) = @_;
+ $text_buffer->create_tag("normal", "weight" => PANGO_WEIGHT_NORMAL);
+
$text_buffer->create_tag("bold", "weight" => PANGO_WEIGHT_BOLD);
$text_buffer->create_tag("italics", "style" => "italic");
$text_buffer->create_tag("bold-italics",
"weight" => PANGO_WEIGHT_BOLD,
"style" => "italic");
+
+ $text_buffer->create_tag("green", "foreground" => "DarkGreen");
+ $text_buffer->create_tag("bold-green",
+ "weight" => PANGO_WEIGHT_BOLD,
+ "foreground" => "DarkGreen");
+ $text_buffer->create_tag("italics-green",
+ "style" => "italic",
+ "foreground" => "DarkGreen");
+ $text_buffer->create_tag("bold-italics-green",
+ "weight" => PANGO_WEIGHT_BOLD,
+ "style" => "italic",
+ "foreground" => "DarkGreen");
+
+ $text_buffer->create_tag("red", "foreground" => "DarkRed");
+ $text_buffer->create_tag("bold-red",
+ "weight" => PANGO_WEIGHT_BOLD,
+ "foreground" => "DarkRed");
+ $text_buffer->create_tag("italics-red",
+ "style" => "italic",
+ "foreground" => "DarkRed");
+ $text_buffer->create_tag("bold-italics-red",
+ "weight" => PANGO_WEIGHT_BOLD,
+ "style" => "italic",
+ "foreground" => "DarkRed");
+
$text_buffer->create_tag("compare-info",
"foreground" => "Yellow",
"background" => "LightSlateGrey");
+
$text_buffer->create_tag("compare-first-file",
"foreground" => "DarkRed",
"background" => "MistyRose1");
@@ -4666,6 +4961,7 @@ sub create_format_tags($)
"weight" => PANGO_WEIGHT_BOLD,
"foreground" => "IndianRed1",
"background" => "DarkSlateGrey");
+
$text_buffer->create_tag("compare-second-file",
"foreground" => "DarkGreen",
"background" => "DarkSeaGreen1");
============================================================
--- mtn-browse.glade 063bb2f85f9b906321f07e8b30ebd1d0c1eb6eff
+++ mtn-browse.glade f9bea6f7182a5d136274863c36fbe4101e582772
@@ -549,13 +549,13 @@ criteria for selecting a revision
-
+
True
- View the revision's change log
+ View revision's change history
True
GTK_RELIEF_NORMAL
True
-
+
@@ -577,18 +577,18 @@ criteria for selecting a revision
-
+
True
- Compare revision contents
-with another revision
+ View revision's change log
True
GTK_RELIEF_NORMAL
True
+
-
+
True
- gnome-stock-multiple-file
+ gtk-dnd
4
0.5
0.5
@@ -1422,13 +1422,13 @@ into a viewer
-
+
True
- View file's change log
+ View file's change history
True
GTK_RELIEF_NORMAL
True
-
+
@@ -3354,7 +3354,7 @@ Tag
True
1
1
- 0 0 327 10 294.3 327
+ 0 0 356 10 320.4 356
0 0 17 10 15.3 17
@@ -3445,12 +3445,22 @@ Tag
True
False
- Stop gathering the file history
+ Stop gathering history details
True
- gtk-stop
- True
GTK_RELIEF_NORMAL
True
+
+
+
+ True
+ gtk-stop
+ 4
+ 0.5
+ 0.5
+ 0
+ 0
+
+
0