# eric3.VCS.mercurialPackage.ericMercurial

Module implementing the version control systems interface to Mercurial.

### Classes

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

### Functions

None

## Mercurial

Class implementing the version control systems interface to Mercurial.

### Derived from

VersionControl

### Methods

Mercurial | Constructor
_makeOptions | Private method to setup the command options for the Mercurial commands
hgCopy | Public method used to copy a file/directory.
hgExtendedDiff | Public method used to view the difference of a file/directory to the Mercurial repository.
hgForget | Public method used to add a file/directory to the Mercurial repository.
hgIncoming | Public method used to check changesets incoming to the repository.
hgListTags | Public method used to list the available tags.
hgManifest | Public method used to show the manifest of the repository.
hgMerge | @param path repository path to be updated (string or list of strings)
hgMove | Public method used to move a file/directory.
hgNormalizeURL | Private method to normalize a url for Mercurial.
hgOutgoing | Public method used to check changesets outgoing from the repository.
hgPull | Public method used to pull changesets into the repository.
hgPush | Public method used to to push changesets from the repository.
hgUndo | Public method used to undo the last commit or pull transaction.
vcsAdd | Public method used to add a file/directory to the Mercurial repository.
vcsAddBinary | Public method used to add a file/directory in binary mode to the Mercurial repository.
vcsAddTree | Public method to add a directory tree rooted at path to the Mercurial 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 Mercurial repository.
vcsCleanup | Public method used to cleanup the working directory.
vcsCommandLine | Public method used to execute arbitrary mercurial commands.
vcsCommit | Public method used to make the change of a file/directory permanent in the Mercurial 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 Mercurial repository.
vcsExists | Public method used to test for the presence of Mercurial.
vcsExport | Public method used to export a directory from the Mercurial 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 Mercurial repository.
vcsLog | Public method used to view the log of a file/directory from the Mercurial repository.
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 Mercurial repository.
vcsRepositoryInfos | Public method to retrieve information about the repository.
vcsRevert | Public method used to revert changes made to a file/directory.
vcsStatus | Public method used to view the status of a file in the Mercurial repository.
vcsSwitch | Public method used to switch a working directory to a different tag.
vcsTag | Public method used to set the tag of a file/directory in the Mercurial repository.
vcsUpdate | Public method used to update a file/directory with the Mercurial repository.

### Mercurial (Constructor)

Mercurial(parent=None, name=None)

Constructor

parent
  parent widget (QWidget)
name
  name of this object (string or QString)

### Mercurial._makeOptions

_makeOptions(cmd, options)

Private method to setup the command options for the Mercurial commands

cmd
  Mercurial command to prepare for (string)
options
  commandoptions to set explicitly (dictionary)

Returns:
  dictionary of all command options for the given command

### Mercurial.hgCopy

hgCopy(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)

### Mercurial.hgExtendedDiff

hgExtendedDiff(name)

Public method used to view the difference of a file/directory to the Mercurial 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. An entry of 0 for any specific revision is identical to the current revision (i.e the revision as found in the working copy)

name
  file/directory name to be diffed (string)

### Mercurial.hgForget

hgForget(name)

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

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

### Mercurial.hgIncoming

hgIncoming(ppath)

Public method used to check changesets incoming to the repository.

ppath
  directory name of the project (string)

### Mercurial.hgListTags

hgListTags(path)

Public method used to list the available tags.

path
  directory name of the project (string)

### Mercurial.hgManifest

hgManifest(ppath)

Public method used to show the manifest of the repository.

ppath
  directory name of the project (string)

### Mercurial.hgMerge

hgMerge(path)

path
  repository path to be updated (string or list of strings)

### Mercurial.hgMove

hgMove(name, project)

Public method used to move a file/directory.

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

Returns:
  flag indicating successfull operation (boolean)

### Mercurial.hgNormalizeURL

hgNormalizeURL(url)

Private method to normalize a url for Mercurial.

url
  url string (string)

Returns:
  properly normalized url for Mercurial

### Mercurial.hgOutgoing

hgOutgoing(ppath)

Public method used to check changesets outgoing from the repository.

ppath
  directory name of the project (string)

### Mercurial.hgPull

