eric7.Plugins.VcsPlugins.vcsGit.git

Module implementing the version control systems interface to Git.

Global Attributes

None

Classes

Git Class implementing the version control systems interface to Git.

Functions

None


Git

Class implementing the version control systems interface to Git.

Signals

committed()
emitted after the commit action has completed

Derived from

VersionControl

Class Attributes

IgnoreFileName

Class Methods

None

Methods

Git Constructor
__gitGetFileForRevision Private method to get a file for a specific revision from the repository.
__gitGetStashesList Private method to get a list of stash names.
__gitSubmodulesList Private method to get the data of defined submodules.
__selectSubmodulePath Private method to select a submodule path.
__selectSubmodulePaths Private method to select a list of submodule paths.
__vcsCommit_Step2 Private slot performing the second step of the commit action.
_createStatusMonitorThread Protected method to create an instance of the VCS status monitor thread.
clearStatusCache Public method to clear the status cache.
findRepoRoot Public method to find the repository root directory given a start.
getPlugin Public method to get a reference to the plugin object.
gitAddRemote Public method to add a remote repository.
gitApply Public method to apply a patch stored in a given file.
gitApplyCheckPatches Public method to apply a list of patch files or check, if they would apply cleanly.
gitBisect Public method to perform bisect commands.
gitBisectCreateReplayFile Public method used to create a bisect replay file for the project.
gitBisectEditReplayFile Public method used to edit a bisect replay file.
gitBisectLogBrowser Public method used to browse the bisect log of the project.
gitBisectReplay Public method to replay a bisect session.
gitBlame Public method to show the output of the git blame command.
gitBranch Public method used to create, delete or move a branch in the Git repository.
gitBundle Public method to create a bundle file.
gitBundleFetch Public method to fetch a head of a bundle file into the local repository.
gitBundleListHeads Public method to list the heads contained in a bundle file.
gitBundlePull Public method to pull a head of a bundle file into the local repository and working area.
gitCancelMerge Public method to cancel an uncommitted or failed merge.
gitChangeRemoteCredentials Public method to change the user credentials of a remote repository.
gitChangeRemoteUrl Public method to change the URL of a remote repository.
gitCherryPick Public method to cherry pick commits and apply them to the current branch.
gitCherryPickAbort Public method to cancel the last copying session and return to the previous state.
gitCherryPickContinue Public method to continue the last copying session after conflicts were resolved.
gitCherryPickQuit Public method to quit the current copying operation.
gitCommitMerge Public method to commit a failed merge.
gitCopy Public method used to copy a file/directory.
gitCreateArchive Public method to show some statistics of the local repository.
gitCreateIgnoreFile Public method to create the ignore file.
gitDeleteRemoteBranch Public method to delete a branch from a remote repository.
gitDescribe Public method to find the most recent tag reachable from each commit.
gitEditConfig Public method used to edit the repository configuration file.
gitEditUserConfig Public method used to edit the user configuration file.
gitExtendedDiff Public method used to view the difference of a file/directory to the Git repository.
gitFetch Public method to fetch changes from a remote repository.
gitGetArchiveFormats Public method to get a list of supported archive formats.
gitGetBranchesList Public method to get the list of branches.
gitGetBundleHeads Public method to get a list of heads contained in a bundle file.
gitGetCurrentBranch Public method used to show the current branch of the working directory.
gitGetRemoteBranchesList Public method to get the list of a remote repository branches.
gitGetRemoteUrl Public method to get the URL of a remote repository.
gitGetRemoteUrlsList Public method to get the list of remote repos and their URLs.
gitGetRemotesList Public method to get the list of remote repos.
gitGetTagsList Public method to get the list of tags.
gitHouseKeeping Public method to cleanup and optimize the local repository.
gitListTagBranch Public method used to list the available tags or branches.
gitNormalizeURL Public method to normalize a url for Git.
gitPruneRemote Public method to prune stale remote-tracking branches.
gitPull Public method used to pull changes from a remote Git repository.
gitPush Public method used to push changes to a remote Git repository.
gitReflogBrowser Public method used to browse the reflog of the project.
gitRemoveRemote Public method to remove a remote repository.
gitRenameRemote Public method to rename a remote repository.
gitShortlog Public method to show a short log suitable for inclusion in release announcements.
gitShowBranch Public method used to show the current branch of the working directory.
gitShowConfig Public method to show the combined configuration.
gitShowPatchesStatistics Public method to show statistics for a set of patch files.
gitShowRemote Public method to show information about a remote repository.
gitShowRemotes Public method to show available remote repositories.
gitStashApply Public method to apply a stash but keep it.
gitStashBranch Public method to create a branch from a stash.
gitStashBrowser Public method used to browse the stashed changes.
gitStashClear Public method to delete all stashes.
gitStashDrop Public method to delete a stash.
gitStashPop Public method to apply a stash and delete it.
gitStashSave Public method to save the current changes to a new stash.
gitStashShowPatch Public method to show the contents of a stash.
gitStatistics Public method to show some statistics of the local repository.
gitSubmoduleAdd Public method to add a submodule to the project.
gitSubmoduleDeinit Public method to unregister submodules.
gitSubmoduleInit Public method to initialize one or all submodules.
gitSubmoduleList Public method to show a list of all submodules of the project.
gitSubmoduleStatus Public method to show the status of the submodules.
gitSubmoduleSummary Public method to show the status of the submodules.
gitSubmoduleSync Public method to synchronize submodules.
gitSubmoduleUpdate Public method to update submodules.
gitSubmoduleUpdateWithOptions Public method to update submodules offering a dialog to select the update options.
gitUnstage Public method used to unstage a file/directory.
gitVerify Public method to verify the connectivity and validity of objects of the database.
gitVerifyBundle Public method to verify a bundle file.
gitWorktreeManagement Public method to show the worktree list/management dialog.
initCommand Public method to initialize a command arguments list.
vcsAdd Public method used to add a file/directory to the Git repository.
vcsAddBinary Public method used to add a file/directory in binary mode to the Git repository.
vcsAddCommitMessage Public method to add a commit message to the list of saved messages.
vcsAddTree Public method to add a directory tree rooted at path to the Git repository.
vcsAllRegisteredStates Public method used to get the registered states of a number of files in the vcs.
vcsCheckout Public method used to check the project out of a Git repository (clone).
vcsCleanup Public method used to cleanup the working directory.
vcsClearCommitMessages Public method to clear the list of saved messages.
vcsCommandLine Public method used to execute arbitrary Git commands.
vcsCommit Public method used to make the change of a file/directory permanent in the Git repository.
vcsCommitMessages Public method to get the list of saved commit messages.
vcsConvertProject Public method to convert an uncontrolled project to a version controlled project.
vcsDiff Public method used to view the difference of a file/directory to the Git repository.
vcsExists Public method used to test for the presence of the git executable.
vcsExport Public method used to export a directory from the Git repository.
vcsForget Public method used to remove a file from the Mercurial repository.
vcsGetProjectBrowserHelper Public method to instantiate a helper object for the different project browsers.
vcsGetProjectHelper Public method to instantiate a helper object for the project.
vcsImport Public method used to import the project into the Git repository.
vcsInit Public method used to initialize the Git repository.
vcsInitConfig Public method to initialize the VCS configuration.
vcsLogBrowser Public method used to browse the log of a file/directory from the Git repository.
vcsMerge Public method used to merge a URL/revision into the local project.
vcsMove Public method used to move a file/directory.
vcsName Public method returning the name of the vcs.
vcsNewProjectOptionsDialog Public method to get a dialog to enter repository info for getting a new project.
vcsOptionsDialog Public method to get a dialog to enter repository info.
vcsRegisteredState Public method used to get the registered state of a file in the vcs.
vcsRemove Public method used to remove a file/directory from the Git repository.
vcsRepositoryInfos Public method to retrieve information about the repository.
vcsRevert Public method used to revert changes made to a file/directory.
vcsSbsDiff Public method used to view the difference of a file to the Git repository side-by-side.
vcsShutdown Public method used to shutdown the Git interface.
vcsStatus Public method used to view the status of files/directories in the Git repository.
vcsSupportCommandOptions Public method to signal the support of user settable command options.
vcsSwitch Public method used to switch a working directory to a different revision.
vcsTag Public method used to set/remove a tag in the Git repository.
vcsUpdate Public method used to update a file/directory with the Git repository.

