pyrevit.coreutils.git

Description: LibGit2Sharp wrapper module for pyRevit.

Documentation: https://github.com/libgit2/libgit2sharp/wiki

exception pyrevit.coreutils.git.PyRevitGitAuthenticationError

Bases: pyrevit.PyRevitException

Git authentication error.

class pyrevit.coreutils.git.RepoInfo(repo)

Bases: object

Repo wrapper for passing around repository information.

directory

repo directory

Type:str
name

repo name

Type:str
head_name

head branch name

Type:str
last_commit_hash

hash of head commit

Type:str
repo

LibGit2Sharp.Repository object

Type:str
branch

current branch name

Type:str
username

credentials - username

Type:str
password

credentials - password

Type:str
pyrevit.coreutils.git.compare_branch_heads(repo_info)

Compare local and remote branch heads and return ???

Parameters:repo_info (RepoInfo) – target repo object
Returns:desc
Return type:type
pyrevit.coreutils.git.get_all_new_commits(repo_info)

Fetch and return new commits ahead of current head.

Parameters:repo_info (RepoInfo) – target repo object
Returns:str]: ordered dict of commit hash:message
Return type:OrderedDict[str
pyrevit.coreutils.git.get_repo(repo_dir)

Return repo object for given git repo directory.

Parameters:repo_dir (str) – full path of git repo directory
Returns:repo object
Return type:RepoInfo
pyrevit.coreutils.git.git_clone(repo_url, clone_dir, username=None, password=None)

Clone git repository to given location

Parameters:
  • repo_url (str) – repo .git url
  • clone_dir (str) – destination path
  • username (str) – credentials - username
  • password (str) – credentials - password
pyrevit.coreutils.git.git_fetch(repo_info)

Fetch current branch of given repo.

Parameters:repo_info (RepoInfo) – target repo object
Returns:repo object with updated head
Return type:RepoInfo
pyrevit.coreutils.git.git_pull(repo_info)

Pull the current head of given repo.

Parameters:repo_info (RepoInfo) – target repo object
Returns:repo object with updated head
Return type:RepoInfo