quilt-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Quilt-dev] [PATCH] Enhanced decoration for "series -v" command


From: Peter Williams
Subject: Re: [Quilt-dev] [PATCH] Enhanced decoration for "series -v" command
Date: Tue, 14 Jun 2005 11:49:52 +1000
User-agent: Mozilla Thunderbird 1.0.2-1.3.2 (X11/20050324)

Peter Williams wrote:
Andreas Gruenbacher wrote:

On Friday 10 June 2005 08:21, Peter Williams wrote:

I am the author of a PyGTK GUI wrapper ( see
<http://freshmeat.net/projects/gquilt/>) for quilt and it has been
suggested to me that the panel containing the display of the patch
series could be enhanced by having it display (for applied patches)
whether each patch needs refreshing or not.



Looks nice. It seems the Push and Pop icons point in the wrong direction wrt. the series file (which has its top at the bottom)?


You're the second person to say that and I don't understand as the push arrow pushes up onto the bottom of the series and the pop arrow pops down off the bottom of the series (at least in the latest versions). Older versions used stock icons with unpredictable results depending on how they were represented on each system so I've gone to gquilt specific icons for later versions. Can you confirm that you've got version 0.4?



The attached patch modifies quilt's "series -v" command to add this
information to the output.



files_may_have_changed may return false positives, so the resulting status information isn't worth much. Also it doesn't take care of shadowed files, so modifying a file in a patch further down in the series file will mark all previous patches that include that file as modified.


Yes, I've discovered that :-( and will try to come up with a fix in a day or two. Basically, when a file is newer than the patch's timestamp I'll look at applied patches above the patch until I find one that shares the same file and make the comparison with the "cached" file for that patch.

As for other false positives I'm not sure that they're worth hunting down as they should only be caused (I think) by rare occurrences such as a change being made to a file and then removed without a refresh being done. I'm reluctant to go to all the trouble of doing diffs to confirm that there is indeed a difference in the file (due to the overhead) but will do that if necessary.

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.

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
+++ quilt/scripts/patchfns.in
@@ -340,7 +340,15 @@ files_may_have_changed()
        local apply_ts=$(date -r "$QUILT_PC/$patch/.timestamp" '+%s') ts
        for file in $(files_in_patch $patch)
        do
-               ts=$(date -r $file '+%s' 2> /dev/null)
+               local next_patch=$(next_patch_for_file $patch $file) test_file
+
+               if [ -z "$next_patch" ]
+               then
+                       test_file=$file
+               else
+                       test_file=$(backup_file_name $next_patch $file)
+               fi
+               ts=$(date -r $test_file '+%s' 2> /dev/null)
                [ -z "$ts" ] && return 0
                [ "$ts" -gt $apply_ts ] && return 0
        done
Index: quilt/quilt/refresh.in
===================================================================
--- quilt.orig/quilt/refresh.in
+++ quilt/quilt/refresh.in
@@ -281,6 +281,7 @@ if [ -e $patch_file ] && \
     @DIFF@ -q $patch_file $tmp_result > /dev/null
 then
        printf $"Patch %s is unchanged\n" "$(print_patch $patch)"
+       touch $QUILT_PC/$patch/.timestamp
        exit 0
 fi
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]