# eric4.Plugins.VcsPlugins.vcsPySvn.subversion

Module implementing the version control systems interface to Subversion.

### Global Attributes

None

### Classes

Subversion | Class implementing the version control systems interface to Subversion.

### Functions

None

## Subversion

Class implementing the version control systems interface to Subversion.

### Signals

committed()
  emitted after the commit action has completed

### Derived from

VersionControl

### Class Attributes

None

### Class Methods

None

### Methods

Subversion | Constructor
__isVersioned | Private method to check, if the given status indicates a versioned state.
__svnURL | Private method to format a url for subversion.
__vcsAllRegisteredStates_wc | Private method used to get the registered states of a number of files in the vcs.
__vcsAllRegisteredStates_wcng | Private method used to get the registered states of a number of files in the vcs.
__vcsCommit_Step2 | Private slot performing the second step of the commit action.
__vcsRegisteredState_wc | Private method used to get the registered state of a file in the vcs.
__vcsRegisteredState_wcng | Private method used to get the registered state of a file in the vcs.
_createStatusMonitorThread | Protected method to create an instance of the VCS status monitor thread.
clearStatusCache | Public method to clear the status cache.
getClient | Public method to create and initialize the pysvn client object.
getPlugin | Public method to get a reference to the plugin object.
svnAddToChangelist | Public method to add a file or directory to a changelist.
svnBlame | Public method to show the output of the svn blame command.
svnCopy | Public method used to copy a file/directory.
svnDelProp | Public method used to delete a property of a file/directory.
svnExtendedDiff | Public method used to view the difference of a file/directory to the Subversion repository.
svnGetChangelists | Public method to get a list of all defined change lists.
svnGetReposName | Public method used to retrieve the URL of the subversion repository path.
svnInfo | Public method to show repository information about a file or directory.
svnListProps | Public method used to list the properties of a file/directory.
svnListTagBranch | Public method used to list the available tags or branches.
svnLock | Public method used to lock a file in the Subversion repository.
svnLogBrowser | Public method used to browse the log of a file/directory from the Subversion repository.
svnLogLimited | Public method used to view the (limited) log of a file/directory from the Subversion repository.
svnNormalizeURL | Public method to normalize a url for subversion.
svnRelocate | Public method to relocate the working copy to a new repository URL.
svnRemoveFromChangelist | Public method to remove a file or directory from its changelist.
svnRepoBrowser | Public method to open the repository browser.
svnResolve | Public method used to resolve conflicts of a file/directory.
svnSetProp | Public method used to add a property to a file/directory.
svnShowChangelists | Public method used to inspect the change lists defined for the project.
svnUnlock | Public method used to unlock a file in the Subversion repository.
svnUrlDiff | Public method used to view the difference of a file/directory of two repository URLs.
vcsAdd | Public method used to add a file/directory to the Subversion repository.
vcsAddBinary | Public method used to add a file/directory in binary mode to the Subversion repository.
vcsAddTree | Public method to add a directory tree rooted at path to the Subversion repository.
vcsAllRegisteredStates | Public method used to get the registered states of a number of files in the vcs.
vcsCheckout | Public method used to check the project out of the Subversion repository.
vcsCleanup | Public method used to cleanup the working copy.
vcsCommandLine | Public method used to execute arbitrary subversion commands.
vcsCommit | Public method used to make the change of a file/directory permanent in the Subversion repository.
vcsConvertProject | Public method to convert an uncontrolled project to a version controlled project.
vcsDiff | Public method used to view the difference of a file/directory to the Subversion repository.
vcsExists | Public method used to test for the presence of the svn executable.
vcsExport | Public method used to export a directory from the Subversion repository.
vcsGetProjectBrowserHelper | Public method to instanciate a helper object for the different project browsers.
vcsGetProjectHelper | Public method to instanciate a helper object for the project.
vcsImport | Public method used to import the project into the Subversion repository.
vcsInit | Public method used to initialize the subversion repository.
vcsInitConfig | Public method to initialize the VCS configuration.
vcsLog | Public method used to view the log of a file/directory from the Subversion repository.
vcsMerge | Public method used to merge a URL/revision into the local project.
vcsMove | Public method used to move a file/directory.
vcsName | Public method returning the name of the vcs.
vcsNewProjectOptionsDialog | Public method to get a dialog to enter repository info for getting a new project.
vcsOptionsDialog | Public method to get a dialog to enter repository info.
vcsRegisteredState | Public method used to get the registered state of a file in the vcs.
vcsRemove | Public method used to remove a file/directory from the Subversion repository.
vcsRepositoryInfos | Public method to retrieve information about the repository.
vcsRevert | Public method used to revert changes made to a file/directory.
vcsShutdown | Public method used to shutdown the Subversion interface.
vcsStatus | Public method used to view the status of files/directories in the Subversion repository.
vcsSwitch | Public method used to switch a directory to a different tag/branch.
vcsTag | Public method used to set the tag of a file/directory in the Subversion repository.
vcsUpdate | Public method used to update a file/directory with the Subversion repository.