Static Methods

None

Git (Constructor)

Git(plugin, parent=None, name=None)

Constructor

plugin (VcsGitPlugin)
reference to the plugin object
parent (QWidget)
parent widget
name (str)
name of this object

Git.__gitGetFileForRevision

__gitGetFileForRevision(name, rev="")

Private method to get a file for a specific revision from the repository.

name (str)
file name to get from the repository
rev (str)
revision to retrieve
Return:
contents of the file (string) and an error message
Return Type:
str

Git.__gitGetStashesList

__gitGetStashesList(projectDir)

Private method to get a list of stash names.

projectDir (str)
name of the project directory
Return:
list of available stashes
Return Type:
list of str

Git.__gitSubmodulesList

__gitSubmodulesList(repodir)

Private method to get the data of defined submodules.

repodir (str)
name of the directory containing the repo subdirectory
Return:
list of dictionaries with submodule name, path, URL and branch
Return Type:
list of dict

Git.__selectSubmodulePath

__selectSubmodulePath(repodir)

Private method to select a submodule path.

repodir (str)
name of the directory containing the repo subdirectory
Return:
tuple of selected submodule path and flag indicating a cancellation
Return Type:
tuple of (str, bool)

Git.__selectSubmodulePaths

__selectSubmodulePaths(repodir)

