class documentation

class GITApplicationBackend(VCSApplicationBase): (source)

View In Hierarchy

Undocumented

Class Method build_bin_application_instance Builds an Application object for the backend command @returns: an Application object @implementation: must be implemented in child classes.
Method add Runs: git add {{PATH}}
Method annotate No summary
Method build_revision_arguments No summary
Method cat Runs: git cat {{PATH}} {{REV_ARGS}}
Method commit Runs: git commit -m {{MSG}} {{PATH}}
Method diff No summary
Method ignore Build a .gitignore file including the file_to_ignore_content
Method init Runs: git init
Method init_repo No summary
Method is_modified Returns true if the repo is not up-to-date, or False @returns: True if the repo is not up-to-date, or False
Method log No summary
Method log_to_revision_list No summary
Method move Must implement the VCS operation required after a file has been moved into the repository.
Method path_arg Undocumented
Method remove No summary
Method repo_exists Returns True if a repository is already setup @returns: True if a repository is already setup in the root directory @implementation: must be implemented in child classes.
Method revert No summary
Method stage Prepares the repo for a commit. Used, for example, by git to stage changes so that the status message in SaveVersionDialog shows what will be committed.
Method status Runs: git status @param porcelain: see --porcelain in git documentation, used for testing

Inherited from VCSApplicationBase:

Class Method tryexec Check if the command associated with the backend is available. @returns: True if the command is available
Method __init__ No summary
Method commit_version Run a commit operation.
Method list_versions Returns a list of all versions, for a file or for the entire repo
Method on_created Callback when a file has been created @param fs: the watcher object @param path: a File or Folder object
Method on_moved No summary
Method on_removed Callback when a file has been delted @param fs: the watcher object @param path: a File or Folder object
Method pipe No summary
Method run Execute a command with the associated binary with 'params' parameters. Note: the working directory is the root associated to the repository
Instance Variable notebook_dir Undocumented
Instance Variable root Undocumented
Method _ignored No summary
Instance Variable _app Undocumented

Inherited from ConnectorMixin (via VCSApplicationBase):

Method connectto Connect to signals of another object E.g.:
Method connectto_all Convenience method to combine multiple calls to connectto().
Method disconnect_all Disconnect all signals that have been connected with connectto and friends. Typically called when you want to destroy this object.
Method disconnect_from Disc all signals that have been connected with connectto and friends to a specific object.
Method _disconnect_from Undocumented
Instance Variable _connected_signals Undocumented
@classmethod
def build_bin_application_instance(cls): (source)
Builds an Application object for the backend command
Returns
an Application object
Unknown Field: implementation
must be implemented in child classes.
def add(self, path=None): (source)
Runs: git add {{PATH}}
def annotate(self, file, version=None): (source)
FIXME Document return 0: line1 2: line1 ...
def build_revision_arguments(self, versions, is_for_diff=False): (source)

Build a list including required string/int for running an VCS command # Accepts: None, int, string, (int,), (int, int) # Always returns a list # versions content:

  • None: return an empty list
  • int ou string: return ['-r', int]
  • tuple or list: return ['-r', '%i..%i']

It's all based on the fact that defining revision with current VCS is: -r revision -r rev1..rev2

def cat(self, path, version): (source)
Runs: git cat {{PATH}} {{REV_ARGS}}
def commit(self, path, msg): (source)
Runs: git commit -m {{MSG}} {{PATH}}
def ignore(self, file_to_ignore_regexp): (source)
Build a .gitignore file including the file_to_ignore_content
def init_repo(self): (source)
initialize a repository in the associated folder. Runs init(), adds existing files etc.
Returns
nothing.
Unknown Field: implementation
must be implemented in the child class.
def is_modified(self): (source)
Returns true if the repo is not up-to-date, or False
Returns
True if the repo is not up-to-date, or False
def log_to_revision_list(self, log_op_output): (source)
Converts the result of a log() call into a list of tuples representing the commits.
Parameters
log_op_outputa list of str() representing the log operation output before being parsed.
Returns
a list of tuple (revision-id, date, user, commit-message) representing the entire life.
Unknown Field: implementation
must be implemented in the child class. Actually, this method is a "log" operation parser which will convert str lines into list of 4-str tuples : (revision-id, date, user, commit-message)
def move(self, oldpath, newpath): (source)
def path_arg(self, path): (source)

Undocumented

def remove(self, path): (source)
Remove a file from the repository.
Parameters
pathUndocumented
filea File instance representing the file that have been deleted
Returns
True if the command was successfull
Unknown Field: implementation
must be implemented in child class. CAUTION: this must implement the VCS operation required after a versionned file has been deleted from the file system. Example: in mercurial it has been implemented with: hg rm <file>
def repo_exists(self): (source)
Returns True if a repository is already setup
Returns
True if a repository is already setup in the root directory
Unknown Field: implementation
must be implemented in child classes.
def stage(self): (source)
Prepares the repo for a commit. Used, for example, by git to stage changes so that the status message in SaveVersionDialog shows what will be committed.
Unknown Field: implementation
optional to be implemented in child class
def status(self, porcelain=False): (source)
Runs: git status
Parameters
porcelainsee --porcelain in git documentation, used for testing