### Static Methods

None

#### Subversion (Constructor)

Subversion(plugin, parent = None, name = None)

Constructor

plugin
  reference to the plugin object
parent
  parent widget (QWidget)
name
  name of this object (string or QString)

#### Subversion.__isVersioned

__isVersioned(status)

Private method to check, if the given status indicates a versioned state.

status
  status object to check (pysvn.PysvnStatus)

Returns:
  flag indicating a versioned state (boolean)

#### Subversion.__svnURL

__svnURL(url)

Private method to format a url for subversion.

url
  unformatted url string (string)

Returns:
  properly formated url for subversion

#### Subversion.__vcsAllRegisteredStates_wc

__vcsAllRegisteredStates_wc(names, dname, shortcut = True)

Private method used to get the registered states of a number of files in the vcs.

This is the variant for subversion installations using the old working copy meta-data format.

Note: If a shortcut is to be taken, the code will only check, if the named directory has been scanned already. If so, it is assumed, that the states for all files has been populated by the previous run.

names
  dictionary with all filenames to be checked as keys
dname
  directory to check in (string)
shortcut
  flag indicating a shortcut should be taken (boolean)

Returns:
  the received dictionary completed with a combination of canBeCommited and canBeAdded or None in order to signal an error

#### Subversion.__vcsAllRegisteredStates_wcng

__vcsAllRegisteredStates_wcng(names, dname, shortcut = True)

Private method used to get the registered states of a number of files in the vcs.

This is the variant for subversion installations using the new working copy meta-data format.

Note: If a shortcut is to be taken, the code will only check, if the named directory has been scanned already. If so, it is assumed, that the states for all files has been populated by the previous run.

names
  dictionary with all filenames to be checked as keys
dname
  directory to check in (string)
shortcut
  flag indicating a shortcut should be taken (boolean)

Returns:
  the received dictionary completed with a combination of canBeCommited and canBeAdded or None in order to signal an error

#### Subversion.__vcsCommit_Step2

__vcsCommit_Step2()

Private slot performing the second step of the commit action.

#### Subversion.__vcsRegisteredState_wc

__vcsRegisteredState_wc(name)

Private method used to get the registered state of a file in the vcs.

This is the variant for subversion installations using the old working copy meta-data format.

name
  filename to check (string or QString)

Returns:
  a combination of canBeCommited and canBeAdded

#### Subversion.__vcsRegisteredState_wcng

__vcsRegisteredState_wcng(name)

Private method used to get the registered state of a file in the vcs.

This is the variant for subversion installations using the new working copy meta-data format.

name
  filename to check (string or QString)

Returns:
  a combination of canBeCommited and canBeAdded

#### Subversion._createStatusMonitorThread

_createStatusMonitorThread(interval, project)

Protected method to create an instance of the VCS status monitor thread.

project
  reference to the project object
interval
  check interval for the monitor thread in seconds (integer)

Returns:
  reference to the monitor thread (QThread)

#### Subversion.clearStatusCache

clearStatusCache()

Public method to clear the status cache.

#### Subversion.getClient

getClient()

Public method to create and initialize the pysvn client object.

Returns:
  the pysvn client object (pysvn.Client)

#### Subversion.getPlugin

getPlugin()

Public method to get a reference to the plugin object.

Returns:
  reference to the plugin object (VcsPySvnPlugin)

#### Subversion.svnAddToChangelist