Private method to select a list of submodule paths.

repodir (str)
name of the directory containing the repo subdirectory
Return:
tuple of selected submodule paths and flag indicating a cancellation
Return Type:
tuple of (list of str, bool)

Git.__vcsCommit_Step2

__vcsCommit_Step2()

Private slot performing the second step of the commit action.

Git._createStatusMonitorThread

_createStatusMonitorThread(interval, project)

Protected method to create an instance of the VCS status monitor thread.

interval (int)
check interval for the monitor thread in seconds
project (Project)
reference to the project object
Return:
reference to the monitor thread
Return Type:
GitStatusMonitorThread

Git.clearStatusCache

clearStatusCache()

Public method to clear the status cache.

Git.findRepoRoot

findRepoRoot(start)

Public method to find the repository root directory given a start.

start (str)
start directory name
Return:
directory name of the repository root or None, if it was not found
Return Type:
str or None

Git.getPlugin

getPlugin()

Public method to get a reference to the plugin object.

Return:
reference to the plugin object
Return Type:
VcsGitPlugin

Git.gitAddRemote

gitAddRemote(projectDir)

Public method to add a remote repository.

projectDir (str)
name of the project directory

Git.gitApply

gitApply(repodir, patchFile, cached=False, reverse=False, noDialog=False)

Public method to apply a patch stored in a given file.

repodir (str)
directory name of the repository
patchFile (str)
name of the patch file
cached (bool)
flag indicating to apply the patch to the staging area
reverse (bool)
flag indicating to apply the patch in reverse
noDialog (bool)
flag indicating quiet operations

Git.gitApplyCheckPatches

gitApplyCheckPatches(projectDir, check=False)

Public method to apply a list of patch files or check, if they would apply cleanly.

projectDir (str)
directory name of the project
check (bool)
flag indicating to perform a check operation

Git.gitBisect

gitBisect(projectDir, subcommand)

Public method to perform bisect commands.

projectDir (str)
name of the project directory
subcommand (str)
name of the subcommand (one of 'start', 'start_extended', 'good', 'bad', 'skip' or 'reset')
Return:
flag indicating, that the update contained an add or delete
Return Type:
bool
Raises ValueError:
raised to indicate an invalid bisect subcommand

Git.gitBisectCreateReplayFile

gitBisectCreateReplayFile(projectDir)

Public method used to create a bisect replay file for the project.

projectDir (str)
name of the project directory

Git.gitBisectEditReplayFile

gitBisectEditReplayFile(projectDir)

Public method used to edit a bisect replay file.

projectDir (str)
name of the project directory

Git.gitBisectLogBrowser

gitBisectLogBrowser(projectDir)

Public method used to browse the bisect log of the project.

projectDir (str)
name of the project directory

Git.gitBisectReplay

gitBisectReplay(projectDir)

Public method to replay a bisect session.

projectDir (str)
name of the project directory
Return:
flag indicating, that the update contained an add or delete
Return Type:
bool

Git.gitBlame

gitBlame(name, skiplist="")

Public method to show the output of the git blame command.

name (str)
file name to show the annotations for
skiplist (str)
name of a skip list file

Git.gitBranch

gitBranch(name, revision=None, branchName=None, branchOp=None)

Public method used to create, delete or move a branch in the Git repository.

name (str)
file/directory name to be branched
revision (str)
revision to set tag for
branchName (str)
name of the branch
branchOp (int)
desired branch operation
Return:
flag indicating a performed branch action and a flag indicating, that the branch operation contained an add or delete
Return Type:
tuple of (bool, bool)

Git.gitBundle

gitBundle(projectDir)

Public method to create a bundle file.

projectDir (str)
name of the project directory

Git.gitBundleFetch

gitBundleFetch(projectDir)

Public method to fetch a head of a bundle file into the local repository.

projectDir (str)
name of the project directory

Git.gitBundleListHeads

gitBundleListHeads(projectDir)

Public method to list the heads contained in a bundle file.

projectDir (str)
name of the project directory

Git.gitBundlePull

gitBundlePull(projectDir)