hgPull(ppath)

Public method used to pull changesets into the repository.

ppath
  directory name of the project (string)

### Mercurial.hgPush

hgPush(ppath)

Public method used to to push changesets from the repository.

ppath
  directory name of the project (string)

### Mercurial.hgUndo

hgUndo(ppath)

Public method used to undo the last commit or pull transaction.

ppath
  directory name of the project (string)

### Mercurial.vcsAdd

vcsAdd(name, isDir=0)

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

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

### Mercurial.vcsAddBinary

vcsAddBinary(name, isDir=0)

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

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

### Mercurial.vcsAddTree

vcsAddTree(path)

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

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

### Mercurial.vcsAllRegisteredStates

vcsAllRegisteredStates(names, dname)

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

names
  dictionary with all filenames to be checked as keys
dname
  directory to check in (string)

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

### Mercurial.vcsCheckout

vcsCheckout(vcsDataDict, projectDir, noDialog=0)

Public method used to check the project out of the Mercurial 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)

### Mercurial.vcsCleanup

vcsCleanup(name)

Public method used to cleanup the working directory.

name
  directory name to be cleaned up (string)

### Mercurial.vcsCommandLine

vcsCommandLine(name)

Public method used to execute arbitrary mercurial commands.

name
  directory name of the working directory (string)

### Mercurial.vcsCommit

vcsCommit(name, message, noDialog=0, parent=None)

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

name
  file/directory name to be committed (string or list of strings)
message
  message for this operation (string)
noDialog
  flag indicating quiet operations
parent
  reference to the parent object of the commit dialog (QWidget)

Returns:
  flag indicating an execution without errors (boolean)

### Mercurial.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

### Mercurial.vcsDiff

vcsDiff(name)

Public method used to view the difference of a file/directory to the Mercurial 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)

### Mercurial.vcsExists

vcsExists()

Public method used to test for the presence of Mercurial.

Returns:
  flag indicating the existance (boolean)

### Mercurial.vcsExport

vcsExport(vcsDataDict, projectDir)

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

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

Returns:
  flag indicating an execution without errors (boolean)

### Mercurial.vcsGetProjectBrowserHelper

vcsGetProjectBrowserHelper(browser, project, isTranslationsBrowser=0)

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

### Mercurial.vcsGetProjectHelper

vcsGetProjectHelper(project)

Public method to instanciate a helper object for the project.

project
  reference to the project object

Returns:
  the project helper object

### Mercurial.vcsImport

vcsImport(vcsDataDict, projectDir, noDialog=0)

Public method used to import the project into the Mercurial 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)

### Mercurial.vcsLog

vcsLog(name)

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

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

### Mercurial.vcsName

vcsName()

Public method returning the name of the vcs.

Returns:
  always 'Mercurial' (string)

### Mercurial.vcsNewProjectOptionsDialog

vcsNewProjectOptionsDialog(parent = None)

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

parent
  parent widget (QWidget)

### Mercurial.vcsOptionsDialog

vcsOptionsDialog(project, archive, editable=0, 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)

### Mercurial.vcsRegisteredState

vcsRegisteredState(name)

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

name
  filename to check (string)

Returns:
  a combination of canBeCommited and canBeAdded or 0 in order to signal an error

### Mercurial.vcsRemove

vcsRemove(name, project=0)

Public method used to remove a file/directory from the Mercurial 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)

Returns:
  flag indicating successfull operation (boolean)

### Mercurial.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)

### Mercurial.vcsRevert

vcsRevert(name)

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

name
  file/directory name to be reverted (string)

### Mercurial.vcsStatus

vcsStatus(name)

Public method used to view the status of a file in the Mercurial repository.

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

### Mercurial.vcsSwitch

vcsSwitch(name)

Public method used to switch a working directory to a different tag.

name
  directory name to be switched (string)

### Mercurial.vcsTag

vcsTag(name)

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

name
  file/directory name to be tagged (string)

### Mercurial.vcsUpdate

vcsUpdate(name, merge=0, node=None)

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

name
  repository path to be updated (string or list of strings)
merge
  flag indicating a merge operation (boolean)
node
  tag name or revision to switch to (string)

Up