svnAddToChangelist(names)

Public method to add a file or directory to a changelist.

Note: Directories will be added recursively.

names
  name or list of names of file or directory to add (string or QString)

#### Subversion.svnBlame

svnBlame(name)

Public method to show the output of the svn blame command.

name
  file name to show the blame for (string)

#### Subversion.svnCopy

svnCopy(name, project)

Public method used to copy a file/directory.

name
  file/directory name to be copied (string)
project
  reference to the project object

Returns:
  flag indicating successfull operation (boolean)

#### Subversion.svnDelProp

svnDelProp(name, recursive = False)

Public method used to delete a property of a file/directory.

name
  file/directory name (string or list of strings)
recursive
  flag indicating a recursive list is requested

#### Subversion.svnExtendedDiff

svnExtendedDiff(name)

Public method used to view the difference of a file/directory to the Subversion repository.

If name is a directory and is the project directory, all project files are saved first. If name is a file (or list of files), which is/are being edited and has unsaved modification, they can be saved or the operation may be aborted.

This method gives the chance to enter the revisions to be compared.

name
  file/directory name to be diffed (string)

#### Subversion.svnGetChangelists

svnGetChangelists()

Public method to get a list of all defined change lists.

Returns:
  list of defined change list names (list of strings)

#### Subversion.svnGetReposName

svnGetReposName(path)

Public method used to retrieve the URL of the subversion repository path.

path
  local path to get the svn repository path for (string)

Returns:
  string with the repository path URL

#### Subversion.svnInfo

svnInfo(projectPath, name)

Public method to show repository information about a file or directory.

projectPath
  path name of the project (string)
name
  file/directory name relative to the project (string)

#### Subversion.svnListProps

svnListProps(name, recursive = False)

Public method used to list the properties of a file/directory.

name
  file/directory name (string or list of strings)
recursive
  flag indicating a recursive list is requested

#### Subversion.svnListTagBranch

svnListTagBranch(path, tags = True)

Public method used to list the available tags or branches.

path
  directory name of the project (string)
tags
  flag indicating listing of branches or tags (False = branches, True = tags)

#### Subversion.svnLock

svnLock(name, stealIt=False, parent=None)

Public method used to lock a file in the Subversion repository.

name
  file/directory name to be locked (string or list of strings)
stealIt
  flag indicating a forced operation (boolean)
parent
  reference to the parent object of the subversion dialog (QWidget)

#### Subversion.svnLogBrowser

svnLogBrowser(path)

Public method used to browse the log of a file/directory from the Subversion repository.

path
  file/directory name to show the log of (string)

#### Subversion.svnLogLimited

svnLogLimited(name)

Public method used to view the (limited) log of a file/directory from the Subversion repository.

name
  file/directory name to show the log of (string)

#### Subversion.svnNormalizeURL

svnNormalizeURL(url)

Public method to normalize a url for subversion.

url
  url string (string)

Returns:
  properly normalized url for subversion

#### Subversion.svnRelocate

svnRelocate(projectPath)

Public method to relocate the working copy to a new repository URL.

projectPath
  path name of the project (string)

#### Subversion.svnRemoveFromChangelist

svnRemoveFromChangelist(names)

Public method to remove a file or directory from its changelist.

Note: Directories will be removed recursively.

names
  name or list of names of file or directory to remove (string or QString)

#### Subversion.svnRepoBrowser

svnRepoBrowser(projectPath = None)

Public method to open the repository browser.

projectPath
  path name of the project (string)

#### Subversion.svnResolve

svnResolve(name)

Public method used to resolve conflicts of a file/directory.

name
  file/directory name to be resolved (string)

#### Subversion.svnSetProp

svnSetProp(name, recursive = False)

Public method used to add a property to a file/directory.

name
  file/directory name (string or list of strings)
recursive
  flag indicating a recursive set is requested

#### Subversion.svnShowChangelists

svnShowChangelists(path)

Public method used to inspect the change lists defined for the project.

path
  directory name to show change lists for (string)

#### Subversion.svnUnlock

svnUnlock(name, breakIt=False, parent=None)

Public method used to unlock a file in the Subversion repository.

name
  file/directory name to be unlocked (string or list of strings)
