# # # patch "ChangeLog.pm" # from [054ad90d7efd653ff90645877fab463ad421cec1] # to [c0f0ea6467e27326a2467c53d8a3b1aa27d67c21] # # patch "Utilities.pm" # from [4fb372a8b2cfc16d2b745675019155a658dcb84a] # to [9f25e1efc39b0744b8142f40c54599cbc69c8932] # # patch "mtn-browse" # from [3a1bf85b64af0fe8483e0d04eae892696f5a6e86] # to [55cee1941e1f123e780d00481d07f821c3f8c84f] # # patch "mtn-browse.glade" # from [c97a54698dfe63c8cd37fba291b6ec8369ffede6] # to [63cdeb4f97a048f4f8e34310956b7a81c413e920] # ============================================================ --- ChangeLog.pm 054ad90d7efd653ff90645877fab463ad421cec1 +++ ChangeLog.pm c0f0ea6467e27326a2467c53d8a3b1aa27d67c21 @@ -49,6 +49,7 @@ sub display_change_log($$;$$); # Public routines. sub display_change_log($$;$$); +sub generate_revision_report($$$$;$); # Private routines. @@ -108,6 +109,219 @@ sub display_change_log($$;$$) # ############################################################################## # +# Routine - generate_revision_report +# +# Description - Populate the specified Gtk2::TextBuffer with a pretty +# printed report on the specified revision. +# +# Data - $text_buffer : The Gtk2::TextBuffer that is to be +# populated. +# $revision_id : The id of the revision being reported +# 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 +# report is to be generated or undef if +# the report is to just be a summary. +# +############################################################################## + + + +sub generate_revision_report($$$$;$) +{ + + my($text_buffer, $revision_id, $certs_list, $colour, $revision_details) + = @_; + + my($bold, + $cert_max_len, + $change_log, + $italics, + $manifest_id, + $normal, + @parent_revision_ids, + %revision_data, + %seen, + @unique); + 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_with_tags_by_name($text_buffer->get_end_iter(), + $revision_id . "\n\n", + $normal); + + # Certs. + + $cert_max_len = 0; + foreach my $cert (@$certs_list) + { + $cert_max_len = length($cert->{name}) + if ($cert->{name} ne "changelog" + && length($cert->{name}) > $cert_max_len); + } + foreach my $cert (@$certs_list) + { + if ($cert->{name} eq "changelog") + { + $change_log = $cert->{value}; + $change_log =~ s/\s+$//os; + } + else + { + $cert->{value} =~ s/T/ /o if ($cert->{name} eq "date"); + $text_buffer->insert_with_tags_by_name + ($text_buffer->get_end_iter(), + sprintf("%-*s ", + $cert_max_len + 1, ucfirst($cert->{name}) . ":"), + $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_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. + + if (defined($revision_details)) + { + + # Revision details. + + $text_buffer->insert_with_tags_by_name($text_buffer->get_end_iter(), + __("\n\nChanges Made:\n"), + $bold); + foreach my $type (@types) + { + $revision_data{$type} = []; + } + foreach my $change (@$revision_details) + { + if ($change->{type} eq "add_dir") + { + push(@{$revision_data{__("Added")}}, $change->{name} . "/"); + } + elsif ($change->{type} eq "add_file") + { + push(@{$revision_data{__("Added")}}, $change->{name}); + } + elsif ($change->{type} eq "delete") + { + push(@{$revision_data{__("Removed")}}, $change->{name}); + } + elsif ($change->{type} eq "patch") + { + push(@{$revision_data{__("Changed")}}, $change->{name}); + } + elsif ($change->{type} eq "rename") + { + push(@{$revision_data{__("Renamed")}}, + $change->{from_name} . " -> " . $change->{to_name}); + } + elsif ($change->{type} eq "clear") + { + push(@{$revision_data{__("Attributes")}}, + __x("{name}: {attribute} was cleared", + name => $change->{name}, + attribute => $change->{attribute})); + } + elsif ($change->{type} eq "set") + { + push(@{$revision_data{__("Attributes")}}, + sprintf("%s: %s = %s", + $change->{name}, + $change->{attribute}, + $change->{value})); + } + elsif ($change->{type} eq "old_revision") + { + push(@parent_revision_ids, $change->{revision_id}); + } + elsif ($change->{type} eq "new_manifest") + { + $manifest_id = $change->{manifest_id}; + } + } + foreach my $type (@types) + { + if (scalar(@{$revision_data{$type}}) > 0) + { + $text_buffer->insert_with_tags_by_name + ($text_buffer->get_end_iter(), + " " . $type . ":\n", + $italics); + %seen = (); + @unique = sort(grep(! $seen{$_} ++, @{$revision_data{$type}})); + foreach my $line (@unique) + { + $text_buffer->insert_with_tags_by_name + ($text_buffer->get_end_iter(), + "\t" . $line . "\n", + $normal); + } + } + } + + # Parent revision and manifest ids. + + $text_buffer->insert_with_tags_by_name + ($text_buffer->get_end_iter(), + __("\nParent revision id(s): "), + $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: "), + $bold); + $text_buffer->insert_with_tags_by_name($text_buffer->get_end_iter(), + $manifest_id, + $normal); + + } + +} +# +############################################################################## +# # Routine - get_change_log_window # # Description - Creates or prepares an existing change log window for use. ============================================================ --- Utilities.pm 4fb372a8b2cfc16d2b745675019155a658dcb84a +++ Utilities.pm 9f25e1efc39b0744b8142f40c54599cbc69c8932 @@ -51,7 +51,6 @@ sub data_is_binary($); sub colour_to_string($); sub create_format_tags($); sub data_is_binary($); -sub generate_revision_report($$$$;$); sub generate_tmp_path($); sub get_branch_revisions($$$$$); sub get_dir_contents($$$); @@ -64,210 +63,6 @@ sub set_label_value($$); # ############################################################################## # -# Routine - generate_revision_report -# -# Description - Populate the specified Gtk2::TextBuffer with a pretty -# printed report on the specified revision. -# -# Data - $text_buffer : The Gtk2::TextBuffer that is to be -# populated. -# $revision_id : The id of the revision being reported -# 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 -# report is to be generated or undef if -# the report is to just be a summary. -# -############################################################################## - - - -sub generate_revision_report($$$$;$) -{ - - my($text_buffer, $revision_id, $certs_list, $colour, $revision_details) - = @_; - - my($bold, - $change_log, - $italics, - $manifest_id, - $normal, - @parent_revision_ids, - %revision_data, - %seen, - @unique); - 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_with_tags_by_name($text_buffer->get_end_iter(), - $revision_id . "\n\n", - $normal); - - # Certs. - - foreach my $cert (@$certs_list) - { - if ($cert->{name} eq "changelog") - { - $change_log = $cert->{value}; - $change_log =~ s/\s+$//os; - } - else - { - $cert->{value} =~ s/T/ /o if ($cert->{name} eq "date"); - $text_buffer->insert_with_tags_by_name - ($text_buffer->get_end_iter(), - sprintf("%s:\t", ucfirst($cert->{name})), - $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_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. - - if (defined($revision_details)) - { - - # Revision details. - - $text_buffer->insert_with_tags_by_name($text_buffer->get_end_iter(), - __("\n\nChanges Made:\n"), - $bold); - foreach my $type (@types) - { - $revision_data{$type} = []; - } - foreach my $change (@$revision_details) - { - if ($change->{type} eq "add_dir") - { - push(@{$revision_data{__("Added")}}, $change->{name} . "/"); - } - elsif ($change->{type} eq "add_file") - { - push(@{$revision_data{__("Added")}}, $change->{name}); - } - elsif ($change->{type} eq "delete") - { - push(@{$revision_data{__("Removed")}}, $change->{name}); - } - elsif ($change->{type} eq "patch") - { - push(@{$revision_data{__("Changed")}}, $change->{name}); - } - elsif ($change->{type} eq "rename") - { - push(@{$revision_data{__("Renamed")}}, - $change->{from_name} . " -> " . $change->{to_name}); - } - elsif ($change->{type} eq "clear") - { - push(@{$revision_data{__("Attributes")}}, - __x("{name}: {attribute} was cleared", - name => $change->{name}, - attribute => $change->{attribute})); - } - elsif ($change->{type} eq "set") - { - push(@{$revision_data{__("Attributes")}}, - sprintf("%s: %s = %s", - $change->{name}, - $change->{attribute}, - $change->{value})); - } - elsif ($change->{type} eq "old_revision") - { - push(@parent_revision_ids, $change->{revision_id}); - } - elsif ($change->{type} eq "new_manifest") - { - $manifest_id = $change->{manifest_id}; - } - } - foreach my $type (@types) - { - if (scalar(@{$revision_data{$type}}) > 0) - { - $text_buffer->insert_with_tags_by_name - ($text_buffer->get_end_iter(), - " " . $type . ":\n", - $italics); - %seen = (); - @unique = sort(grep(! $seen{$_} ++, @{$revision_data{$type}})); - foreach my $line (@unique) - { - $text_buffer->insert_with_tags_by_name - ($text_buffer->get_end_iter(), - "\t" . $line . "\n", - $normal); - } - } - } - - # Parent revision and manifest ids. - - $text_buffer->insert_with_tags_by_name - ($text_buffer->get_end_iter(), - __("\nParent revision id(s):\t"), - $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_with_tags_by_name($text_buffer->get_end_iter(), - $manifest_id, - $normal); - - } - -} -# -############################################################################## -# # Routine - generate_tmp_path # # Description - Generate a unique and temporary path for the specified file ============================================================ --- mtn-browse 3a1bf85b64af0fe8483e0d04eae892696f5a6e86 +++ mtn-browse 55cee1941e1f123e780d00481d07f821c3f8c84f @@ -397,7 +397,7 @@ sub about_activate_cb($$) if (! defined($large_logo)); Gnome2::About->new ("mtn-browse", - "0.4b", + "0.42b", __("Copyright \xa9 2007-2009 Anthony Cooper"), __("A graphical front-end browser for Monotone VCS databases"), ["Anthony Cooper "], ============================================================ --- mtn-browse.glade c97a54698dfe63c8cd37fba291b6ec8369ffede6 +++ mtn-browse.glade 63cdeb4f97a048f4f8e34310956b7a81c413e920 @@ -498,115 +498,128 @@ current branch are to be listed - + True - Use more advanced selection -criteria for selecting a revision - True - GTK_RELIEF_NORMAL - True - + False + 0 - + True - gtk-find - 4 - 0.5 - 0.5 - 0 - 0 + Use more advanced selection +criteria for selecting a revision + True + GTK_RELIEF_NONE + True + + + + + True + gtk-find + 4 + 0.5 + 0.5 + 0 + 0 + + + + 0 + False + False + - - - 0 - False - False - - - - - True - View revision history + + + True + View revision history in Monotone-Viz - True - GTK_RELIEF_NORMAL - True - + True + GTK_RELIEF_NONE + True + - - - True - monotone-viz.png - 0.5 - 0.5 - 0 - 0 + + + True + monotone-viz.png + 0.5 + 0.5 + 0 + 0 + + + + 0 + False + False + - - - 0 - False - False - - - - - True - View revision's change history - True - GTK_RELIEF_NORMAL - True - - - + True - gtk-dialog-info - 4 - 0.5 - 0.5 - 0 - 0 + View revision's change history + True + GTK_RELIEF_NONE + True + + + + + True + gtk-dialog-info + 4 + 0.5 + 0.5 + 0 + 0 + + + + 0 + False + False + - - - 0 - False - False - - - - - True - View revision's change log - True - GTK_RELIEF_NORMAL - True - - - + True - gtk-dnd - 4 - 0.5 - 0.5 - 0 - 0 + View revision's change log + True + GTK_RELIEF_NONE + True + + + + + True + gtk-dnd + 4 + 0.5 + 0.5 + 0 + 0 + + + + 0 + False + False + 0 False - False + True @@ -744,7 +757,7 @@ in Monotone-Viz True Go up one directory level True - GTK_RELIEF_NORMAL + GTK_RELIEF_NONE True @@ -1316,14 +1329,14 @@ last updated with respect to this revisi True False - 5 + 0 True Search text True - GTK_RELIEF_NORMAL + GTK_RELIEF_NONE True @@ -1351,7 +1364,7 @@ last updated with respect to this revisi True Save file contents to disk True - GTK_RELIEF_NORMAL + GTK_RELIEF_NONE True @@ -1380,7 +1393,7 @@ into a viewer Load file contents into a viewer True - GTK_RELIEF_NORMAL + GTK_RELIEF_NONE True @@ -1408,7 +1421,7 @@ into a viewer True Annotate file contents True - GTK_RELIEF_NORMAL + GTK_RELIEF_NONE True @@ -1436,7 +1449,7 @@ into a viewer True View file's change history True - GTK_RELIEF_NORMAL + GTK_RELIEF_NONE True @@ -2422,7 +2435,7 @@ entry field if you cannot remember the s True Execute the query True - GTK_RELIEF_NORMAL + GTK_RELIEF_NONE True @@ -2463,7 +2476,7 @@ entry field if you cannot remember the s True Enter the current selector into the query above True - GTK_RELIEF_NORMAL + GTK_RELIEF_NONE True @@ -3367,7 +3380,7 @@ Tag True 1 1 - 0 0 336 10 302.4 336 + 0 0 365 10 328.5 365 0 0 17 10 15.3 17 @@ -3460,10 +3473,20 @@ Tag False Stop gathering history details True - gtk-stop - True - GTK_RELIEF_NORMAL + GTK_RELIEF_NONE True + + + + True + gtk-stop + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -3758,7 +3781,7 @@ file version that is to be comparedFalse Compare the two selected files True - GTK_RELIEF_NORMAL + GTK_RELIEF_NONE True @@ -5196,6 +5219,7 @@ make sure it is mono-spaced) True True + Pick A Font True True True @@ -5510,6 +5534,7 @@ in comparison listings True True False + Pick A Colour True @@ -5527,6 +5552,7 @@ in comparison listings True True False + Pick A Colour True @@ -5544,6 +5570,7 @@ in comparison listings True True False + Pick A Colour True @@ -5561,6 +5588,7 @@ in comparison listings True True False + Pick A Colour True @@ -5578,6 +5606,7 @@ in comparison listings True True False + Pick A Colour True @@ -5595,6 +5624,7 @@ in comparison listings True True False + Pick A Colour True @@ -5712,6 +5742,7 @@ used in context lines True True False + Pick A Colour True @@ -5763,6 +5794,7 @@ used in context lines True True False + Pick A Colour True @@ -5846,6 +5878,7 @@ used in annotated listings True True False + Pick A Colour True @@ -5896,6 +5929,7 @@ used in annotated listings True True False + Pick A Colour True @@ -6111,6 +6145,7 @@ used in annotated listings True True False + Pick A Colour True @@ -6128,6 +6163,7 @@ used in annotated listings True True False + Pick A Colour True @@ -6145,6 +6181,7 @@ used in annotated listings True True False + Pick A Colour True @@ -6162,6 +6199,7 @@ used in annotated listings True True False + Pick A Colour True @@ -6317,54 +6355,67 @@ used in annotated listings - + True - Add a new MIME -type to the list - True - GTK_RELIEF_NORMAL - True - + False + 0 - + True - gtk-add - 4 - 0.5 - 0.5 - 0 - 0 + Add a new MIME +type to the list + True + GTK_RELIEF_NONE + True + + + + + True + gtk-add + 4 + 0.5 + 0.5 + 0 + 0 + + + + 0 + False + False + - - - 0 - False - False - - - - - True - Remove the currently selected + + + True + Remove the currently selected MIME type from the list - True - GTK_RELIEF_NORMAL - True - + True + GTK_RELIEF_NONE + True + - - - True - gtk-remove - 4 - 0.5 - 0.5 - 0 - 0 + + + True + gtk-remove + 4 + 0.5 + 0.5 + 0 + 0 + + + + 0 + False + False + @@ -6476,7 +6527,7 @@ MIME type from the list 2 2 False - 5 + 0 5 @@ -6485,7 +6536,7 @@ pattern to the list Add a new file name pattern to the list True - GTK_RELIEF_NORMAL + GTK_RELIEF_NONE True @@ -6517,7 +6568,7 @@ file name pattern from the listRemove the currently selected file name pattern from the list True - GTK_RELIEF_NORMAL + GTK_RELIEF_NONE True