Public method to pull a head of a bundle file into the local repository and working area.

projectDir (str)
name of the project directory
Return:
flag indicating, that the update contained an add or delete
Return Type:
bool

Git.gitCancelMerge

gitCancelMerge(name)

Public method to cancel an uncommitted or failed merge.

name (str)
file/directory name
Return:
flag indicating, that the cancellation contained an add or delete
Return Type:
bool

Git.gitChangeRemoteCredentials

gitChangeRemoteCredentials(projectDir, remoteName, remoteUrl="")

Public method to change the user credentials of a remote repository.

projectDir (str)
name of the project directory
remoteName (str)
name of the remote repository
remoteUrl (str)
URL of the remote repository

Git.gitChangeRemoteUrl

gitChangeRemoteUrl(projectDir, remoteName, remoteUrl="")

Public method to change the URL of a remote repository.

projectDir (str)
name of the project directory
remoteName (str)
name of the remote repository
remoteUrl (str)
URL of the remote repository

Git.gitCherryPick

gitCherryPick(projectDir, commits=None)

Public method to cherry pick commits and apply them to the current branch.

projectDir (str)
name of the project directory
commits (list of str)
list of commits to be applied
Return:
flag indicating that the project should be reread
Return Type:
bool

Git.gitCherryPickAbort

gitCherryPickAbort(projectDir)

Public method to cancel the last copying session and return to the previous state.

projectDir (str)
name of the project directory
Return:
flag indicating that the project should be reread
Return Type:
bool

Git.gitCherryPickContinue

gitCherryPickContinue(projectDir)

Public method to continue the last copying session after conflicts were resolved.

projectDir (str)
name of the project directory
Return:
flag indicating that the project should be reread
Return Type:
bool

Git.gitCherryPickQuit

gitCherryPickQuit(projectDir)

Public method to quit the current copying operation.

projectDir (str)
name of the project directory
Return:
flag indicating that the project should be reread
Return Type:
bool

Git.gitCommitMerge

gitCommitMerge(name)

Public method to commit a failed merge.

name (str)
file/directory name

Git.gitCopy

gitCopy(name, project)

Public method used to copy a file/directory.

name (str)
file/directory name to be copied
project (Project)
reference to the project object
Return:
flag indicating successful operation
Return Type:
bool

Git.gitCreateArchive

gitCreateArchive(projectDir)

Public method to show some statistics of the local repository.

projectDir (str)
name of the project directory

Git.gitCreateIgnoreFile

gitCreateIgnoreFile(name, autoAdd=False)

Public method to create the ignore file.

name (str)
directory name to create the ignore file in
autoAdd (bool)
flag indicating to add it automatically
Return:
flag indicating success
Return Type:
bool

Git.gitDeleteRemoteBranch

gitDeleteRemoteBranch(name)

Public method to delete a branch from a remote repository.

name (str)
file/directory name

Git.gitDescribe

gitDescribe(projectDir, commits)

Public method to find the most recent tag reachable from each commit.

projectDir (str)
name of the project directory
commits (list of str)
list of commits to start the search from

Git.gitEditConfig

gitEditConfig(projectDir)

Public method used to edit the repository configuration file.

projectDir (str)
name of the project directory

Git.gitEditUserConfig

gitEditUserConfig()

Public method used to edit the user configuration file.

Git.gitExtendedDiff

gitExtendedDiff(name)

Public method used to view the difference of a file/directory to the Git repository.

If name is a directory and is the project directory, all project files are saved first. If name is a file (or list of files), which is/are being edited and has unsaved modification, they can be saved or the operation may be aborted.

This method gives the chance to enter the revisions to be compared.

name (str)
file/directory name to be diffed

Git.gitFetch

gitFetch(name)

Public method to fetch changes from a remote repository.

name (str)
directory name

Git.gitGetArchiveFormats

gitGetArchiveFormats(repodir)

Public method to get a list of supported archive formats.

repodir (str)
directory name of the repository
Return:
list of supported archive formats
Return Type:
list of str

Git.gitGetBranchesList

gitGetBranchesList(repodir, withMain=False, allBranches=False, remotes=False)

Public method to get the list of branches.

repodir (str)
directory name of the repository
withMain (bool)
flag indicating to get 'main' as well
allBranches (bool)
flag indicating to return all branches
remotes (bool)
flag indicating to return remote branches only
Return:
list of branches
Return Type:
list of str

Git.gitGetBundleHeads

gitGetBundleHeads(repodir, bundleFile)

Public method to get a list of heads contained in a bundle file.

repodir (str)
directory name of the repository
bundleFile (str)
file name of a git bundle file
Return:
list of heads
Return Type:
list of str

