|
From: | Peter Williams |
Subject: | Re: [Quilt-dev] [PATCH] Enhanced decoration for "series -v" command |
Date: | Wed, 15 Jun 2005 17:17:58 +1000 |
User-agent: | Mozilla Thunderbird 1.0.2-1.3.2 (X11/20050324) |
Peter Williams wrote:
Andreas Gruenbacher wrote:On Tuesday 14 June 2005 03:49, Peter Williams wrote:Attached is a patch (on top of my previous patch) that addresses the false positives issue. It seems to work well with one of my playgrounds that has quite extensive overlapping of patches. The reason that I've provided this as a patch on top of my previous patch is to make it easier to see the changes involved. I'm fairly sure that this change won't have any adverse effects for the use of files_may_have_changed() within the "pop" command but would value the opinion of others.Your version of files_may_have_changed is more exact than the current version, but it still is not perfect, and it is *much* slower: next_patch_for_file is slow; we definitely don't want to have it on the common path of execution of the pop command.OK. I'll change the code to get next_patch_for_file() off the common path.
Attached is a patch for files_may_have_changed that takes next_patch_for_files off the common path. Is its speed acceptable?
BTW I think that similar enhanced decoration for the "files -v" command would also be useful for indicating to the user which files in a particular patch are the cause of the need for an update. To this end I will spend some time coming up with something that can be used for both.
Peter -- Peter Williams address@hidden "Learning, n. The kind of ignorance distinguishing the studious." -- Ambrose Bierce
Index: quilt/scripts/patchfns.in =================================================================== --- quilt.orig/scripts/patchfns.in 2005-06-14 10:14:45.000000000 +1000 +++ quilt/scripts/patchfns.in 2005-06-15 10:15:22.000000000 +1000 @@ -341,8 +341,15 @@ for file in $(files_in_patch $patch) do ts=$(date -r $file '+%s' 2> /dev/null) - [ -z "$ts" ] && return 0 - [ "$ts" -gt $apply_ts ] && return 0 + if [ -z "$ts" ] || [ "$ts" -gt $apply_ts ] + then + local next_patch=$(next_patch_for_file $patch $file) test_file + + [ -z "$next_patch" ] && return 0 + test_file=$(backup_file_name $next_patch $file) + ts=$(date -r $test_file '+%s' 2> /dev/null) + [ "$ts" -gt $apply_ts ] && return 0 + fi done return 1 }
[Prev in Thread] | Current Thread | [Next in Thread] |