bugQuilt - Bugs: bug #53701, quilt pop reports "Patch...

 
 

bug #53701: quilt pop reports "Patch [...] needs to be refreshed first."

Submitter:  Filipus Klutiero <chealer>
Submitted:  Thu 19 Apr 2018 05:29:12 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Works For Me
Privacy:  Public Assigned to:  khali
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 11 Apr 2023 12:47:04 PM UTC, comment #1: 

Well, quilt is doing exactly what you tell it to.

When you run "quilt push -f" after having manually modified the file, quilt will create a backup of the file as it exists in your working directory, and the file contains "final" at that point because you just wrote that to the file yourself.

When you later run "quilt pop -f", all files touched by the patch are restored from the backup, so you get a file which contains "final". "quilt pop -f" gets you to the state you were in before "quilt push -f". Works as designed.

I can confirm that refreshing the patch would not help here. All hunks failed to apply, so if you don't fix the files manually before refreshing, refreshing the patch will generate an empty patch file. In this specific case, there's actually no way you can fix the file, because it already contains what the patch was supposed to change it to. So refreshing to an empty patch is the only thing quilt can do.

Note that when following your instructions to reproduce the issue, I get a slightly different message from "quilt push -f":

Applying patch patches/test.diff
patching file pop.test
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file pop.test.rej
Applied patch patches/test.diff (forced; needs refresh)

So as you can see it doesn't switch to interactive mode and it does explicitly mention that the patch needs to be refreshed. So this part was fixed meanwhile. This at least somehow clears your complaint that "the pop command can fail without indicating why" (the pop command tells you that you must refresh before you can pop, and the preceding push command tells you that the refresh is needed because you forced push).

As a summary, you are shooting yourself in the foot and then complain that it does hurt. The only advice I can give is: if it hurts, don't do it.

Jean Delvare <khali>
Group administrator
Thu 19 Apr 2018 05:29:12 PM UTC, original submission:  

The pop command can fail without indicating why. The verbose option does not help.

This happened after I manually applied a patch, manually marked it as applied by quilt (forcefully pushing), then tried unapplying it using Quilt. For example:

cloph2@SWIKID02:/var/www/html/foncierpedia$ quilt new test.diff
Patch test.diff is now on top
cloph2@SWIKID02:/var/www/html/foncierpedia$ echo initial > pop.test
cloph2@SWIKID02:/var/www/html/foncierpedia$ quilt add pop.test
File pop.test added to patch test.diff
cloph2@SWIKID02:/var/www/html/foncierpedia$ echo final > pop.test
cloph2@SWIKID02:/var/www/html/foncierpedia$ quilt refresh
Refreshed patch test.diff
cloph2@SWIKID02:/var/www/html/foncierpedia$ quilt pop
Removing patch test.diff
Restoring pop.test

Now at patch WYSIWYG_fix_display.diff
cloph2@SWIKID02:/var/www/html/foncierpedia$ echo final > pop.test
cloph2@SWIKID02:/var/www/html/foncierpedia$ quilt push -f
Applying patch test.diff
patching file pop.test
Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file pop.test.rej
Patch test.diff appears to be empty; applied
cloph2@SWIKID02:/var/www/html/foncierpedia$ quilt pop
Patch test.diff needs to be refreshed first.
cloph2@SWIKID02:/var/www/html/foncierpedia$ quilt pop -v
Patch test.diff needs to be refreshed first.
cloph2@SWIKID02:/var/www/html/foncierpedia$ quilt pop -f
Patch test.diff appears to be empty, removing

Now at patch WYSIWYG_fix_display.diff
cloph2@SWIKID02:/var/www/html/foncierpedia$ cat pop.test
final
cloph2@SWIKID02:/var/www/html/foncierpedia$


As far as I can see, in such a situation, the only way to unapply is to mark as unapplied using quilt pop -f, and then to manually unapply. Refreshing the patch does not help.

Filipus Klutiero <chealer>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by khali (Posted a comment)
  • -email is unavailable- added by chealer (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-04-11 khali StatusNone Works For Me
        Assigned toNone khali
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code