Git.gitGetCurrentBranch

gitGetCurrentBranch(repodir)

Public method used to show the current branch of the working directory.

repodir (str)
directory name of the repository
Return:
name of the current branch
Return Type:
str

Git.gitGetRemoteBranchesList

gitGetRemoteBranchesList(repodir, remote)

Public method to get the list of a remote repository branches.

repodir (str)
directory name of the repository
remote (str)
remote repository name
Return:
list of remote repository branches
Return Type:
list of str

Git.gitGetRemoteUrl

gitGetRemoteUrl(repodir, remoteName)

Public method to get the URL of a remote repository.

repodir (str)
directory name of the repository
remoteName (str)
name of the remote repository
Return:
URL of the remote repository
Return Type:
str

Git.gitGetRemoteUrlsList

gitGetRemoteUrlsList(repodir, forFetch=True)

Public method to get the list of remote repos and their URLs.

repodir (str)
directory name of the repository
forFetch (str)
flag indicating to get Fetch info
Return:
list of tuples of remote repo name and repo URL
Return Type:
list of [(str, str)]

Git.gitGetRemotesList

gitGetRemotesList(repodir)

Public method to get the list of remote repos.

repodir (str)
directory name of the repository
Return:
list of remote repos
Return Type:
list of str

Git.gitGetTagsList

gitGetTagsList(repodir)

Public method to get the list of tags.

repodir (str)
directory name of the repository
Return:
list of tags or list of tuples of tag name and flag indicating a local tag, if withType is True
Return Type:
list of str or list of tuple of (str, bool)

Git.gitHouseKeeping

gitHouseKeeping(projectDir)

Public method to cleanup and optimize the local repository.

projectDir (str)
name of the project directory

Git.gitListTagBranch

gitListTagBranch(path, tags=True, listAll=True, merged=True)

Public method used to list the available tags or branches.

path (str)
directory name of the project
tags (bool)
flag indicating listing of branches or tags (False = branches, True = tags)
listAll (bool)
flag indicating to show all tags or branches
merged (bool)
flag indicating to show only merged or non-merged branches

Git.gitNormalizeURL

gitNormalizeURL(url)

Public method to normalize a url for Git.

url (str)
url string
Return:
properly normalized url for git
Return Type:
str

Git.gitPruneRemote

gitPruneRemote(projectDir, remoteName)

Public method to prune stale remote-tracking branches.

projectDir (str)
name of the project directory
remoteName (str)
name of the remote repository

Git.gitPull

gitPull(name)

Public method used to pull changes from a remote Git repository.

name (str)
directory name of the project to be pulled to
Return:
flag indicating, that the update contained an add or delete
Return Type:
bool

Git.gitPush

gitPush(name)

Public method used to push changes to a remote Git repository.

name (str)
directory name of the project to be pushed from

Git.gitReflogBrowser

gitReflogBrowser(projectDir)

Public method used to browse the reflog of the project.

projectDir (str)
name of the project directory

Git.gitRemoveRemote

gitRemoveRemote(projectDir, remoteName)

Public method to remove a remote repository.

projectDir (str)
name of the project directory
remoteName (str)
name of the remote repository

Git.gitRenameRemote

gitRenameRemote(projectDir, remoteName)

Public method to rename a remote repository.

projectDir (str)
name of the project directory
remoteName (str)
name of the remote repository

Git.gitShortlog

gitShortlog(projectDir, commit)

Public method to show a short log suitable for inclusion in release announcements.

projectDir (str)
name of the project directory
commit (str)
commit to start the log at

Git.gitShowBranch

gitShowBranch(name)

Public method used to show the current branch of the working directory.

name (str)
file/directory name

Git.gitShowConfig

gitShowConfig(projectDir)

Public method to show the combined configuration.

projectDir (str)
name of the project directory

Git.gitShowPatchesStatistics

gitShowPatchesStatistics(projectDir)

Public method to show statistics for a set of patch files.

projectDir (str)
directory name of the project

Git.gitShowRemote

gitShowRemote(projectDir, remoteName)

Public method to show information about a remote repository.

projectDir (str)
name of the project directory
remoteName (str)
name of the remote repository

Git.gitShowRemotes

gitShowRemotes(projectDir)

Public method to show available remote repositories.

projectDir (str)
name of the project directory

Git.gitStashApply

gitStashApply(projectDir, stashName="")

Public method to apply a stash but keep it.

projectDir (str)
name of the project directory
stashName (str)
name of a stash
Return:
flag indicating, that the restore contained an add or delete
Return Type:
bool

Git.gitStashBranch

