Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
Represents a revision walker.
Synopsis
- newtype RevisionWalker = RevisionWalker (ManagedPtr RevisionWalker)
- class (GObject o, IsDescendantOf RevisionWalker o) => IsRevisionWalker o
- toRevisionWalker :: (MonadIO m, IsRevisionWalker o) => o -> m RevisionWalker
- revisionWalkerGetRepository :: (HasCallStack, MonadIO m, IsRevisionWalker a) => a -> m (Maybe Repository)
- revisionWalkerHide :: (HasCallStack, MonadIO m, IsRevisionWalker a) => a -> OId -> m ()
- revisionWalkerHideGlob :: (HasCallStack, MonadIO m, IsRevisionWalker a) => a -> Text -> m ()
- revisionWalkerHideHead :: (HasCallStack, MonadIO m, IsRevisionWalker a) => a -> m ()
- revisionWalkerHideRef :: (HasCallStack, MonadIO m, IsRevisionWalker a) => a -> Text -> m ()
- revisionWalkerNew :: (HasCallStack, MonadIO m, IsRepository a) => a -> m (Maybe RevisionWalker)
- revisionWalkerNext :: (HasCallStack, MonadIO m, IsRevisionWalker a) => a -> m (Maybe OId)
- revisionWalkerPush :: (HasCallStack, MonadIO m, IsRevisionWalker a) => a -> OId -> m ()
- revisionWalkerPushGlob :: (HasCallStack, MonadIO m, IsRevisionWalker a) => a -> Text -> m ()
- revisionWalkerPushHead :: (HasCallStack, MonadIO m, IsRevisionWalker a) => a -> m ()
- revisionWalkerPushRange :: (HasCallStack, MonadIO m, IsRevisionWalker a) => a -> Text -> m ()
- revisionWalkerPushRef :: (HasCallStack, MonadIO m, IsRevisionWalker a) => a -> Text -> m ()
- revisionWalkerReset :: (HasCallStack, MonadIO m, IsRevisionWalker a) => a -> m ()
- revisionWalkerSetSortMode :: (HasCallStack, MonadIO m, IsRevisionWalker a) => a -> [SortMode] -> m ()
- clearRevisionWalkerRepository :: (MonadIO m, IsRevisionWalker o) => o -> m ()
- constructRevisionWalkerRepository :: (IsRevisionWalker o, MonadIO m, IsRepository a) => a -> m (GValueConstruct o)
- getRevisionWalkerRepository :: (MonadIO m, IsRevisionWalker o) => o -> m (Maybe Repository)
- setRevisionWalkerRepository :: (MonadIO m, IsRevisionWalker o, IsRepository a) => o -> a -> m ()
Exported types
newtype RevisionWalker Source #
Memory-managed wrapper type.
RevisionWalker (ManagedPtr RevisionWalker) |
Instances
Eq RevisionWalker Source # | |
Defined in GI.Ggit.Objects.RevisionWalker (==) :: RevisionWalker -> RevisionWalker -> Bool (/=) :: RevisionWalker -> RevisionWalker -> Bool | |
GObject RevisionWalker Source # | |
Defined in GI.Ggit.Objects.RevisionWalker | |
ManagedPtrNewtype RevisionWalker Source # | |
Defined in GI.Ggit.Objects.RevisionWalker toManagedPtr :: RevisionWalker -> ManagedPtr RevisionWalker | |
TypedObject RevisionWalker Source # | |
Defined in GI.Ggit.Objects.RevisionWalker glibType :: IO GType | |
IsGValue RevisionWalker Source # | Convert |
Defined in GI.Ggit.Objects.RevisionWalker toGValue :: RevisionWalker -> IO GValue fromGValue :: GValue -> IO RevisionWalker | |
HasParentTypes RevisionWalker Source # | |
Defined in GI.Ggit.Objects.RevisionWalker | |
type ParentTypes RevisionWalker Source # | |
Defined in GI.Ggit.Objects.RevisionWalker |
class (GObject o, IsDescendantOf RevisionWalker o) => IsRevisionWalker o Source #
Type class for types which can be safely cast to RevisionWalker
, for instance with toRevisionWalker
.
Instances
(GObject o, IsDescendantOf RevisionWalker o) => IsRevisionWalker o Source # | |
Defined in GI.Ggit.Objects.RevisionWalker |
toRevisionWalker :: (MonadIO m, IsRevisionWalker o) => o -> m RevisionWalker Source #
Cast to RevisionWalker
, for types for which this is known to be safe. For general casts, use castTo
.
Methods
Overloaded methods
getRepository
revisionWalkerGetRepository Source #
:: (HasCallStack, MonadIO m, IsRevisionWalker a) | |
=> a |
|
-> m (Maybe Repository) | Returns: the repository on which this walker is operating or |
Gets the repository on which this walker is operating.
hide
:: (HasCallStack, MonadIO m, IsRevisionWalker a) | |
=> a |
|
-> OId |
|
-> m () | (Can throw |
Marks a commit (and its ancestors) uninteresting for the output.
The given OID must belong to a commit on the walked repository.
The resolved commit and all its parents will be hidden from the output on the revision walk.
hideGlob
revisionWalkerHideGlob Source #
:: (HasCallStack, MonadIO m, IsRevisionWalker a) | |
=> a |
|
-> Text |
|
-> m () | (Can throw |
Hide all OIDs pointed to by references that match the given glob pattern to the revsision walker. A leading 'refs/' is implied if not present, as well as a trailing '/ \ *' if the glob lacks '?', '\ *' or '['.
hideHead
revisionWalkerHideHead Source #
:: (HasCallStack, MonadIO m, IsRevisionWalker a) | |
=> a |
|
-> m () | (Can throw |
Hide the OID of the current HEAD to the revision walker.
hideRef
revisionWalkerHideRef Source #
:: (HasCallStack, MonadIO m, IsRevisionWalker a) | |
=> a |
|
-> Text |
|
-> m () | (Can throw |
Hide the OID pointed to by the named reference to the revision walker.
new
:: (HasCallStack, MonadIO m, IsRepository a) | |
=> a |
|
-> m (Maybe RevisionWalker) | Returns: a new |
Creates a new revision walker to iterate through repository
.
This revision walker uses a custom memory pool and an internal commit cache, so it is relatively expensive to allocate.
For maximum performance, this revision walker should be reused for different walks.
This revision walker is *not* thread safe: it may only be used to walk a repository on a single thread; however, it is possible to have several revision walkers in several different threads walking the same repository.
next
:: (HasCallStack, MonadIO m, IsRevisionWalker a) | |
=> a |
|
-> m (Maybe OId) | Returns: the next commit from the revision walk or |
Gets the next commit from the revision walk.
The initial call to this method is *not* blocking when iterating through a repository with a time-sorting mode.
Iterating with Topological or inverted modes makes the initial call blocking to preprocess the commit list, but this block should be mostly unnoticeable on most repositories (topological preprocessing times at 0.3s on the git.git repo).
The revision walker is reset when the walk is over.
push
:: (HasCallStack, MonadIO m, IsRevisionWalker a) | |
=> a |
|
-> OId |
|
-> m () | (Can throw |
Marks a commit to start traversal from.
The given OID must belong to a commit on the walked repository.
The given commit will be used as one of the roots when starting the revision walk. At least one commit must be pushed the repository before a walk can be started.
pushGlob
revisionWalkerPushGlob Source #
:: (HasCallStack, MonadIO m, IsRevisionWalker a) | |
=> a |
|
-> Text |
|
-> m () | (Can throw |
Push all OIDs pointed to by references that match the given glob pattern to the revsision walker. A leading 'refs/' is implied if not present, as well as a trailing '/ \ *' if the glob lacks '?', '\ *' or '['.
pushHead
revisionWalkerPushHead Source #
:: (HasCallStack, MonadIO m, IsRevisionWalker a) | |
=> a |
|
-> m () | (Can throw |
Push the OID of the current HEAD to the revision walker.
pushRange
revisionWalkerPushRange Source #
:: (HasCallStack, MonadIO m, IsRevisionWalker a) | |
=> a |
|
-> Text |
|
-> m () | (Can throw |
Push and hide the respective endpoints of the given range. The range should be of the form: <commit>..<commit>, where each <commit> is in the form accepted by revparse. The left-hand commit will be hidden and the right-hand commit pushed.
pushRef
revisionWalkerPushRef Source #
:: (HasCallStack, MonadIO m, IsRevisionWalker a) | |
=> a |
|
-> Text |
|
-> m () | (Can throw |
Push the OID pointed to by the named reference to the revision walker.
reset
:: (HasCallStack, MonadIO m, IsRevisionWalker a) | |
=> a |
|
-> m () |
Resets the revision walker for reuse.
This will clear all the pushed and hidden commits, and leave the walker in a blank state (just like at creation) ready to receive new commit pushes and start a new walk.
The revision walk is automatically reset when a walk is over.
setSortMode
revisionWalkerSetSortMode Source #
:: (HasCallStack, MonadIO m, IsRevisionWalker a) | |
=> a |
|
-> [SortMode] |
|
-> m () |
Change the sorting mode when iterating through the repository's contents.
Changing the sorting mode resets the walker.
Properties
repository
No description available in the introspection data.
clearRevisionWalkerRepository :: (MonadIO m, IsRevisionWalker o) => o -> m () Source #
Set the value of the “repository
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#repository
constructRevisionWalkerRepository :: (IsRevisionWalker o, MonadIO m, IsRepository a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “repository
” property. This is rarely needed directly, but it is used by new
.
getRevisionWalkerRepository :: (MonadIO m, IsRevisionWalker o) => o -> m (Maybe Repository) Source #
Get the value of the “repository
” property.
When overloading is enabled, this is equivalent to
get
revisionWalker #repository
setRevisionWalkerRepository :: (MonadIO m, IsRevisionWalker o, IsRepository a) => o -> a -> m () Source #
Set the value of the “repository
” property.
When overloading is enabled, this is equivalent to
set
revisionWalker [ #repository:=
value ]