darcs

Issue 2575 rebase then revert adds the rebase patch to the unrevert bundle

Title rebase then revert adds the rebase patch to the unrevert bundle
Priority urgent Status resolved
Milestone 2.14.0 HEAD Resolved in 2.14.0 HEAD
Superseder Nosy List bf
Assigned To
Topics

Created on 2018-03-09.23:45:50 by bf, last changed 2018-03-26.20:32:20 by bf.

Files
File name Uploaded Type Edit Remove
accept-issue2575_-rebase-then-revert-leaves-rebase-patch-in-unrevert-bundle.dpatch bf, 2018-03-25.13:46:53 application/x-darcs-patch
Messages
msg19958 (view) Author: bf Date: 2018-03-09.23:45:48
So I do a 'darcs rebase pull' say yes to everything until I see how many
patches it wants to suspend, perhaps look at a few of them. Then I say
'q' to cancel. I get

[...]
Shall I suspend this patch? (7/38)  [ynW...], or ? for more options: q
Suspend cancelled.
darcs: failed to read patch:
patch 9766caccd0af2009ad151588bd80100c3ba79cda
Author: Invalid <invalid@invalid>
Date:   Wed Mar  7 02:41:52 CET 2018
  * DO NOT TOUCH: Rebase patch
  This patch is an internal implementation detail of rebase, used to
  store suspended patches, and should not be visible in the user
  interface. Please report a bug if a darcs command is showing you this
  patch.
Patch not stored in patch bundle:
patch 9766caccd0af2009ad151588bd80100c3ba79cda
Author: Invalid <invalid@invalid>
Date:   Wed Mar  7 02:41:52 CET 2018
  * DO NOT TOUCH: Rebase patch
  This patch is an internal implementation detail of rebase, used to
  store suspended patches, and should not be visible in the user
  interface. Please report a bug if a darcs command is showing you this
  patch.

Apparently there is no test for this. The situation requires manual
editing of _darcs/hashed_inventory to fix. A must-fix before release IMO.

I have the suspicion that this could be due to the "nasty hack" (says
the comment, but I agree) in src/Darcs/UI/Commands/Rebase.hs line 731,
but I am not sure.
msg19959 (view) Author: bf Date: 2018-03-10.00:18:13
A closer look at the message reveals this line:

"Patch not stored in patch bundle:"

Huh? Patch bundle? Then I remembered that the unvert patch is stored as
a bundle and indeed

ben@yuiitsu[1]:.../darcs/hunkmove>grep -r 'DO NOT TOUCH' _darcs 
_darcs/tentative_hashed_inventory:[DO NOT TOUCH: Rebase patch
_darcs/hashed_inventory:[DO NOT TOUCH: Rebase patch
_darcs/patches/unrevert:[DO NOT TOUCH: Rebase patch

After removing the unrevert bundle everything is fine:

ben@yuiitsu[1]:.../darcs/hunkmove>rm _darcs/patches/unrevert 
ben@yuiitsu[1]:.../darcs/hunkmove>darcs rebase log             
Rebase finished!
ben@yuiitsu[1]:.../darcs/hunkmove>grep -r 'DO NOT TOUCH' _darcs
ben@yuiitsu[1]:.../darcs/hunkmove>

Do we have tests for interaction of revert with rebase?
msg20029 (view) Author: bf Date: 2018-03-25.13:46:53
Attched is a failing shell test.
Attachments
msg20039 (view) Author: gh Date: 2018-03-26.15:01:57
I pushed the failing test patch to screened and reviewed.
History
Date User Action Args
2018-03-09 23:45:50bfcreate
2018-03-10 00:18:15bfsetmessages: + msg19959
2018-03-25 10:26:54bfsettitle: rebase pull leaves rebase patch in the repo if suspend is cancelled -> rebase then revert adds the rebase patch to the unrevert bundle
2018-03-25 13:46:55bfsetfiles: + accept-issue2575_-rebase-then-revert-leaves-rebase-patch-in-unrevert-bundle.dpatch
messages: + msg20029
2018-03-26 15:01:59ghsetmessages: + msg20039
2018-03-26 20:32:20bfsetstatus: unknown -> resolved
milestone: 2.14.0 HEAD
resolvedin: 2.14.0 HEAD