# # # patch "Common.pm" # from [71b46b955d4f154a84307ec346c815ef033132a2] # to [41a8e00bf55125fcd4e7984d487c1261a23fd87a] # # patch "FindFiles.pm" # from [5e474522d4a1e5ca3f9c36c885d23a6a1447d92b] # to [9a2a98f9bc27b390a45ca8e48b6522063ed6da56] # # patch "mtn-browse" # from [f37c64b1707bc37f10752949a6cacc3e2a53e3a2] # to [61c877d174edf9040b5b35831c57ba5791150da3] # ============================================================ --- Common.pm 71b46b955d4f154a84307ec346c815ef033132a2 +++ Common.pm 41a8e00bf55125fcd4e7984d487c1261a23fd87a @@ -56,6 +56,7 @@ use constant THRESHOLD => 20; # Public routines. +sub cache_extra_file_info($$$); sub colour_to_string($); sub create_format_tags($); sub data_is_binary($); @@ -769,6 +770,38 @@ sub get_revision_ids($$;$) # ############################################################################## # +# Routine - cache_extra_file_info +# +# Description - Cache extra information about a file in its manifest entry +# record. +# +# Data - $mtn : The Monotone::AutomateStdio object that +# is to be used. +# $revision_id : The revision id from where the search for +# the latest file update is to start, +# working backwards. +# $manifest_entry : A reference to the file's manifest entry. +# +############################################################################## + + + +sub cache_extra_file_info($$$) +{ + + my($mtn, $revision_id, $manifest_entry) = @_; + + get_file_details($mtn, + $revision_id, + $manifest_entry->{name}, + \$manifest_entry->{author}, + \$manifest_entry->{last_update}, + \$manifest_entry->{last_changed_revision}); + +} +# +############################################################################## +# # Routine - get_file_details # # Description - Get the details of the specified file. @@ -865,11 +898,11 @@ sub file_glob_to_regexp($) } elsif ($char eq "*") { - $re_text .= $escaping ? "\\*" : ".*"; + $re_text .= $escaping ? "\\*" : "[^/]*"; } elsif ($char eq "?") { - $re_text .= $escaping ? "\\?" : "."; + $re_text .= $escaping ? "\\?" : "[^/]"; } elsif ($char eq "\\") { ============================================================ --- FindFiles.pm 5e474522d4a1e5ca3f9c36c885d23a6a1447d92b +++ FindFiles.pm 9a2a98f9bc27b390a45ca8e48b6522063ed6da56 @@ -310,8 +310,10 @@ sub search_files_button_clicked_cb($$) my($contents_re, $counter, $file_glob_re, + $file_prefix_length, $manifest, $matches, + $name, $period, $query, $size); @@ -337,6 +339,7 @@ sub search_files_button_clicked_cb($$) # Build up a sub-manifest representing the items that we are going to # search. + $file_prefix_length = 0; if ($query->{file_glob_search_subdirectories} && $instance->{starting_point} eq "") { @@ -360,6 +363,8 @@ sub search_files_button_clicked_cb($$) @manifest = map($_->{manifest_entry}, @result); } $manifest = address@hidden; + $file_prefix_length = length($instance->{starting_point}); + ++ $file_prefix_length if ($file_prefix_length > 0); } # Precompile the regexps and more complex comparison values. @@ -515,7 +520,7 @@ sub search_files_button_clicked_cb($$) # Name. - next if ($entry->{name} !~ m/$file_glob_re/ + next if (basename($entry->{name}) !~ m/$file_glob_re/ || ($query->{file_glob} eq "" && $entry->{type} ne "file")); # The remaining tests only make sense for files. @@ -532,20 +537,12 @@ sub search_files_button_clicked_cb($$) $last_update); if (! exists($entry->{author})) { - get_file_details($instance->{mtn}, - $instance->{revision_id}, - $entry->{name}, - \$author, - \$last_update, - \$entry->{last_changed_revision}); - $entry->{author} = $author; - $entry->{last_update} = $last_update; + cache_extra_file_info($instance->{mtn}, + $instance->{revision_id}, + $entry); } - else - { - $author = $entry->{author}; - $last_update = $entry->{last_update}; - } + $author = $entry->{author}; + $last_update = $entry->{last_update}; if (exists($query->{older_date})) { next if ($last_update lt $query->{older_date} @@ -609,9 +606,10 @@ sub search_files_button_clicked_cb($$) # If we have got this far then it is a match. ++ $matches; + $name = substr($entry->{name}, $file_prefix_length); $instance->{results_liststore}-> set($instance->{results_liststore}->append(), - RLS_NAME_COLUMN, $entry->{name}, + RLS_NAME_COLUMN, $name, RLS_MANIFEST_ENTRY_COLUMN, $entry); } @@ -704,25 +702,14 @@ sub results_treeview_cursor_changed_cb($ { if (! exists($manifest_entry->{author})) { - get_file_details($instance->{mtn}, - $instance->{revision_id}, - $manifest_entry->{name}, - \$author, - \$last_update, - \$last_changed_revision); - $manifest_entry->{author} = $author; - $manifest_entry->{last_changed_revision} = - $last_changed_revision; - $manifest_entry->{last_update} = $last_update; + cache_extra_file_info($instance->{mtn}, + $instance->{revision_id}, + $manifest_entry); } - else - { - $author = $manifest_entry->{author}; - $last_changed_revision = - $manifest_entry->{last_changed_revision}; - $last_update = $manifest_entry->{last_update}; - } + $author = $manifest_entry->{author}; $file_id = $manifest_entry->{file_id}; + $last_changed_revision = $manifest_entry->{last_changed_revision}; + $last_update = $manifest_entry->{last_update}; $last_update =~ s/T/ /; } else ============================================================ --- mtn-browse f37c64b1707bc37f10752949a6cacc3e2a53e3a2 +++ mtn-browse 61c877d174edf9040b5b35831c57ba5791150da3 @@ -174,7 +174,7 @@ sub view_button_clicked_cb($$); # Initialise stuff. - Gnome2::Program->init("mtn-browse", 0.3); + Gnome2::Program->init("mtn-browse", 0.51); setup_sigchld_handler(\&sigchld_handler); $glade_file = LIB_PATH . "/UI/mtn-browse.glade"; $tooltips = Gtk2::Tooltips->new(); @@ -416,7 +416,7 @@ sub about_activate_cb($$) if (! defined($large_logo)); Gnome2::About->new ("mtn-browse", - "0.45", + "0.51", __("Copyright \xa9 2007-2009 Anthony Cooper"), __("A graphical front-end browser for Monotone VCS databases"), ["Anthony Cooper "], @@ -1338,15 +1338,13 @@ sub manifest_browser_treeview_row_activa return if ($browser->{in_cb}); local $browser->{in_cb} = 1; - my($manifest_entry, - $short_name); + my $manifest_entry; # Get the manifest entry details for the item that was double-clicked. $widget->get_selection()->selected_foreach (sub { my($model, $path, $iter) = @_; - $short_name = $model->get($iter, MLS_NAME_COLUMN); $manifest_entry = $model->get($iter, MLS_MANIFEST_ENTRY_COLUMN); }); @@ -2164,21 +2162,12 @@ sub update_browser_state($$) if (! exists($item->{manifest_entry}->{author})) { $taking_our_time = 1; - get_file_details($browser->{mtn}, - $revision_ids[0], - $item->{manifest_entry}->{name}, - \$author, - \$last_update, - \$item->{manifest_entry}-> - {last_changed_revision}); - $item->{manifest_entry}->{author} = $author; - $item->{manifest_entry}->{last_update} = $last_update; + cache_extra_file_info($browser->{mtn}, + $revision_ids[0], + $item->{manifest_entry}); } - else - { - $author = $item->{manifest_entry}->{author}; - $last_update = $item->{manifest_entry}->{last_update}; - } + $author = $item->{manifest_entry}->{author}; + $last_update = $item->{manifest_entry}->{last_update}; $last_update =~ s/T/ /; } else @@ -2289,13 +2278,9 @@ sub update_browser_state($$) { my @revision_ids; get_revision_ids($browser, address@hidden); - get_file_details($browser->{mtn}, - $revision_ids[0], - $manifest_entry->{name}, - \$manifest_entry->{author}, - \$manifest_entry->{last_update}, - \$manifest_entry-> - {last_changed_revision}); + cache_extra_file_info($browser->{mtn}, + $revision_ids[0], + $manifest_entry); } $last_update = $manifest_entry->{last_update}; $last_update =~ s/T/ /;