breakIt
  flag indicating a forced operation (boolean)
parent
  reference to the parent object of the subversion dialog (QWidget)

#### Subversion.svnUrlDiff

svnUrlDiff(name)

Public method used to view the difference of a file/directory of two repository URLs.

If name is a directory and is the project directory, all project files are saved first. If name is a file (or list of files), which is/are being edited and has unsaved modification, they can be saved or the operation may be aborted.

This method gives the chance to enter the revisions to be compared.

name
  file/directory name to be diffed (string)

#### Subversion.vcsAdd

vcsAdd(name, isDir = False, noDialog = False)

Public method used to add a file/directory to the Subversion repository.

name
  file/directory name to be added (string)
isDir
  flag indicating name is a directory (boolean)
noDialog
  flag indicating quiet operations (boolean)

#### Subversion.vcsAddBinary

vcsAddBinary(name, isDir = False)

Public method used to add a file/directory in binary mode to the Subversion repository.

name
  file/directory name to be added (string)
isDir
  flag indicating name is a directory (boolean)

#### Subversion.vcsAddTree

vcsAddTree(path)

Public method to add a directory tree rooted at path to the Subversion repository.

path
  root directory of the tree to be added (string or list of strings))

#### Subversion.vcsAllRegisteredStates

vcsAllRegisteredStates(names, dname, shortcut = True)

Public method used to get the registered states of a number of files in the vcs.

Note: If a shortcut is to be taken, the code will only check, if the named directory has been scanned already. If so, it is assumed, that the states for all files has been populated by the previous run.

names
  dictionary with all filenames to be checked as keys
dname
  directory to check in (string)
shortcut
  flag indicating a shortcut should be taken (boolean)

Returns:
  the received dictionary completed with a combination of canBeCommited and canBeAdded or None in order to signal an error

#### Subversion.vcsCheckout

vcsCheckout(vcsDataDict, projectDir, noDialog = False)

Public method used to check the project out of the Subversion repository.

vcsDataDict
  dictionary of data required for the checkout
projectDir
  project directory to create (string)
noDialog
  flag indicating quiet operations

Returns:
  flag indicating an execution without errors (boolean)

#### Subversion.vcsCleanup

vcsCleanup(name)

Public method used to cleanup the working copy.

name
  directory name to be cleaned up (string)

#### Subversion.vcsCommandLine

vcsCommandLine(name)

Public method used to execute arbitrary subversion commands.

name
  directory name of the working directory (string)

#### Subversion.vcsCommit

vcsCommit(name, message, noDialog = False)

Public method used to make the change of a file/directory permanent in the Subversion repository.

name
  file/directory name to be committed (string or list of strings)
message
  message for this operation (string)
noDialog
  flag indicating quiet operations

#### Subversion.vcsConvertProject

vcsConvertProject(vcsDataDict, project)

Public method to convert an uncontrolled project to a version controlled project.

vcsDataDict
  dictionary of data required for the conversion
project
  reference to the project object

#### Subversion.vcsDiff

vcsDiff(name)

Public method used to view the difference of a file/directory to the Subversion repository.

If name is a directory and is the project directory, all project files are saved first. If name is a file (or list of files), which is/are being edited and has unsaved modification, they can be saved or the operation may be aborted.

name
  file/directory name to be diffed (string)

#### Subversion.vcsExists

vcsExists()

Public method used to test for the presence of the svn executable.

Returns:
  flag indicating the existance (boolean) and an error message (QString)

#### Subversion.vcsExport

vcsExport(vcsDataDict, projectDir)

Public method used to export a directory from the Subversion repository.

vcsDataDict
  dictionary of data required for the checkout
projectDir
  project directory to create (string)

Returns:
  flag indicating an execution without errors (boolean)

#### Subversion.vcsGetProjectBrowserHelper

vcsGetProjectBrowserHelper(browser, project, isTranslationsBrowser = False)

Public method to instanciate a helper object for the different project browsers.

browser
  reference to the project browser object
project
  reference to the project object
isTranslationsBrowser
  flag indicating, the helper is requested for the translations browser (this needs some special treatment)

Returns:
  the project browser helper object

#### Subversion.vcsGetProjectHelper

vcsGetProjectHelper(project)

Public method to instanciate a helper object for the project.

