qisrc.sync – Synchronize a worktree with a manifest

Handling synchronization of a worktree with some manifests

qisrc.sync.WorkTreeSyncer

class qisrc.sync.WorkTreeSyncer(git_worktree)

Handle the manifests of a worktree

Stores the git url of the manifests and the groups that should be used, synchronizes the local manifests with the git worktree

sync()

” Synchronize with a remote manifest: * clone missing repos * move repos that needs to be moved * reconfigure remotes and default branches * synchronizes build profiles :returns: True in case of success, False otherwise

sync_repos()

Update every manifest, inspect changes, and updates the git worktree accordingly

configure_projects(projects=None)

Configure the given projects so that the actual git config matches the one coming from the manifest :

Configure default remotes, default branches and code review, then save config To be called _after_ sync()

dump_manifests()

Save the manifests in .qi/manifests.xml

configure_manifest(name, url, groups=None, branch='master', ref=None)

Add a manifest to the list. Will be stored in .qi/manifests/<name>

remove_manifest(name)

Remove a manifest from the list

read_remote_manifest(local_manifest, manifest_xml=None)

Read the manifest file in .qi/manifests/<name>/manifest.xml using the settings in .qi/manifest.xml (to know the name and the groups to use)

get_old_repos()

Backup all repos configuration before any synchronisation for compute_repo_diff to have the correct value

get_new_repos()

Read all the repos coming from all the manifests

sync_from_manifest_file(name, xml_path)

Just synchronize the manifest coming from one xml file. Used by qisrc manifest --check

clone_manifest(manifest)

Clone a new manifest in .qi/manifests/<name>

qisrc.sync.LocalManifest

class qisrc.sync.LocalManifest
name

name of the manifest

url

url of the manifest

branch

branch of the manifest

groups

a list of group names to use by default (default is: all projects)