# # # patch "AdvancedFind.pm" # from [6e5be53cafef2639d987484861a69201ede8fc01] # to [93700481be1aff4ba68009aa13d3436465bbc7ed] # # patch "Annotate.pm" # from [a8457486cdc3bd7165083242cc481c26fdd45270] # to [27cfdc6358dc6b448c976c2e5c8073b267389a61] # # patch "ChangeLog.pm" # from [0a0105366aa2b605389e85bce879d12e82deb8af] # to [811c554cf93c14ca9f01851b33e122280470fbfa] # # patch "ComboAutoCompletion.pm" # from [4682fa6a13d960ac1c1e63ccf5e6dfc4b6c5b9dc] # to [adfea7a4a9b159b9f304f112644c3c3951a2391c] # # patch "Common.pm" # from [ca1b8ae5a378545b80fcee5134dc08105e067267] # to [7068c80291b5130224db7a8d70c5b15c0ba8c00c] # # patch "Completion.pm" # from [d416a066aa7f7ea3c953f07d97b6e5d7a1f3cc05] # to [89d4c208d4e088efbf118e8d7ad4e7a6ce3e561f] # # patch "FindFiles.pm" # from [a7435609a35bff3fe384b3f145b58021b70c8dfa] # to [0da8fa825fe041547b6ecbda0c30d967050d2c4e] # # patch "History.pm" # from [f639c00b18bd36a1fc701e1ef76765f950a7fdfb] # to [8d2d115bea7e921a6a0ba711cbb0974691f83051] # # patch "Preferences.pm" # from [15134271c380429b82b4ec8cbb44eea27d9795f2] # to [4f874eb8f76d7a3896e7d787611f740b06dd4ed1] # # patch "mtn-browse" # from [1f39c894ebe1bda77f40188b0ac1baa18263ad49] # to [80ae46bdbdcf136e12d0fbf004cfbd0b5cfaeb50] # ============================================================ --- AdvancedFind.pm 6e5be53cafef2639d987484861a69201ede8fc01 +++ AdvancedFind.pm 93700481be1aff4ba68009aa13d3436465bbc7ed @@ -380,7 +380,7 @@ sub term_combobox_changed_cb($$) $selector = $advanced_find->{term_combobox}->get_model()->get ($advanced_find->{term_combobox}->get_active_iter(), 0); - if ($selector =~ m/^Date .*$/o) + if ($selector =~ m/^Date .*$/) { $advanced_find->{argument_entry}->set_sensitive(FALSE); $advanced_find->{date_dateedit}->set_sensitive(TRUE); ============================================================ --- Annotate.pm a8457486cdc3bd7165083242cc481c26fdd45270 +++ Annotate.pm 27cfdc6358dc6b448c976c2e5c8073b267389a61 @@ -112,11 +112,11 @@ sub display_annotation($$$) # the prefix and text parts. $max_len = 0; - $template = sprintf("a%da2a*", length(($lines[0] =~ m/^([^:]+):.*$/o)[0])); + $template = sprintf("a%da2a*", length(($lines[0] =~ m/^([^:]+):.*$/)[0])); for ($i = 0; $i <= $#lines; ++ $i) { ($prefix[$i], $lines[$i]) = (unpack($template, $lines[$i]))[0,2]; - $lines[$i] =~ s/\s+$//o; + $lines[$i] =~ s/\s+$//; $lines[$i] = expand($lines[$i]); $max_len = $len if (($len = length($lines[$i])) > $max_len); } @@ -133,7 +133,7 @@ sub display_annotation($$$) # Change the colours if there is a new prefix. - if ($prefix[$i] !~ m/^\s+$/o) + if ($prefix[$i] !~ m/^\s+$/) { if ($prefix_tag ne "annotate-prefix-1") { @@ -331,7 +331,7 @@ sub mtn_annotate($$$$) # Break up the input into a list of lines. - @$list = split(/\n/o, $buffer); + @$list = split(/\n/, $buffer); return 1; ============================================================ --- ChangeLog.pm 0a0105366aa2b605389e85bce879d12e82deb8af +++ ChangeLog.pm 811c554cf93c14ca9f01851b33e122280470fbfa @@ -194,12 +194,12 @@ sub generate_revision_report($$$$;$) if ($cert->{name} eq "changelog") { my $change_log = $cert->{value}; - $change_log =~ s/\s+$//os; + $change_log =~ s/\s+$//s; push(@change_logs, $change_log); } else { - $cert->{value} =~ s/T/ /o if ($cert->{name} eq "date"); + $cert->{value} =~ s/T/ / if ($cert->{name} eq "date"); $text_buffer->insert_with_tags_by_name ($text_buffer->get_end_iter(), sprintf("%-*s ", ============================================================ --- ComboAutoCompletion.pm 4682fa6a13d960ac1c1e63ccf5e6dfc4b6c5b9dc +++ ComboAutoCompletion.pm adfea7a4a9b159b9f304f112644c3c3951a2391c @@ -212,7 +212,7 @@ sub comboboxentry_key_release_event_cb($ # So that the spacebar triggers auto-complete. - $value =~ s/\s+$//o; + $value =~ s/\s+$//; $len = length($value); $combo_details->{completion} = ============================================================ --- Common.pm ca1b8ae5a378545b80fcee5134dc08105e067267 +++ Common.pm 7068c80291b5130224db7a8d70c5b15c0ba8c00c @@ -953,7 +953,7 @@ sub create_format_tags($) foreach my $prefix ("annotate_prefix_", "annotate_text_") { my $tag = $prefix; - $tag =~ s/_/-/go; + $tag =~ s/_/-/g; $clr = $user_preferences->{colours}->{$prefix . $i}; $text_buffer->create_tag($tag . $i, "foreground" => $clr->{fg}, ============================================================ --- Completion.pm d416a066aa7f7ea3c953f07d97b6e5d7a1f3cc05 +++ Completion.pm 89d4c208d4e088efbf118e8d7ad4e7a6ce3e561f @@ -105,7 +105,7 @@ sub new($;$) # Build up nodes for an item. $level = $this->{tree}; - foreach $char (split(//o, $item)) + foreach $char (split(//, $item)) { if (! exists($level->{$char})) { @@ -162,7 +162,7 @@ sub get_completion($$$$) $level = $this->{tree}; $$result = ""; - foreach $char (split(//o, $value)) + foreach $char (split(//, $value)) { last unless (exists($level->{$char})); $level = $level->{$char}; ============================================================ --- FindFiles.pm a7435609a35bff3fe384b3f145b58021b70c8dfa +++ FindFiles.pm 0da8fa825fe041547b6ecbda0c30d967050d2c4e @@ -705,7 +705,7 @@ sub results_treeview_cursor_changed_cb($ $last_update = $manifest_entry->{last_update}; } $file_id = $manifest_entry->{file_id}; - $last_update =~ s/T/ /o; + $last_update =~ s/T/ /; } else { ============================================================ --- History.pm f639c00b18bd36a1fc701e1ef76765f950a7fdfb +++ History.pm 8d2d115bea7e921a6a0ba711cbb0974691f83051 @@ -766,7 +766,7 @@ sub compare_revisions($$$;$) $max_len = $separator = 0; foreach my $line (@lines) { - if ($line =~ m/^==/o) + if ($line =~ m/^==/) { $separator = 1; } @@ -774,12 +774,12 @@ sub compare_revisions($$$;$) { $rest = expand(substr($line, 3)) . " "; $max_len = $len if (($len = length($rest)) > $max_len); - $separator = 0 if ($line =~ m/^\+\+\+ .+\s+[0-9a-f]{40}$/o); + $separator = 0 if ($line =~ m/^\+\+\+ .+\s+[0-9a-f]{40}$/); } else { ($char, $rest) = unpack("a1a*", $line); - $rest =~ s/\s+$//o; + $rest =~ s/\s+$//; $rest = expand($rest); $max_len = $len if (($len = length($rest)) > $max_len); $line = $char . $rest; @@ -804,7 +804,7 @@ sub compare_revisions($$$;$) # Deal with the initial comment lines that summarise the entire set # of differences between the revisions. - if ($lines[$i] =~ m/^\#/o) + if ($lines[$i] =~ m/^\#/) { $line = substr($lines[$i], 1); $instance->{comparison_buffer}->insert @@ -814,7 +814,7 @@ sub compare_revisions($$$;$) # Deal with lines that introduce a new file comparison. - elsif ($lines[$i] =~ m/^==/o) + elsif ($lines[$i] =~ m/^==/) { # Check for aborts. @@ -836,19 +836,19 @@ sub compare_revisions($$$;$) # binary. ++ $i; - ($name) = ($lines[$i] =~ m/^--- (.+)\t[0-9a-f]{40}$/o); + ($name) = ($lines[$i] =~ m/^--- (.+)\t[0-9a-f]{40}$/); if (defined($name)) { $is_binary = 0; ($file_id_1) = - ($lines[$i] =~ m/^--- .+\t([0-9a-f]{40})$/o); + ($lines[$i] =~ m/^--- .+\t([0-9a-f]{40})$/); ($file_id_2) = - ($lines[$i + 1] =~ m/^\+\+\+ .+\t([0-9a-f]{40})$/o); + ($lines[$i + 1] =~ m/^\+\+\+ .+\t([0-9a-f]{40})$/); } else { $is_binary = 1; - ($name) = ($lines[$i] =~ m/^\# (.+) is binary$/o); + ($name) = ($lines[$i] =~ m/^\# (.+) is binary$/); $file_id_1 = $file_id_2 = ""; } @@ -891,7 +891,7 @@ sub compare_revisions($$$;$) # Deal with difference context lines. - elsif ($lines[$i] =~ m/^@@/o) + elsif ($lines[$i] =~ m/^@@/) { $line = substr(substr($lines[$i], 2) . $padding, 0, $max_len); $instance->{comparison_buffer}->insert_with_tags_by_name @@ -902,7 +902,7 @@ sub compare_revisions($$$;$) # Deal with - change lines. - elsif ($lines[$i] =~ m/^-/o) + elsif ($lines[$i] =~ m/^-/) { $line = substr(substr($lines[$i], 1) . $padding, 0, $max_len); $instance->{comparison_buffer}->insert_with_tags_by_name @@ -913,7 +913,7 @@ sub compare_revisions($$$;$) # Deal with + change lines. - elsif ($lines[$i] =~ m/^\+/o) + elsif ($lines[$i] =~ m/^\+/) { $line = substr(substr($lines[$i], 1) . $padding, 0, $max_len); $instance->{comparison_buffer}->insert_with_tags_by_name @@ -961,7 +961,7 @@ sub compare_revisions($$$;$) # Deal with lines that introduce a new file comparison. - if ($instance->{diff_output}->[$i] =~ m/^==/o) + if ($instance->{diff_output}->[$i] =~ m/^==/) { # Check for aborts. @@ -973,19 +973,19 @@ sub compare_revisions($$$;$) ++ $i; ($name) = ($instance->{diff_output}->[$i] =~ - m/^--- (.+)\t[0-9a-f]{40}$/o); + m/^--- (.+)\t[0-9a-f]{40}$/); if (defined($name)) { $is_binary = 0; ($file_id_1) = ($instance->{diff_output}->[$i] =~ - m/^--- .+\t([0-9a-f]{40})$/o); + m/^--- .+\t([0-9a-f]{40})$/); ($file_id_2) = ($instance->{diff_output}->[$i + 1] - =~ m/^\+\+\+ .+\t([0-9a-f]{40})$/o); + =~ m/^\+\+\+ .+\t([0-9a-f]{40})$/); } else { ($name) = ($instance->{diff_output}->[$i] =~ - m/^\# (.+) is binary$/o); + m/^\# (.+) is binary$/); $is_binary = 1; $file_id_1 = $file_id_2 = ""; } @@ -1777,7 +1777,7 @@ sub mtn_diff($$$$;$) # Break up the input into a list of lines. - @$list = split(/\n/o, $buffer); + @$list = split(/\n/, $buffer); return 1; ============================================================ --- Preferences.pm 15134271c380429b82b4ec8cbb44eea27d9795f2 +++ Preferences.pm 4f874eb8f76d7a3896e7d787611f740b06dd4ed1 @@ -626,7 +626,7 @@ sub add_mime_type_button_clicked_cb($$) # Check entry to see if it is valid. $mime_type = $instance->{mime_type_entry}->get_text(); - if ($mime_type !~ m/^[^\/]+\/[^\/]+$/o) + if ($mime_type !~ m/^[^\/]+\/[^\/]+$/) { my $dialog = Gtk2::MessageDialog->new ($instance->{window}, @@ -1228,11 +1228,11 @@ sub load_preferences_into_gui($) for my $item (@colour_mapping_table) { my $field; - if ($item->{widget} =~ m/foreground/o) + if ($item->{widget} =~ m/foreground/) { $field = "fg"; } - elsif ($item->{widget} =~ m/background/o) + elsif ($item->{widget} =~ m/background/) { $field = "bg"; } @@ -1384,11 +1384,11 @@ sub save_preferences_from_gui($) for my $item (@colour_mapping_table) { my $field; - if ($item->{widget} =~ m/foreground/o) + if ($item->{widget} =~ m/foreground/) { $field = "fg"; } - elsif ($item->{widget} =~ m/background/o) + elsif ($item->{widget} =~ m/background/) { $field = "bg"; } @@ -1604,12 +1604,12 @@ sub initialise_mime_info_table() # Only process recognisable MIME type entries. - if ($line !~ m/^(\s)|(\#.*)$/o && $line =~ m/^[^:]*:.*$/o) + if ($line !~ m/^(\s)|(\#.*)$/ && $line =~ m/^[^:]*:.*$/) { # Break lines into their MIME type and file name patterns fields. - ($type, $pattern) = $line =~ m/^([^:]*):(.*)$/o; + ($type, $pattern) = $line =~ m/^([^:]*):(.*)$/; # File the data, creating a node if necessary @@ -1620,18 +1620,18 @@ sub initialise_mime_info_table() else { $display_internally = $syntax_highlight = 0; - if ($type =~ m/^application\/.+$/o) + if ($type =~ m/^application\/.+$/) { - ($part) = ($type =~ m/^application\/(.+)$/o); + ($part) = ($type =~ m/^application\/(.+)$/); $display_internally = $syntax_highlight = 1 if (grep(/\Q$part\E/, @text_viewable_app_mime_types) > 0); } - elsif ($type =~ m/^image\/.+$/o) + elsif ($type =~ m/^image\/.+$/) { $display_internally = 1; } - elsif ($type =~ m/^text\/.+$/o) + elsif ($type =~ m/^text\/.+$/) { $display_internally = $syntax_highlight = 1; } ============================================================ --- mtn-browse 1f39c894ebe1bda77f40188b0ac1baa18263ad49 +++ mtn-browse 80ae46bdbdcf136e12d0fbf004cfbd0b5cfaeb50 @@ -133,6 +133,7 @@ sub monotone_viz_button_clicked_cb($$); sub manifest_browser_treeview_cursor_changed_cb($$); sub manifest_browser_treeview_row_activated_cb($$$$); sub monotone_viz_button_clicked_cb($$); +sub mtn_db_locked_handler($$); sub mtn_error_handler($$); sub new_blank_menu_item_clicked_cb($$); sub new_toolbutton_clicked_cb($$); @@ -178,6 +179,11 @@ sub view_button_clicked_cb($$); $tooltips = Gtk2::Tooltips->new(); $line_image = Gtk2::Gdk::Pixbuf->new_from_file(LIB_PATH . "/UI/line.png"); + # Set up the default database locked handler for the Monotone class. + + Monotone::AutomateStdio-> + register_db_locked_handler(\&mtn_db_locked_handler); + # Load in user preferences. eval @@ -290,7 +296,7 @@ sub view_button_clicked_cb($$); } - # Set up the error handlers for the Monotone library. + # Set up the error handlers for the Monotone class. Monotone::AutomateStdio->register_error_handler("both", \&mtn_error_handler); @@ -300,25 +306,31 @@ sub view_button_clicked_cb($$); # that control can be handed over to Gtk2 before updating the display. $browser = get_browser_window($mtn); - if (defined($mtn) && defined($branch)) + if (defined($mtn)) { - Glib::Idle->add - (sub { - my $browser = $_[0]; + $mtn->register_db_locked_handler(\&mtn_db_locked_handler, + $browser->{window}); + if (defined($branch)) + { + Glib::Idle->add + (sub { + my $browser = $_[0]; - return if ($browser->{in_cb}); - local $browser->{in_cb} = 1; + return if ($browser->{in_cb}); + local $browser->{in_cb} = 1; - $browser->{branch_combo_details}->{preset} = 1; - $browser->{branch_combo_details}->{value} = $branch; - $browser->{revision_combo_details}->{preset} = 1; - $browser->{revision_combo_details}->{value} = $revision_id; - $browser->{tagged_checkbutton}->set_active(FALSE); - &{$browser->{update_handler}}($browser, ALL_CHANGED); + $browser->{branch_combo_details}->{preset} = 1; + $browser->{branch_combo_details}->{value} = $branch; + $browser->{revision_combo_details}->{preset} = 1; + $browser->{revision_combo_details}->{value} = + $revision_id; + $browser->{tagged_checkbutton}->set_active(FALSE); + &{$browser->{update_handler}}($browser, ALL_CHANGED); - return FALSE; - }, - $browser); + return FALSE; + }, + $browser); + } } $mtn = undef; @@ -518,6 +530,8 @@ sub open_toolbutton_clicked_cb($$) if (open_database($browser->{window}, \$mtn, undef)) { $browser->{mtn} = $mtn; + $mtn->register_db_locked_handler(\&mtn_db_locked_handler, + $browser->{window}); &{$browser->{update_handler}}($browser, DATABASE_CHANGED); } @@ -1340,9 +1354,10 @@ sub manifest_browser_treeview_row_activa # Data - $widget : The widget object that received the signal. # $event : A Gtk2::Gdk::Event object describing the # event that has occurred. -# $client_data : The client data associated with this widget. +# $browser : The browser instance that is associated with +# this widget. # Return Value : TRUE if the event has been handled and needs -# no further handling, otherwise false if the +# no further handling, otherwise FALSE if the # event should carry on through the remaining # event handling. # @@ -1972,7 +1987,7 @@ sub update_browser_state($$) if ($cert->{name} eq "changelog") { $change_log = $cert->{value}; - $change_log =~ s/\s+$//os; + $change_log =~ s/\s+$//s; } } set_label_value($browser->{revision_id_value_label}, @@ -2104,7 +2119,7 @@ sub update_browser_state($$) $author = $item->{manifest_entry}->{author}; $last_update = $item->{manifest_entry}->{last_update}; } - $last_update =~ s/T/ /o; + $last_update =~ s/T/ /; } else { @@ -2224,7 +2239,7 @@ sub update_browser_state($$) {last_changed_revision}); } $last_update = $manifest_entry->{last_update}; - $last_update =~ s/T/ /o; + $last_update =~ s/T/ /; set_label_value($browser->{file_name_value_label}, $manifest_entry->{name}); set_label_value($browser->{file_id_value_label}, @@ -2333,7 +2348,7 @@ sub display_file($$) # Image/non-image data? - if ($mime_type =~ m/^image\/.+$/o) + if ($mime_type =~ m/^image\/.+$/) { # Image data. @@ -2536,6 +2551,47 @@ sub enable_find_text_dialog($$) # ############################################################################## # +# Routine - mtn_db_locked_handler +# +# Description - This routine is called when ever a locked database +# condition is detected. +# +# Data - $mtn : The Monotone instance handle that +# encountered the locked database. +# $parent : The parent window for any dialogs that are +# to be displayed. +# Return Value : True if the command is to be retried, +# otherwise false if the locked database +# should be reported as an error. +# +############################################################################## + + + +sub mtn_db_locked_handler($$) +{ + + my($mtn, $parent) = @_; + + my $dialog; + my $wm = WindowManager->instance(); + + $dialog = Gtk2::MessageDialog->new + ($parent, + ["modal"], + "info", + "ok", + __("The Monotone database is currently locked, please\n") + . __("dismiss this dialog when this is no longer the case.")); + $wm->allow_input(sub { $dialog->run(); }); + $dialog->destroy(); + + return 1; + +} +# +############################################################################## +# # Routine - mtn_error_handler # # Description - This routine is called when ever there is a problem with