gitStashBranch(projectDir, stashName="")

Public method to create a branch from a stash.

projectDir (str)
name of the project directory
stashName (str)
name of a stash
Return:
flag indicating, that the restore contained an add or delete
Return Type:
bool

Git.gitStashBrowser

gitStashBrowser(projectDir)

Public method used to browse the stashed changes.

projectDir (str)
name of the project directory

Git.gitStashClear

gitStashClear(projectDir)

Public method to delete all stashes.

projectDir (str)
name of the project directory
Return:
flag indicating a successful deletion
Return Type:
bool

Git.gitStashDrop

gitStashDrop(projectDir, stashName="")

Public method to delete a stash.

projectDir (str)
name of the project directory
stashName (str)
name of a stash
Return:
flag indicating a successful deletion
Return Type:
bool

Git.gitStashPop

gitStashPop(projectDir, stashName="")

Public method to apply a stash and delete it.

projectDir (str)
name of the project directory
stashName (str)
name of a stash
Return:
flag indicating, that the restore contained an add or delete
Return Type:
bool

Git.gitStashSave

gitStashSave(projectDir)

Public method to save the current changes to a new stash.

projectDir (str)
name of the project directory
Return:
flag indicating, that the save contained an add or delete
Return Type:
bool

Git.gitStashShowPatch

gitStashShowPatch(projectDir, stashName="")

Public method to show the contents of a stash.

projectDir (str)
name of the project directory
stashName (str)
name of a stash

Git.gitStatistics

gitStatistics(projectDir)

Public method to show some statistics of the local repository.

projectDir (str)
name of the project directory

Git.gitSubmoduleAdd

gitSubmoduleAdd(projectDir)

Public method to add a submodule to the project.

projectDir (str)
name of the project directory

Git.gitSubmoduleDeinit

gitSubmoduleDeinit(projectDir)

Public method to unregister submodules.

projectDir (str)
name of the project directory

Git.gitSubmoduleInit

gitSubmoduleInit(projectDir)

Public method to initialize one or all submodules.

projectDir (str)
name of the project directory

Git.gitSubmoduleList

gitSubmoduleList(projectDir)

Public method to show a list of all submodules of the project.

projectDir (str)
name of the project directory

Git.gitSubmoduleStatus

gitSubmoduleStatus(projectDir)

Public method to show the status of the submodules.

projectDir (str)
name of the project directory

Git.gitSubmoduleSummary

gitSubmoduleSummary(projectDir)

Public method to show the status of the submodules.

projectDir (str)
name of the project directory

Git.gitSubmoduleSync

gitSubmoduleSync(projectDir)

Public method to synchronize submodules.

projectDir (str)
name of the project directory

Git.gitSubmoduleUpdate

gitSubmoduleUpdate(projectDir, initialize=False, remote=False)

Public method to update submodules.

projectDir (str)
name of the project directory
initialize (bool)
flag indicating an initialize and update operation
remote (bool)
flag indicating a fetch and update operation

Git.gitSubmoduleUpdateWithOptions

gitSubmoduleUpdateWithOptions(projectDir)

Public method to update submodules offering a dialog to select the update options.

projectDir (str)
name of the project directory

Git.gitUnstage

gitUnstage(name)

Public method used to unstage a file/directory.

name (str)
file/directory name to be reverted
Return:
flag indicating, that the update contained an add or delete
Return Type:
bool

Git.gitVerify

gitVerify(projectDir)

Public method to verify the connectivity and validity of objects of the database.

projectDir (str)
name of the project directory

Git.gitVerifyBundle

gitVerifyBundle(projectDir)

Public method to verify a bundle file.

projectDir (str)
name of the project directory

Git.gitWorktreeManagement

gitWorktreeManagement(projectDir)

Public method to show the worktree list/management dialog.

projectDir (str)
name of the project directory

Git.initCommand

initCommand(command)

Public method to initialize a command arguments list.

command (str)
command name
Return:
list of command options
Return Type:
list of str

Git.vcsAdd

vcsAdd(name, isDir=False, noDialog=False)

Public method used to add a file/directory to the Git repository.

name (str)
file/directory name to be added
isDir (bool)
flag indicating name is a directory
noDialog (bool)
flag indicating quiet operations

Git.vcsAddBinary

vcsAddBinary(name, isDir=False)

Public method used to add a file/directory in binary mode to the Git repository.

name (str)
file/directory name to be added
isDir (bool)
flag indicating name is a directory

Git.vcsAddCommitMessage

vcsAddCommitMessage(message)

Public method to add a commit message to the list of saved messages.

message (str)
message to be added

Git.vcsAddTree

