libvcs.sync.base

Foundation for the sync classes. Add your own VCS — or extend libvcs — by subclassing BaseSync.

Foundational tools to set up a VCS manager in libvcs.sync.

class libvcs.sync.base.WorkingCopyPosition
class libvcs.sync.base.WorkingCopyPosition

Bases: object

Describe a checkout using the backend’s local metadata.

class libvcs.sync.base.SyncTarget
class libvcs.sync.base.SyncTarget

Bases: object

Select one backend ref; omission from a sync call follows the current ref.

class libvcs.sync.base.SyncPolicy
class libvcs.sync.base.SyncPolicy

Bases: object

Control configured-target drift and local changes independently.

class libvcs.sync.base.RecoveryToken
class libvcs.sync.base.RecoveryToken

Bases: object

Identify retained private recovery material until explicit release.

class libvcs.sync.base.SyncConflict
class libvcs.sync.base.SyncConflict

Bases: object

Identify a conflicting relative path and its stable backend reason.

class libvcs.sync.base.SyncError
class libvcs.sync.base.SyncError

Bases: object

An error encountered during a sync step.

Examples

>>> error = SyncError(step="fetch", message="remote not found")
>>> error.step
'fetch'
>>> error.message
'remote not found'
>>> error.exception is None
True
class libvcs.sync.base.SyncResult
class libvcs.sync.base.SyncResult

Bases: object

Result of a repository synchronization.

Examples

>>> result = SyncResult()
>>> result.ok
True
>>> bool(result)
True
>>> result = SyncResult()
>>> result.add_error(step="fetch", message="remote not found")
>>> result.ok
False
>>> bool(result)
False
>>> result.errors[0].step
'fetch'
class libvcs.sync.base.VCSLocation
class libvcs.sync.base.VCSLocation

Bases: NamedTuple

Generic VCS Location (URL and optional revision).

libvcs.sync.base.convert_pip_url(pip_url)
function[source]
function[source]
libvcs.sync.base.convert_pip_url(pip_url)

Parse pip URL via libvcs.sync.base.BaseSync.url.

Parameters:

pip_url (str)

Return type:

VCSLocation

class libvcs.sync.base.BaseSync
class libvcs.sync.base.BaseSync

Bases: object

Base class for repositories.