Repository#
- class neophile.repository.Repository(path)#
Bases:
object
Wrapper around a Git repository to add some convenience functions.
- Parameters:
path (
Path
) – Root path of the Git repository.
Methods Summary
clone_or_update
(path, url)Clone a repository or update an existing repository.
Switch back to the branch before switch_branch was called.
Switch to the neophile working branch.
update
()Update an existing checkout to its current upstream.
Methods Documentation
- classmethod clone_or_update(path, url)#
Clone a repository or update an existing repository.
- Parameters:
- Returns:
Newly-created repository object.
- Return type:
- restore_branch()#
Switch back to the branch before switch_branch was called.
Also deletes the neophile branch to clean up.
- Return type:
- switch_branch()#
Switch to the neophile working branch.
- Return type:
Notes
Currently this unconditionally creates the branch and fails if it already exists. Eventually this will be smarter about updating the neophile branch as appropriate.