DManager.DManagerRepository

Base class for a DManager Git repository.

class DManager
class DManagerRepository : ManagedRepository {}

Constructors

this
this()
Undocumented in source.

Members

Functions

log
void log(string s)
Undocumented in source. Be warned that the author may not have intended to support it.

Inherited Members

From ManagedRepository

git
const(Git) git [@property getter]

Git repository we manage.

offline
bool offline;

Should we fetch the latest stuff?

verify
bool verify;

Verify working tree state to make sure we don't clobber user changes?

getRepo
Git getRepo()

Repository provider

name
string name [@property getter]

Base name of the repository directory

needHead
void needHead(string hash)

Ensure the repository's HEAD is as indicated.

getRef
string getRef(string name)

Returns the SHA1 of the given named ref.

getHead
string getHead()

Return the commit the repository HEAD is pointing at. Cache the result.

performCheckout
void performCheckout(string hash)
Undocumented in source. Be warned that the author may not have intended to support it.
needCommit
void needCommit(string hash)

Ensure that the specified commit is fetched.

update
bool update()

Update the remote. Return true if any updates were fetched.

clean
bool clean;

True when we know that the repository is currently clean.

needClean
void needClean()

Ensure the repository's working copy is clean.

MergeMode
enum MergeMode

How to merge a branch into another

getMerge
string getMerge(string target, string[2] branch, MergeMode mode)

Returns the hash of the merge between the target and branch commits. Performs the merge if necessary. Caches the result.

getRevert
string getRevert(string target, string[2] branch, MergeMode mode)

Returns the resulting hash when reverting the branch from the base commit. Performs the revert if necessary. Caches the result. mainline is the 1-based mainline index (as per man git-revert), or 0 if commit is not a merge commit.

getMergeInfo
MergeInfo getMergeInfo(string merge)

Finds and returns the merge parents of the given merge commit. Queries the git repository if necessary. Caches the result.

getUnMerge
string getUnMerge(string head, string[2] branch, MergeMode mode)

Follows the string of merges starting from the given head commit, up till the merge with the given branch. Then, reapplies all merges in order, except for that with the given branch.

getRemoteRef
string getRemoteRef(string remote, string remoteRef, string localRef)

Return SHA1 of the given remote ref. Fetches the remote first, unless offline mode is on.

getPullTip
string getPullTip(int pull)

Return SHA1 of the given pull request #. Fetches the pull request first, unless offline mode is on.

getBranch
string[2] getBranch(string user, string base, string tip)

Return SHA1 (base, tip) of the given branch (possibly of GitHub fork). Fetches the fork first, unless offline mode is on. (This is a thin wrapper around getRemoteRef.)

getChild
void getChild(string branch, string commit, string child, int mainline)

Find the child of a commit, and, if the commit was a merge, the mainline index of said commit for the child.

getState
RepositoryState getState()

Return the working tree "state". This returns a file list, along with size and modification time.

saveState
void saveState()

Save the state of the working tree for versioned files to a .json file, which can later be verified with checkState. This should be called after any git command which mutates the git state.

saveFileState
void saveFileState(string file)

Save the state of just one file. This should be called after automatic edits to repository files during a build. The file parameter should be relative to the directory root, and use forward slashes.

checkState
void checkState()

Verify that the state of the working tree matches the one when saveState was last called. Throw an exception otherwise. This and clearState should be called before any git command which destroys working directory changes.

clearState
void clearState()

Delete the saved working tree state, if any.

reset
void reset()

Reset internal state.

log
void log(string line)

Override to add logging.

Meta