# eric7.Plugins.VcsPlugins.vcsSubversion.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
__svnGetFileForRevision | Private method to get a file for a specific revision from the repository.
__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.
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.
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.
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.
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.
svnUpgrade | Public method to upgrade the working copy format.
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.
vcsAddCommitMessage | Public method to add a commit message to the list of saved messages.
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.
vcsClearCommitMessages | Public method to clear the list of saved messages.
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.
vcsCommitMessages | Public method to get the list of saved commit messages.
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.
vcsForget | Public method used to remove a file from the 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.
vcsLogBrowser | Public method used to browse 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.
vcsResolved | Public method used to resolve conflicts of a file/directory.
vcsRevert | Public method used to revert changes made to a file/directory.
vcsSbsDiff | Public method used to view the difference of a file to the Mercurial repository side-by-side.
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 (VcsSubversionPlugin)
  reference to the plugin object
parent (QWidget)
  parent widget
name (str)
  name of this object

#### Subversion.__svnGetFileForRevision

__svnGetFileForRevision(name, rev="")

Private method to get a file for a specific revision from the repository.

name (str)
  file name to get from the repository
rev (int or str)
  revision to retrieve

Return:
  contents of the file (string) and an error message

Return Type:
  str

#### Subversion.__svnURL

__svnURL(url)

Private method to format a url for subversion.

url (str)
  unformatted url string

Return:
  properly formated url for subversion

Return Type:
  str

#### 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 (dict)
  dictionary with all filenames to be checked as keys
dname (str)
  directory to check in
shortcut (bool)
  flag indicating a shortcut should be taken

Return:
  the received dictionary completed with the VCS state or None in order to signal an error

Return Type:
  dict

#### Subversion.__vcsAllRegisteredStates_wcng

__vcsAllRegisteredStates_wcng(names, dname)

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 (dict)
  dictionary with all filenames to be checked as keys
dname (str)
  directory to check in

Return:
  the received dictionary completed with the VCS state or None in order to signal an error

Return Type:
  dict

#### 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 (str)
  filename to check

Return:
  registered state

Return Type:
  VersionControlState

#### 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 (str)
  filename to check

Return:
  registered state

Return Type:
  VersionControlState

#### Subversion._createStatusMonitorThread

_createStatusMonitorThread(interval, project)

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

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

Return:
  reference to the monitor thread

Return Type:
  SvnStatusMonitorThread

#### Subversion.clearStatusCache

clearStatusCache()

Public method to clear the status cache.

#### Subversion.getPlugin

getPlugin()

Public method to get a reference to the plugin object.

Return:
  reference to the plugin object

Return Type:
  VcsSubversionPlugin

#### Subversion.svnAddToChangelist

svnAddToChangelist(names)

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

Note: Directories will be added recursively.

names (str or list of str)
  name or list of names of file or directory to add

#### Subversion.svnBlame

svnBlame(name)

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

name (str)
  file name to show the blame for

#### Subversion.svnCopy

svnCopy(name, project)

Public method used to copy a file/directory.

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

Return:
  flag indicating successfull operation

Return Type:
  bool

#### Subversion.svnDelProp

svnDelProp(name, recursive=False)

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

name (str or list of str)
  file/directory name
recursive (bool)
  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 (str)
  file/directory name to be diffed

#### Subversion.svnGetChangelists

svnGetChangelists()

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

Return:
  list of defined change list names

Return Type:
  list of str

#### Subversion.svnGetReposName

svnGetReposName(path)

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

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

Return:
  string with the repository path URL

Return Type:
  str

#### Subversion.svnListProps

svnListProps(name, recursive=False)

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

name (str or list of str)
  file/directory name
recursive (bool)
  flag indicating a recursive list is requested

#### Subversion.svnListTagBranch

svnListTagBranch(path, tags=True)

Public method used to list the available tags or branches.

path (str)
  directory name of the project
tags (bool)
  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 (str or list of str)
  file/directory name to be locked
stealIt (bool)
  flag indicating a forced operation
parent (QWidget)
  reference to the parent object of the subversion dialog

