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: object

Clone - 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 (if diff=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 Clone for project in workspace.

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.filter_clone_on_branch(clone: Clone) bool[source]

Return True on branches.

gitws.clone.map_paths(clones: Tuple[Clone, ...], paths: Optional[Tuple[Path, ...]]) Iterator[Tuple[Clone, Tuple[Path, ...]]][source]

Map paths to clones.

Associate the given paths to the corresponding clones.

  • If paths is not empty, the corresponding clone and paths pairs are yielded.

  • If paths is empty, just all clones with an empty paths tuple are yielded.