PyFoam.Basics.GeneralVCSInterface module

General interface to VCS implementations

class PyFoam.Basics.GeneralVCSInterface.GeneralVCSInterface(path, init=False)[source]

Bases: object

This is an abstract class that implements an interface to general VCS operations

__dict__ = mappingproxy({'__module__': 'PyFoam.Basics.GeneralVCSInterface', '__doc__': 'This is an abstract class that implements an interface to general VCS operations', '__init__': <function GeneralVCSInterface.__init__>, 'getRoot': <function GeneralVCSInterface.getRoot>, 'executeWithOuput': <function GeneralVCSInterface.executeWithOuput>, 'doInPath': <function GeneralVCSInterface.doInPath>, 'getRevision': <function GeneralVCSInterface.getRevision>, 'commit': <function GeneralVCSInterface.commit>, 'update': <function GeneralVCSInterface.update>, 'branchName': <function GeneralVCSInterface.branchName>, 'addPath': <function GeneralVCSInterface.addPath>, 'clone': <function GeneralVCSInterface.clone>, 'addRegexpToIgnore': <function GeneralVCSInterface.addRegexpToIgnore>, 'addGlobToIgnore': <function GeneralVCSInterface.addGlobToIgnore>, 'addStandardIgnores': <function GeneralVCSInterface.addStandardIgnores>, '__dict__': <attribute '__dict__' of 'GeneralVCSInterface' objects>, '__weakref__': <attribute '__weakref__' of 'GeneralVCSInterface' objects>})
__init__(path, init=False)[source]
Parameters
  • path – path which is supposed to be under version control

  • init – initialize the version control system here

__module__ = 'PyFoam.Basics.GeneralVCSInterface'
__weakref__

list of weak references to the object (if defined)

addGlobToIgnore(expr)[source]

Add to the ignore-facility of the current VCS :param expr: a glob expression

addPath(path, rules=[])[source]

Add the path to the repository (no commit) :param path: the path (directory or file) to commit :param rules: a list of tuples: first is whether to include or exclude the regular expression that is the second member of the tuple

addRegexpToIgnore(expr)[source]

Add to the ignore-facility of the current VCS :param expr: a regular expression

addStandardIgnores()[source]

Add the usual ignores

branchName()[source]

Return the branch-name (or another identifying string)

clone(dest)[source]

Clone the repository :param dest: the path that should be clones to

commit(msg)[source]

Commit the current state :param msg: Commit message

doInPath(func, *args, **kwargs)[source]

Execute a function in the root directory of the repository. Afterwards change back ot the original directory. Result of the function is returned

Parameters

func – the function to be executed

executeWithOuput(cmd)[source]

Executes a command and returns the output

getRevision()[source]

Get the current revision number

getRoot(path)[source]

Returns the actual repository root for a path. Default implmentation passes through the path

update(timeout=None)[source]

Update the working copy from the parent repository :param timeout: Wait a maximum time (if the VCS supports this)

PyFoam.Basics.GeneralVCSInterface.getVCS(vcs, path, init=False, tolerant=False)[source]

Factory to create a proper VCS-interface :param vcs: name of the VCS-implementation :param path: path which is under version control :param init: whether the Version-control should be initialized here :param tolerant: If there is no interface for the VCS in question return None

PyFoam.Basics.GeneralVCSInterface.whichVCS(dpath)[source]

Diagnose which VCS a specific directory is under

Returns a string that is consistent with the creation table in getVCS