#### Subversion.svnNormalizeURL

svnNormalizeURL(url)

Public method to normalize a url for subversion.

url (str)
  url string

Return:
  properly normalized url for subversion

Return Type:
  str

#### Subversion.svnRelocate

svnRelocate(projectPath)

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

projectPath (str)
  path name of the project

#### Subversion.svnRemoveFromChangelist

svnRemoveFromChangelist(names)

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

Note: Directories will be removed recursively.

names (str or list of str)
  name or list of names of file or directory to remove

#### Subversion.svnRepoBrowser

svnRepoBrowser(projectPath=None)

Public method to open the repository browser.

projectPath (str)
  path name of the project

#### Subversion.svnSetProp

svnSetProp(name, recursive=False)

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

name (str or list of str)
  file/directory name
recursive (bool)
  flag indicating a recursive list is requested

#### Subversion.svnShowChangelists

svnShowChangelists(path)

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

path (str)
  directory name to show change lists for

#### Subversion.svnUnlock

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

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

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

#### Subversion.svnUpgrade

svnUpgrade(path)

Public method to upgrade the working copy format.

path (str)
  directory name to show change lists for

#### 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 (str)
  file/directory name to be diffed

#### Subversion.vcsAdd

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

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

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

#### Subversion.vcsAddBinary

vcsAddBinary(name, isDir=False)

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

name (str)
  file/directory name to be added
isDir (bool)
  flag indicating name is a directory

#### Subversion.vcsAddCommitMessage

vcsAddCommitMessage(message)

Public method to add a commit message to the list of saved messages.

message (str)
  message to be added

#### Subversion.vcsAddTree

vcsAddTree(path)

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

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

#### 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 have been populated by the previous run.

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

Return:
  the received dictionary completed with the VCS state or None in order to signal an error

Return Type:
  dict

#### Subversion.vcsCheckout

vcsCheckout(vcsDataDict, projectDir, noDialog=False)

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

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

Return:
  flag indicating an execution without errors

Return Type:
  bool

#### Subversion.vcsCleanup

vcsCleanup(name)

Public method used to cleanup the working copy.

name (str)
  directory name to be cleaned up

#### Subversion.vcsClearCommitMessages

vcsClearCommitMessages()

Public method to clear the list of saved messages.

#### Subversion.vcsCommandLine

vcsCommandLine(name)

Public method used to execute arbitrary subversion commands.

name (str)
  directory name of the working directory

#### Subversion.vcsCommit

vcsCommit(name, message, noDialog=False)

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

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

#### Subversion.vcsCommitMessages

vcsCommitMessages()

Public method to get the list of saved commit messages.

Return:
  list of saved commit messages

Return Type:
  list of str

#### Subversion.vcsConvertProject

vcsConvertProject(vcsDataDict, project, addAll=True)

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

vcsDataDict (dict)
  dictionary of data required for the conversion
project (Project)
  reference to the project object
addAll (bool)
  flag indicating to add all files to the repository

#### 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 (str)
  file/directory name to be diffed

#### Subversion.vcsExists

vcsExists()

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

Return:
  flag indicating the existence and an error message

Return Type:
  tuple of (bool, str)

#### Subversion.vcsExport

vcsExport(vcsDataDict, projectDir)

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

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

Return:
  flag indicating an execution without errors

Return Type:
  bool

#### Subversion.vcsForget

vcsForget(name)

Public method used to remove a file from the repository.

Note: svn does not support this operation. The method is implemented as a NoOp.

name (str or list of str)
  file/directory name to be removed

#### Subversion.vcsGetProjectBrowserHelper

vcsGetProjectBrowserHelper(browser, project, isTranslationsBrowser=False)

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

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

Return:
  the project browser helper object

Return Type:
  SvnProjectBrowserHelper

#### Subversion.vcsGetProjectHelper

vcsGetProjectHelper(project)

Public method to instanciate a helper object for the project.

project (Project)
  reference to the project object

Return:
  the project helper object

Return Type:
  SvnProjectHelper

#### Subversion.vcsImport

