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

Safe HaskellNone
LanguageHaskell2010

Darcs.UI.PatchHeader

Synopsis

Documentation

getLog Source #

Arguments

:: PrimPatch prim 
=> Maybe String

patchname option

-> Bool

pipe option

-> Logfile

logfile option

-> Maybe AskLongComment

askLongComment option

-> Maybe (String, [String])

possibly an existing patch name and long description

-> FL prim wX wY

changes to record

-> IO (String, [String], Maybe String)

patch name, long description and possibly the path to the temporary file that should be removed later

Get the patch name and long description from one of

  • the configuration (flags, defaults, hard-coded)
  • an existing log file
  • stdin (e.g. a pipe)
  • a text editor

It ensures the patch name is not empty nor starts with the prefix TAG.

The last result component is a possible path to a temporary file that should be removed later.

getAuthor Source #

Arguments

:: String

verb: command name

-> Bool

select: prompt for new auhor

-> Maybe String

new author: explict new author

-> PatchInfo

patch to update

-> HijackT IO String 

getAuthor tries to return the updated author for the patch. There are two different scenarios:

  • [explicit] Either we want to override the patch author, be it by prompting the user (select) or having them pass it in from the UI (new_author), or
  • [implicit] We want to keep the original author, in which case we also double-check that we are not inadvertently "hijacking" somebody else's patch (if the patch author is not the same as the repository author, we give them a chance to abort the whole operation)

updatePatchHeader Source #

Arguments

:: (IsRepoType rt, RepoPatch p, ApplyState p ~ Tree) 
=> String

verb: command name

-> AskAboutDeps rt p wR wU wT 
-> PatchSelectionOptions 
-> DiffAlgorithm 
-> Bool 
-> Bool 
-> Maybe String 
-> Maybe String 
-> Maybe AskLongComment 
-> Named (PrimOf p) wT wX

patch to edit, must be conflict-free as conflicts can't be preserved when changing the identity of a patch. If necessary this can be achieved by calling fmapFL_Named effect on an Named p first, but some callers might already have Named (PrimOf p) available.

-> FL (PrimOf p) wX wY

new primitives to add

-> HijackT IO (Maybe String, PatchInfoAnd rt p wT wY) 

Update the metadata for a patch. This potentially involves a bit of interactivity, so we may return Nothing if there is cause to abort what we're doing along the way

data AskAboutDeps rt p wR wU wT Source #

specify whether to ask about dependencies with respect to a particular repository, or not

Constructors

AskAboutDeps (Repository rt p wR wU wT) 
NoAskAboutDeps 

type HijackT = StateT HijackOptions Source #

Transformer for interactions with a hijack warning state that we need to thread through

data HijackOptions Source #

Options for how to deal with the situation where we are somehow modifying a patch that is not our own

Constructors

IgnoreHijack

accept all hijack requests

RequestHijackPermission

prompt once, accepting subsequent hijacks if yes

AlwaysRequestHijackPermission

always prompt

runHijackT :: Monad m => HijackOptions -> HijackT m a -> m a Source #

Run a job that involves a hijack confirmation prompt.

See RequestHijackPermission for initial values