vcsAddTree(path)

Public method to add a directory tree rooted at path to the Git repository.

path (str or list of str)
root directory of the tree to be added

Git.vcsAllRegisteredStates

vcsAllRegisteredStates(names, dname, shortcut=True)

Public method used to get the registered states of a number of files in the vcs.

Note: If a shortcut is to be taken, the code will only check, if the named directory has been scanned already. If so, it is assumed, that the states for all files have been populated by the previous run.

names (dict)
dictionary with all filenames to be checked as keys
dname (str)
directory to check in
shortcut (bool)
flag indicating a shortcut should be taken (unused)
Return:
the received dictionary completed with the VCS state or None in order to signal an error
Return Type:
dict

Git.vcsCheckout

vcsCheckout(vcsDataDict, projectDir, noDialog=False)

Public method used to check the project out of a Git repository (clone).

vcsDataDict (dict)
dictionary of data required for the checkout
projectDir (str)
project directory to create
noDialog (bool)
flag indicating quiet operations
Return:
flag indicating an execution without errors
Return Type:
bool

Git.vcsCleanup

vcsCleanup(name)

Public method used to cleanup the working directory.

name (str)
directory name to be cleaned up

Git.vcsClearCommitMessages

vcsClearCommitMessages()

Public method to clear the list of saved messages.

Git.vcsCommandLine

vcsCommandLine(name)

Public method used to execute arbitrary Git commands.

name (str)
directory name of the working directory

Git.vcsCommit

vcsCommit(name, message="", noDialog=False, commitAll=True, amend=False)

Public method used to make the change of a file/directory permanent in the Git repository.

name (str or list of str)
file/directory name to be committed
message (str)
message for this operation
noDialog (bool)
flag indicating quiet operations
commitAll (bool)
flag indicating to commit all local changes
amend (bool)
flag indicating to amend the HEAD commit

Git.vcsCommitMessages

vcsCommitMessages()

Public method to get the list of saved commit messages.

Return:
list of saved commit messages
Return Type:
list of str

Git.vcsConvertProject

vcsConvertProject(vcsDataDict, project, addAll=True)

Public method to convert an uncontrolled project to a version controlled project.

vcsDataDict (dict)
dictionary of data required for the conversion
project (Project)
reference to the project object
addAll (bool)
flag indicating to add all files to the repository

Git.vcsDiff

vcsDiff(name)

Public method used to view the difference of a file/directory to the Git repository.

If name is a directory and is the project directory, all project files are saved first. If name is a file (or list of files), which is/are being edited and has unsaved modification, they can be saved or the operation may be aborted.

name (str)
file/directory name to be diffed

Git.vcsExists

vcsExists()

Public method used to test for the presence of the git executable.

Return:
flag indicating the existance and an error message
Return Type:
tuple of (bool, str)

Git.vcsExport

vcsExport(vcsDataDict, projectDir)

Public method used to export a directory from the Git repository.

vcsDataDict (dict)
dictionary of data required for the checkout
projectDir (str)
project directory to create
Return:
flag indicating an execution without errors
Return Type:
bool

Git.vcsForget

vcsForget(name)

Public method used to remove a file from the Mercurial repository.

This will not remove the file from the project directory.

name (str or list of str)
file/directory name to be removed

Git.vcsGetProjectBrowserHelper

vcsGetProjectBrowserHelper(browser, project, isTranslationsBrowser=False)

Public method to instantiate a helper object for the different project browsers.

browser (ProjectBaseBrowser)
reference to the project browser object
project (Project)
reference to the project object
isTranslationsBrowser (bool)
flag indicating, the helper is requested for the translations browser (this needs some special treatment)
Return:
the project browser helper object
Return Type:
GitProjectBrowserHelper

Git.vcsGetProjectHelper

vcsGetProjectHelper(project)

Public method to instantiate a helper object for the project.

project (Project)
reference to the project object
Return:
the project helper object
Return Type:
GitProjectHelper

Git.vcsImport

vcsImport(vcsDataDict, projectDir, noDialog=False, addAll=True)

Public method used to import the project into the Git repository.

vcsDataDict (dict)
dictionary of data required for the import
projectDir (str)
project directory
noDialog (bool)
flag indicating quiet operations (unused)
addAll (bool)
flag indicating to add all files to the repository
Return:
tuple containing a flag indicating an execution without errors and a flag indicating the version controll status
Return Type:
tuple of (bool, bool)

Git.vcsInit

vcsInit(_vcsDir, noDialog=False)

Public method used to initialize the Git repository.

The initialization is done, when a project is converted into a Git controlled project. Therefore we always return TRUE without doing anything.