vcsImport(vcsDataDict, projectDir, noDialog=False, addAll=True)

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

vcsDataDict (dict)
  dictionary of data required for the import
projectDir (str)
  project directory
noDialog (bool)
  flag indicating quiet operations
addAll (bool)
  flag indicating to add all files to the repository (unused)

Return:
  tuple containing a flag indicating an execution without errors and a flag indicating the version controll status

Return Type:
  tuple of (bool, bool)

#### Subversion.vcsInit

vcsInit(vcsDir, noDialog=False)

Public method used to initialize the subversion repository.

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

vcsDir (str)
  name of the VCS directory (unused)
noDialog (bool)
  flag indicating quiet operations (unused)

Return:
  always True

Return Type:
  bool

#### Subversion.vcsInitConfig

vcsInitConfig(_project)

Public method to initialize the VCS configuration.

This method ensures, that an ignore file exists.

_project (Project)
  reference to the project (unused)

#### Subversion.vcsLogBrowser

vcsLogBrowser(name, isFile=False)

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

name (str)
  file/directory name to show the log of
isFile (bool)
  flag indicating log for a file is to be shown

#### Subversion.vcsMerge

vcsMerge(name)

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

name (str)
  file/directory name to be merged

#### Subversion.vcsMove

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

Public method used to move a file/directory.

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

Return:
  flag indicating successfull operation

Return Type:
  bool

#### Subversion.vcsName

vcsName()

Public method returning the name of the vcs.

Return:
  always 'Subversion'

Return Type:
  str

#### Subversion.vcsNewProjectOptionsDialog

vcsNewProjectOptionsDialog(parent=None)

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

parent (QWidget)
  parent widget

Return:
  reference to the instantiated options dialog

Return Type:
  SvnNewProjectOptionsDialog

#### Subversion.vcsOptionsDialog

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

Public method to get a dialog to enter repository info.

project (Project)
  reference to the project object
_archive (str)
  name of the project in the repository (unused)
editable (bool)
  flag indicating that the project name is editable (unused)
parent (QWidget)
  parent widget

Return:
  reference to the instantiated options dialog

Return Type:
  SvnOptionsDialog

#### Subversion.vcsRegisteredState

vcsRegisteredState(name)

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

name (str)
  filename to check

Return:
  registered state

Return Type:
  VersionControlState

#### 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 (str or list of str)
  file/directory name to be removed
project (bool)
  flag indicating deletion of a project tree (unused)
noDialog (bool)
  flag indicating quiet operations

Return:
  flag indicating successfull operation

Return Type:
  bool

#### Subversion.vcsRepositoryInfos

vcsRepositoryInfos(ppath)

Public method to retrieve information about the repository.

ppath (str)
  local path to get the repository infos

Return:
  string with ready formated info for display

Return Type:
  str

#### Subversion.vcsResolved

vcsResolved(name)

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

name (str)
  file/directory name to be resolved

#### Subversion.vcsRevert

vcsRevert(name)

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

name (str)
  file/directory name to be reverted

Return:
  flag indicating, that the update contained an add or delete

Return Type:
  bool

#### Subversion.vcsSbsDiff

vcsSbsDiff(name, extended=False, revisions=None)

Public method used to view the difference of a file to the Mercurial repository side-by-side.

name (str)
  file name to be diffed
extended (bool)
  flag indicating the extended variant
revisions (tuple of (str, str))
  tuple of two revisions

Raises ValueError:
  raised to indicate an illegal name parameter type

#### 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 (str or list of str)
  file/directory name(s) to show the status of

#### Subversion.vcsSwitch

vcsSwitch(name)

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

name (str)
  directory name to be switched

Return:
  flag indicating added or changed files

Return Type:
  bool

#### Subversion.vcsTag

vcsTag(name)

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

name (str)
  file/directory name to be tagged

#### Subversion.vcsUpdate

vcsUpdate(name, noDialog=False)

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

name (str or list of str)
  file/directory name to be updated
noDialog (bool)
  flag indicating quiet operations

Return:
  flag indicating, that the update contained an add or delete

Return Type:
  bool

Up