darcs-2.12.5: a distributed, interactive, smart revision control system

Safe Haskell | None
Language | Haskell2010

Darcs.Patch.Rebase.Item

Synopsis

- data RebaseItem p wX wY where
  - ToEdit :: Named p wX wY -> RebaseItem p wX wY
  - Fixup :: RebaseFixup p wX wY -> RebaseItem p wX wY
- simplifyPush :: (PrimPatchBase p, Commute p, FromPrim p, Effect p) => DiffAlgorithm -> RebaseFixup p wX wY -> FL (RebaseItem p) wY wZ -> Sealed (FL (RebaseItem p) wX)
- simplifyPushes :: (PrimPatchBase p, Commute p, FromPrim p, Effect p) => DiffAlgorithm -> FL (RebaseFixup p) wX wY -> FL (RebaseItem p) wY wZ -> Sealed (FL (RebaseItem p) wX)
- countToEdit :: FL (RebaseItem p) wX wY -> Int

# Documentation

data RebaseItem p wX wY where #

A single item in the rebase state consists of either a patch that is being edited, or a fixup that adjusts the context so that a subsequent patch that is being edited "makes sense".

`ToEdit` holds a patch that is being edited. The name (`PatchInfo`) of the patch will typically be the name the patch had before it was added to the rebase state; if it is moved back into the repository it must be given a fresh name to account for the fact that it will not necessarily have the same dependencies as the original patch. This is typically done by changing the `Ignore-This` junk.

`Fixup` adjusts the context so that a subsequent `ToEdit` patch is correct. Where possible, `Fixup` changes are commuted as far as possible into the rebase state, so any remaining ones will typically cause a conflict when the `ToEdit` patch is moved back into the repository.

Constructors

ToEdit :: Named p wX wY -> RebaseItem p wX wY |
Fixup :: RebaseFixup p wX wY -> RebaseItem p wX wY |

Instances

(Show2 p, Show2 (PrimOf p)) => Show2 (RebaseItem p) # |
Methods showDict2 :: ShowDict (RebaseItem p wX wY) #
(PrimPatchBase p, PatchInspect p) => PatchInspect (RebaseItem p) # |
Methods listTouchedFiles :: RebaseItem p wX wY -> [FilePath] # hunkMatches :: (ByteString -> Bool) -> RebaseItem p wX wY -> Bool #
(PrimPatchBase p, PatchListFormat p, ReadPatch p) => ReadPatch (RebaseItem p) # |
Methods readPatch' :: ParserM m => m (Sealed (RebaseItem p wX)) #
Check p => Check (RebaseItem p) # |
Methods isInconsistent :: RebaseItem p wX wY -> Maybe Doc #
(PrimPatchBase p, PatchListFormat p, Apply p, CommuteNoConflicts p, Conflict p, IsHunk p, ShowPatch p) => ShowPatch (RebaseItem p) # |
Methods showNicely :: RebaseItem p wX wY -> Doc # showContextPatch :: (Monad m, ApplyMonad (ApplyState (RebaseItem p)) m) => RebaseItem p wX wY -> m Doc # description :: RebaseItem p wX wY -> Doc # summary :: RebaseItem p wX wY -> Doc # summaryFL :: FL (RebaseItem p) wX wY -> Doc # thing :: RebaseItem p wX wY -> String # things :: RebaseItem p wX wY -> String #
(PrimPatchBase p, PatchListFormat p, ShowPatchBasic p) => ShowPatchBasic (RebaseItem p) # |
Methods showPatch :: RebaseItem p wX wY -> Doc #
(Show2 p, Show2 (PrimOf p)) => Show1 (RebaseItem p wX) # |
Methods showDict1 :: ShowDict (RebaseItem p wX wX) #
(Show2 p, Show2 (PrimOf p)) => Show (RebaseItem p wX wY) # |
Methods showsPrec :: Int -> RebaseItem p wX wY -> ShowS # show :: RebaseItem p wX wY -> String # showList :: [RebaseItem p wX wY] -> ShowS #

simplifyPush :: (PrimPatchBase p, Commute p, FromPrim p, Effect p) => DiffAlgorithm -> RebaseFixup p wX wY -> FL (RebaseItem p) wY wZ -> Sealed (FL (RebaseItem p) wX) #

Given a list of rebase items, try to push a new fixup as far as possible into the list as possible, using both commutation and coalescing. If the fixup commutes past all the `ToEdit` patches then it is dropped entirely.

simplifyPushes :: (PrimPatchBase p, Commute p, FromPrim p, Effect p) => DiffAlgorithm -> FL (RebaseFixup p) wX wY -> FL (RebaseItem p) wY wZ -> Sealed (FL (RebaseItem p) wX) #

Like `simplifyPush` but for a list of fixups.

countToEdit :: FL (RebaseItem p) wX wY -> Int #