anod.checkout

Module Contents

Classes

CheckoutManager

Helper class to manage checkouts done by Anod tools.

Attributes

logger

anod.checkout.logger
class anod.checkout.CheckoutManager(name: str, working_dir: str, compute_changelog: bool = True)

Helper class to manage checkouts done by Anod tools.

When a checkout manager is used in working_dir directory for a repository called name. The following structure will be found on disk after an update

working_dir/name/ The repository checkout
/name_checkout.json A json containing some metadata: name,

url, old_commit, new_commit, revision

/name_changelog.json A json containing the list of commit

between two call to update. If this is the inital checkout or there are no changes then the file will not be created

update(vcs: Literal[git] | Literal[svn] | Literal[external], url: str, revision: str | None = None) e3.anod.status.ReturnValue

Update content of the working directory.

Parameters:
  • vcs – vcs kind

  • url – repository url, when vcs is external the url is the path to the source directory

  • revision – revision

Note that when vcs is set to git or svn, the version control ignore setting is taken into account. Additionally, when the vcs is external and the source directory contains a .git subdirectory then git ignore setting is taken into account.

update_external(url: str, revision: str | None) tuple[e3.anod.status.ReturnValue, str, str]

Update working dir using a local directory.

Parameters:
  • url – path to the repository

  • revision – ignored

If <url>/.git is a directory then git ls-files will be called to get the list of files to ignore.

static git_remote_name(url: str) str

Return the remote name computed for an url.

Parameters:

url – the git url

Returns:

the remote name

update_git(url: str, revision: str | None) tuple[e3.anod.status.ReturnValue, str | None, str | None]

Update working dir using a Git repository.

Parameters:
  • url – git repository url

  • revision – git revision

update_svn(url: str, revision: str | None) tuple[e3.anod.status.ReturnValue, str | None, str | None]

Update working dir using a SVN repository.

Parameters:
  • url – git repository url

  • revision – git revision