project
  reference to the project object

Returns:
  the project helper object

#### Subversion.vcsImport

vcsImport(vcsDataDict, projectDir, noDialog = False)

Public method used to import the project into the Subversion repository.

vcsDataDict
  dictionary of data required for the import
projectDir
  project directory (string)
noDialog
  flag indicating quiet operations

Returns:
  flag indicating an execution without errors (boolean) and a flag indicating the version controll status (boolean)

#### Subversion.vcsInit

vcsInit(vcsDir, noDialog = False)

Public method used to initialize the subversion repository.

The subversion repository has to be initialized from outside eric4 because the respective command always works locally. Therefore we always return TRUE without doing anything.

vcsDir
  name of the VCS directory (string)
noDialog
  flag indicating quiet operations (boolean)

Returns:
  always TRUE

#### Subversion.vcsInitConfig

vcsInitConfig(project)

Public method to initialize the VCS configuration.

This method ensures, that eric specific files and directories are ignored.

project
  reference to the project (Project)

#### Subversion.vcsLog

vcsLog(name)

Public method used to view the log of a file/directory from the Subversion repository.

name
  file/directory name to show the log of (string)

#### Subversion.vcsMerge

vcsMerge(name)

Public method used to merge a URL/revision into the local project.

name
  file/directory name to be merged (string)

#### Subversion.vcsMove

vcsMove(name, project, target = None, noDialog = False)

Public method used to move a file/directory.

name
  file/directory name to be moved (string)
project
  reference to the project object
target
  new name of the file/directory (string)
noDialog
  flag indicating quiet operations

Returns:
  flag indicating successfull operation (boolean)

#### Subversion.vcsName

vcsName()

Public method returning the name of the vcs.

Returns:
  always 'Subversion' (string)

#### Subversion.vcsNewProjectOptionsDialog

vcsNewProjectOptionsDialog(parent = None)

Public method to get a dialog to enter repository info for getting a new project.

parent
  parent widget (QWidget)

#### Subversion.vcsOptionsDialog

vcsOptionsDialog(project, archive, editable = False, parent = None)

Public method to get a dialog to enter repository info.

project
  reference to the project object
archive
  name of the project in the repository (string)
editable
  flag indicating that the project name is editable (boolean)
parent
  parent widget (QWidget)

#### Subversion.vcsRegisteredState

vcsRegisteredState(name)

Public method used to get the registered state of a file in the vcs.

name
  filename to check (string or QString)

Returns:
  a combination of canBeCommited and canBeAdded

#### Subversion.vcsRemove

vcsRemove(name, project = False, noDialog = False)

Public method used to remove a file/directory from the Subversion repository.

The default operation is to remove the local copy as well.

name
  file/directory name to be removed (string or list of strings))
project
  flag indicating deletion of a project tree (boolean) (not needed)
noDialog
  flag indicating quiet operations

Returns:
  flag indicating successfull operation (boolean)

#### Subversion.vcsRepositoryInfos

vcsRepositoryInfos(ppath)

Public method to retrieve information about the repository.

ppath
  local path to get the repository infos (string)

Returns:
  string with ready formated info for display (QString)

#### Subversion.vcsRevert

vcsRevert(name)

Public method used to revert changes made to a file/directory.

name
  file/directory name to be reverted (string)

#### Subversion.vcsShutdown

vcsShutdown()

Public method used to shutdown the Subversion interface.

#### Subversion.vcsStatus

vcsStatus(name)

Public method used to view the status of files/directories in the Subversion repository.

name
  file/directory name(s) to show the status of (string or list of strings)

#### Subversion.vcsSwitch

vcsSwitch(name)

Public method used to switch a directory to a different tag/branch.

name
  directory name to be switched (string)

#### Subversion.vcsTag

vcsTag(name)

Public method used to set the tag of a file/directory in the Subversion repository.

name
  file/directory name to be tagged (string)

#### Subversion.vcsUpdate

vcsUpdate(name, noDialog = False)

Public method used to update a file/directory with the Subversion repository.

name
  file/directory name to be updated (string or list of strings)
noDialog
  flag indicating quiet operations (boolean)

Returns:
  flag indicating, that the update contained an add or delete (boolean)

Up