gitws.clone module
A Clone.
A Clone is just the assembly of a Project and its corresponding git interface (Git).
- class gitws.clone.Clone(project: Project, git: Git)[source]
Bases:
objectClone - A Pair Of Project Definition And Git Interface.
- Parameters:
project – Project Definition.
git – Git Interface.
- check(exists=True, diff=True)[source]
Check Clone And Emit Warnings On Logger.
The following checks are processed:
Check that the git clone exists (if
exists=True).Check that the current git clone revision matches the
project.revision(ifdiff=True).The revision check is skipped on the main project.
- Keyword Arguments:
exists – Check if cloned.
diff – Check if revisions differ
- static from_project(workspace: Workspace, project: Project, secho=None) Clone[source]
Create
Cloneforprojectinworkspace.
- property info
repr-like info string but more condensed.
>>> import gitws >>> project = gitws.Project(name='pname', level=0, path='ppath', revision='prevision') >>> git = gitws.Git('gpath') >>> clone = gitws.Clone(project, git) >>> clone.info "gpath ('pname', revision='prevision')"
- gitws.clone.map_paths(clones: Tuple[Clone, ...], paths: Optional[Tuple[Path, ...]]) Generator[Tuple[Clone, Tuple[Path, ...]], None, None][source]
Map
pathstoclones.Associate the given
pathsto the correspondingclones.If
pathsis not empty, the corresponding clone and paths pairs are yielded.If
pathsis empty, just all clones with an empty paths tuple are yielded.