_vcsDir (str)
name of the VCS directory (unused)
noDialog (bool)
flag indicating quiet operations (unused)
Return:
always True
Return Type:
bool

Git.vcsInitConfig

vcsInitConfig(project)

Public method to initialize the VCS configuration.

This method ensures, that an ignore file exists.

project (Project)
reference to the project

Git.vcsLogBrowser

vcsLogBrowser(name, isFile=False)

Public method used to browse the log of a file/directory from the Git repository.

name (str)
file/directory name to show the log of
isFile (bool)
flag indicating log for a file is to be shown

Git.vcsMerge

vcsMerge(name)

Public method used to merge a URL/revision into the local project.

name (str)
file/directory name to be merged

Git.vcsMove

vcsMove(name, project, target=None, noDialog=False)

Public method used to move a file/directory.

name (str)
file/directory name to be moved
project (Project)
reference to the project object
target (str)
new name of the file/directory
noDialog (bool)
flag indicating quiet operations
Return:
flag indicating successful operation
Return Type:
bool

Git.vcsName

vcsName()

Public method returning the name of the vcs.

Return:
always 'Git'
Return Type:
str

Git.vcsNewProjectOptionsDialog

vcsNewProjectOptionsDialog(parent=None)

Public method to get a dialog to enter repository info for getting a new project.

parent (QWidget)
parent widget
Return:
reference to the instantiated options dialog
Return Type:
GitNewProjectOptionsDialog

Git.vcsOptionsDialog

vcsOptionsDialog(project, _archive, editable=False, parent=None)

Public method to get a dialog to enter repository info.

project (Project)
reference to the project object
_archive (str)
name of the project in the repository (unused)
editable (bool)
flag indicating that the project name is editable (unused)
parent (QWidget)
parent widget
Return:
reference to the instantiated options dialog
Return Type:
GitOptionsDialog

Git.vcsRegisteredState

vcsRegisteredState(name)

Public method used to get the registered state of a file in the vcs.

name (str)
filename to check
Return:
registered state
Return Type:
VersionControlState

Git.vcsRemove

vcsRemove(name, project=False, noDialog=False, stageOnly=False)

Public method used to remove a file/directory from the Git repository.

The default operation is to remove the local copy as well.

name (str or list of str)
file/directory name to be removed
project (bool)
flag indicating deletion of a project tree (unused)
noDialog (bool)
flag indicating quiet operations
stageOnly (bool)
flag indicating to just remove the file from the staging area
Return:
flag indicating successful operation
Return Type:
bool

Git.vcsRepositoryInfos

vcsRepositoryInfos(ppath)

Public method to retrieve information about the repository.

ppath (str)
local path to get the repository infos
Return:
string with ready formated info for display
Return Type:
str

Git.vcsRevert

vcsRevert(name)

Public method used to revert changes made to a file/directory.

name (str)
file/directory name to be reverted
Return:
flag indicating, that the update contained an add or delete
Return Type:
bool

Git.vcsSbsDiff

vcsSbsDiff(name, extended=False, revisions=None)

Public method used to view the difference of a file to the Git repository side-by-side.

name (str)
file name to be diffed
extended (bool)
flag indicating the extended variant
revisions (tuple of (str, str))
tuple of two revisions
Raises ValueError:
raised to indicate an invalid name parameter

Git.vcsShutdown

vcsShutdown()

Public method used to shutdown the Git interface.

Git.vcsStatus

vcsStatus(name)

Public method used to view the status of files/directories in the Git repository.

name (str or list of str)
file/directory name(s) to show the status of

Git.vcsSupportCommandOptions

vcsSupportCommandOptions()

Public method to signal the support of user settable command options.

Return:
flag indicating the support of user settable command options
Return Type:
bool

Git.vcsSwitch

vcsSwitch(name)

Public method used to switch a working directory to a different revision.

name (str)
directory name to be switched
Return:
flag indicating, that the switch contained an add or delete
Return Type:
bool

Git.vcsTag

vcsTag(name, revision=None, tagName=None)

Public method used to set/remove a tag in the Git repository.

name (str)
file/directory name to determine the repo root from
revision (str)
revision to set tag for
tagName (str)
name of the tag
Return:
flag indicating a performed tag action
Return Type:
bool

Git.vcsUpdate

vcsUpdate(name, noDialog=False, revision=None)

Public method used to update a file/directory with the Git repository.

name (str or list of str)
file/directory name to be updated
noDialog (bool)
flag indicating quiet operations
revision (str)
revision to update to
Return:
flag indicating, that the update contained an add or delete
Return Type:
bool
Up