# eric7.Plugins.VcsPlugins.vcsMercurial.hg

Module implementing the version control systems interface to Mercurial.

### Global Attributes

None

### Classes

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

### Functions

None

## Hg

Class implementing the version control systems interface to Mercurial.

### Signals

activeExtensionsChanged()
  emitted when the list of active extensions has changed
committed()
  emitted after the commit action has completed
iniFileChanged()
  emitted when a Mercurial/repo configuration file has changed

### Derived from

VersionControl

### Class Attributes

IgnoreFileName

### Class Methods

None

### Methods

Hg | Constructor
__checkDefaults | Private method to check, if the default and default-push URLs have been configured.
__createClient | Private method to create a Mercurial command server client.
__getExtensionsInfo | Private method to get the active extensions from Mercurial.
__getInOutBookmarks | Private method to get the list of incoming or outgoing bookmarks.
__getMostRecentCommitMessage | Private method to get the most recent commit message.
__hgGetFileForRevision | Private method to get a file for a specific revision from the repository.
__hgGraftSubCommand | Private method to perform a Mercurial graft subcommand.
__iniFileChanged | Private slot to handle a change of the Mercurial configuration file.
__monitorRepoIniFile | Private slot to add a repository configuration file to the list of monitored files.
__vcsCommit_Step2 | Private slot performing the second step of the commit action.
_createStatusMonitorThread | Protected method to create an instance of the VCS status monitor thread.
canCommitMerge | Public method to check, if the working directory is an uncommitted merge.
canPull | Public method to check, if pull is possible.
canPush | Public method to check, if push is possible.
clearStatusCache | Public method to clear the status cache.
getClient | Public method to get a reference to the command server interface.
getEncoding | Public method to get the encoding to be used by Mercurial.
getExtensionObject | Public method to get a reference to an extension object.
getHgSubPath | Public method to get the path to the .hgsub file containing the definitions of sub-repositories.
getPlugin | Public method to get a reference to the plugin object.
hasSubrepositories | Public method to check, if the project might have sub-repositories.
hgAbortMerge | Public method to abort an uncommitted merge.
hgAddSubrepository | Public method to add a sub-repository.
hgAnnotate | Public method to show the output of the hg annotate command.
hgArchive | Public method to create an unversioned archive from the repository.
hgBackout | Public method used to backout an earlier changeset from the Mercurial repository.
hgBisect | Public method to perform bisect commands.
hgBookmarkDefine | Public method to define a bookmark.
hgBookmarkDelete | Public method to delete a bookmark.
hgBookmarkIncoming | Public method to show a list of incoming bookmarks.
hgBookmarkMove | Public method to move a bookmark.
hgBookmarkOutgoing | Public method to show a list of outgoing bookmarks.
hgBookmarkPull | Public method to pull a bookmark from a remote repository.
hgBookmarkPush | Public method to push a bookmark to a remote repository.
hgBookmarkRename | Public method to rename a bookmark.
hgBranch | Public method used to create a branch in the Mercurial repository.
hgBundle | Public method to create a changegroup file.
hgConflicts | Public method used to show a list of files containing conflicts.
hgCopy | Public method used to copy a file/directory.
hgCreateIgnoreFile | Public method to create the ignore file.
hgDeleteBackups | Public method to delete all backup bundles in the backup area.
hgEditConfig | Public method used to edit the repository configuration file.
hgEditUserConfig | Public method used to edit the user configuration file.
hgExport | Public method to export patches to files.
hgExtendedDiff | Public method used to view the difference of a file/directory to the Mercurial repository.
hgGetBookmarksList | Public method to get the list of bookmarks.
hgGetBranchesList | Public method to get the list of branches.
hgGetCurrentBranch | Public method to get the current branch of the working directory.
hgGetTagsList | Public method to get the list of tags.
hgGraft | Public method to copy changesets from another branch.
hgGraftAbort | Public method to abort an interrupted copying session and perform a rollback.
hgGraftContinue | Public method to continue copying changesets from another branch.
hgGraftStop | Public method to stop an interrupted copying session.
hgIdentify | Public method to identify the current working directory.
hgImport | Public method to import a patch file.
hgIncoming | Public method used to view the log of incoming changes from the Mercurial repository.
hgInfo | Public method to show information about the heads of the repository.
hgListBookmarks | Public method used to list the available bookmarks.
hgListTagBranch | Public method used to list the available tags or branches.
hgNormalizeURL | Public method to normalize a url for Mercurial.
hgOutgoing | Public method used to view the log of outgoing changes from the Mercurial repository.
hgPhase | Public method to change the phase of revisions.
hgPreviewBundle | Public method used to view the log of incoming changes from a changegroup file.
hgPull | Public method used to pull changes from a remote Mercurial repository.
hgPush | Public method used to push changes to a remote Mercurial repository.
hgReMerge | Public method used to merge a URL/revision into the local project.
hgRecover | Public method to recover an interrupted transaction.
hgRemoveSubrepositories | Public method to remove sub-repositories.
hgRollback | Public method used to rollback the last transaction.
hgServe | Public method used to serve the project.
hgShowBranch | Public method used to show the current branch of the working directory.
hgShowConfig | Public method to show the combined configuration.
hgShowPaths | Public method to show the path aliases for remote repositories.
hgSummary | Public method used to show some summary information of the working directory state.
hgUnbundle | Public method to apply changegroup files.
hgVerify | Public method to verify the integrity of the repository.
initCommand | Public method to initialize a command arguments list.
isExtensionActive | Public method to check, if an extension is active.
stopClient | Public method to stop the command server client.
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.
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 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 a Mercurial repository (clone).
vcsCleanup | Public method used to cleanup the working directory.
vcsClearCommitMessages | Public method to clear the list of saved messages.
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.
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 Mercurial repository.
vcsExists | Public method used to test for the presence of the hg executable.
vcsExport | Public method used to export a directory from the Mercurial repository.
vcsForget | Public method used to remove a file from the Mercurial repository.
vcsGetProjectBrowserHelper | Public method to instantiate a helper object for the different project browsers.
vcsGetProjectHelper | Public method to instantiate a helper object for the project.
vcsImport | Public method used to import the project into the Mercurial repository.
vcsInit | Public method used to initialize the mercurial repository.
vcsInitConfig | Public method to initialize the VCS configuration.
vcsLogBrowser | Public method used to browse the log of a file/directory from the Mercurial 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 Mercurial 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 Mercurial interface.
vcsStatus | Public method used to view the status of files/directories in the Mercurial repository.
vcsSupportCommandOptions | Public method to signal the support of user settable command options.
vcsSwitch | Public method used to switch a working directory to a different revision.
vcsTag | Public method used to set/remove a tag in the Mercurial repository.
vcsUpdate | Public method used to update a file/directory with the Mercurial repository.

### Static Methods

None

#### Hg (Constructor)

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

Constructor

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

#### Hg.__checkDefaults

__checkDefaults()

Private method to check, if the default and default-push URLs have been configured.

#### Hg.__createClient

__createClient(repodir="")

Private method to create a Mercurial command server client.

repodir (str)
  path of the local repository

#### Hg.__getExtensionsInfo

__getExtensionsInfo()

Private method to get the active extensions from Mercurial.

#### Hg.__getInOutBookmarks

__getInOutBookmarks(incoming)

Private method to get the list of incoming or outgoing bookmarks.

incoming
  flag indicating to get incoming bookmarks (boolean)

Return:
  list of bookmarks (list of string)

#### Hg.__getMostRecentCommitMessage

__getMostRecentCommitMessage()

Private method to get the most recent commit message.

Note: This message is extracted from the parent commit of the working directory.

Return:
  most recent commit message

Return Type:
  str

#### Hg.__hgGetFileForRevision

__hgGetFileForRevision(name, rev="")

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

name
  file name to get from the repository (string)
rev
  revision to retrieve (string)

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

#### Hg.__hgGraftSubCommand

__hgGraftSubCommand(subcommand, title)

Private method to perform a Mercurial graft subcommand.

subcommand (str)
  subcommand flag
title (str)
  tirle of the dialog

Return:
  flag indicating that the project should be reread

Return Type:
  bool

#### Hg.__iniFileChanged

__iniFileChanged(path)

Private slot to handle a change of the Mercurial configuration file.

path
  name of the changed file (string)

#### Hg.__monitorRepoIniFile

__monitorRepoIniFile(repodir)

Private slot to add a repository configuration file to the list of monitored files.

repodir (str)
  directory name of the repository

#### Hg.__vcsCommit_Step2

__vcsCommit_Step2()

Private slot performing the second step of the commit action.

#### Hg._createStatusMonitorThread

_createStatusMonitorThread(interval, project)

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

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

Return:
  reference to the monitor thread (QThread)

#### Hg.canCommitMerge

canCommitMerge()

Public method to check, if the working directory is an uncommitted merge.

Return:
  flag indicating commit merge capability

Return Type:
  bool

#### Hg.canPull

canPull()

Public method to check, if pull is possible.

Return:
  flag indicating pull capability (boolean)

#### Hg.canPush

canPush()

Public method to check, if push is possible.

Return:
  flag indicating push capability (boolean)

#### Hg.clearStatusCache

clearStatusCache()

Public method to clear the status cache.

#### Hg.getClient

getClient()

Public method to get a reference to the command server interface.

Return:
  reference to the client (HgClient)

#### Hg.getEncoding

getEncoding()

Public method to get the encoding to be used by Mercurial.

Return:
  encoding (string)

#### Hg.getExtensionObject

getExtensionObject(extensionName)

Public method to get a reference to an extension object.

extensionName
  name of the extension (string)

Return:
  reference to the extension object (boolean)

#### Hg.getHgSubPath

getHgSubPath()

Public method to get the path to the .hgsub file containing the definitions of sub-repositories.

Return:
  full path of the .hgsub file (string)

#### Hg.getPlugin

getPlugin()

Public method to get a reference to the plugin object.

Return:
  reference to the plugin object (VcsMercurialPlugin)

#### Hg.hasSubrepositories

hasSubrepositories()

Public method to check, if the project might have sub-repositories.

Return:
  flag indicating the existence of sub-repositories (boolean)

#### Hg.hgAbortMerge

hgAbortMerge()

Public method to abort an uncommitted merge.

Return:
  flag indicating, that the abortion contained an add or delete (boolean)

#### Hg.hgAddSubrepository

hgAddSubrepository()

Public method to add a sub-repository.

#### Hg.hgAnnotate

hgAnnotate(name, skiplist="")

Public method to show the output of the hg annotate command.

name (str)
  file name to show the annotations for
skiplist (str)
  name of a skip list file

#### Hg.hgArchive

hgArchive()

Public method to create an unversioned archive from the repository.

#### Hg.hgBackout

hgBackout()

Public method used to backout an earlier changeset from the Mercurial repository.

#### Hg.hgBisect

hgBisect(subcommand)

Public method to perform bisect commands.

subcommand (str)
  name of the subcommand (one of 'good', 'bad', 'skip' or 'reset')

Raises ValueError:
  raised to indicate an invalid bisect subcommand

#### Hg.hgBookmarkDefine

hgBookmarkDefine(revision=None, bookmark=None)

Public method to define a bookmark.

revision
  revision to set bookmark for (string)
bookmark
  name of the bookmark (string)

#### Hg.hgBookmarkDelete

hgBookmarkDelete(bookmark=None)

Public method to delete a bookmark.

bookmark
  name of the bookmark (string)

#### Hg.hgBookmarkIncoming

hgBookmarkIncoming()

Public method to show a list of incoming bookmarks.

#### Hg.hgBookmarkMove

hgBookmarkMove(revision=None, bookmark=None)

Public method to move a bookmark.

revision
  revision to set bookmark for (string)
bookmark
  name of the bookmark (string)

#### Hg.hgBookmarkOutgoing

hgBookmarkOutgoing()

Public method to show a list of outgoing bookmarks.

#### Hg.hgBookmarkPull

hgBookmarkPull(current=False, bookmark=None)

Public method to pull a bookmark from a remote repository.

current (bool)
  flag indicating to pull the current bookmark
bookmark (str)
  name of the bookmark

#### Hg.hgBookmarkPush

hgBookmarkPush(current=False, bookmark=None, allBookmarks=False)

Public method to push a bookmark to a remote repository.

current (bool)
  flag indicating to push the current bookmark
bookmark (str)
  name of the bookmark
allBookmarks (bool)
  flag indicating to push all bookmarks

#### Hg.hgBookmarkRename

hgBookmarkRename(renameInfo=None)

Public method to rename a bookmark.

renameInfo (tuple of str and str)
  old and new names of the bookmark

#### Hg.hgBranch

hgBranch()

Public method used to create a branch in the Mercurial repository.

#### Hg.hgBundle

hgBundle(bundleData=None)

Public method to create a changegroup file.

bundleData (dict)
  dictionary containing the bundle creation information

#### Hg.hgConflicts

hgConflicts()

Public method used to show a list of files containing conflicts.

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

Return:
  flag indicating successful operation (boolean)

#### Hg.hgCreateIgnoreFile

hgCreateIgnoreFile(name, autoAdd=False)

Public method to create the ignore file.

name
  directory name to create the ignore file in (string)
autoAdd
  flag indicating to add it automatically (boolean)

Return:
  flag indicating success

#### Hg.hgDeleteBackups

hgDeleteBackups()

Public method to delete all backup bundles in the backup area.

#### Hg.hgEditConfig

hgEditConfig(repoName=None, withLargefiles=True, largefilesData=None)

Public method used to edit the repository configuration file.

repoName (str)
  directory name containing the repository
withLargefiles (bool)
  flag indicating to configure the largefiles section
largefilesData (dict)
  dictionary with data for the largefiles section of the data dialog

#### Hg.hgEditUserConfig

hgEditUserConfig()

Public method used to edit the user configuration file.

#### Hg.hgExport

hgExport()

Public method to export patches to files.

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

name
  file/directory name to be diffed (string)

#### Hg.hgGetBookmarksList

hgGetBookmarksList()

Public method to get the list of bookmarks.

Return:
  list of bookmarks (list of string)

#### Hg.hgGetBranchesList

hgGetBranchesList()

Public method to get the list of branches.

Return:
  list of branches (list of string)

#### Hg.hgGetCurrentBranch

hgGetCurrentBranch()

Public method to get the current branch of the working directory.

Return:
  name of the current branch

Return Type:
  str

#### Hg.hgGetTagsList

hgGetTagsList(withType=False)

Public method to get the list of tags.

withType
  flag indicating to get the tag type as well (boolean)

Return:
  list of tags (list of string) or list of tuples of tag name and flag indicating a local tag (list of tuple of string and boolean), if withType is True

#### Hg.hgGraft

hgGraft(revs=None)

Public method to copy changesets from another branch.

revs
  list of revisions to show in the revisions pane (list of strings)

Return:
  flag indicating that the project should be reread (boolean)

#### Hg.hgGraftAbort

hgGraftAbort()

Public method to abort an interrupted copying session and perform a rollback.

Return:
  flag indicating that the project should be reread

Return Type:
  bool

#### Hg.hgGraftContinue

hgGraftContinue()

Public method to continue copying changesets from another branch.

Return:
  flag indicating that the project should be reread

Return Type:
  bool

#### Hg.hgGraftStop

hgGraftStop()

Public method to stop an interrupted copying session.

Return:
  flag indicating that the project should be reread

Return Type:
  bool

#### Hg.hgIdentify

hgIdentify()

Public method to identify the current working directory.

#### Hg.hgImport

hgImport()

Public method to import a patch file.

Return:
  flag indicating, that the import contained an add, a delete or a change to the project file (boolean)

#### Hg.hgIncoming

hgIncoming()

Public method used to view the log of incoming changes from the Mercurial repository.

#### Hg.hgInfo

hgInfo(mode="heads")

Public method to show information about the heads of the repository.

mode
  mode of the operation (string, one of heads, parents, tip)

#### Hg.hgListBookmarks

hgListBookmarks()

Public method used to list the available bookmarks.

#### Hg.hgListTagBranch

hgListTagBranch(tags=True)

Public method used to list the available tags or branches.

tags
  flag indicating listing of branches or tags (False = branches, True = tags)

#### Hg.hgNormalizeURL

hgNormalizeURL(url)

Public method to normalize a url for Mercurial.

url
  url string (string)

Return:
  properly normalized url for mercurial (string)

#### Hg.hgOutgoing

hgOutgoing()

Public method used to view the log of outgoing changes from the Mercurial repository.

#### Hg.hgPhase

hgPhase(data=None)

Public method to change the phase of revisions.

data
  tuple giving phase data (list of revisions, phase, flag indicating a forced operation) (list of strings, string, boolean)

Return:
  flag indicating success (boolean)

Raises ValueError:
  raised to indicate an invalid phase

#### Hg.hgPreviewBundle

hgPreviewBundle()

Public method used to view the log of incoming changes from a changegroup file.

#### Hg.hgPull

hgPull(revisions=None)

Public method used to pull changes from a remote Mercurial repository.

revisions (list of str)
  list of revisions to be pulled

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

Return Type:
  bool

#### Hg.hgPush

hgPush(force=False, newBranch=False, rev=None)

Public method used to push changes to a remote Mercurial repository.

force
  flag indicating a forced push (boolean)
newBranch
  flag indicating to push a new branch (boolean)
rev
  revision to be pushed (including all ancestors) (string)

#### Hg.hgReMerge

hgReMerge(name)

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

name
  file/directory name to be merged (string)

#### Hg.hgRecover

hgRecover()

Public method to recover an interrupted transaction.

#### Hg.hgRemoveSubrepositories

hgRemoveSubrepositories()

Public method to remove sub-repositories.

#### Hg.hgRollback

hgRollback()

Public method used to rollback the last transaction.

#### Hg.hgServe

hgServe(repoPath)

Public method used to serve the project.

repoPath (str)
  directory containing the repository

#### Hg.hgShowBranch

hgShowBranch()

Public method used to show the current branch of the working directory.

#### Hg.hgShowConfig

hgShowConfig()

Public method to show the combined configuration.

#### Hg.hgShowPaths

hgShowPaths()

Public method to show the path aliases for remote repositories.

#### Hg.hgSummary

hgSummary(mq=False, largefiles=False)

Public method used to show some summary information of the working directory state.

mq
  flag indicating to show the queue status as well (boolean)
largefiles
  flag indicating to show the largefiles status as well (boolean)

#### Hg.hgUnbundle

hgUnbundle(files=None)

Public method to apply changegroup files.

files (list of str)
  list of bundle files to be applied

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

Return Type:
  bool

#### Hg.hgVerify

hgVerify()

Public method to verify the integrity of the repository.

#### Hg.initCommand

initCommand(command)

Public method to initialize a command arguments list.

command
  command name (string)

Return:
  list of command options (list of string)

#### Hg.isExtensionActive

isExtensionActive(extensionName)

Public method to check, if an extension is active.

extensionName
  name of the extension to check for (string)

Return:
  flag indicating an active extension (boolean)

#### Hg.stopClient

stopClient()

Public method to stop the command server client.

#### Hg.vcsAdd

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

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)
noDialog
  flag indicating quiet operations

#### Hg.vcsAddBinary

vcsAddBinary(name, isDir=False)

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)

#### Hg.vcsAddCommitMessage

vcsAddCommitMessage(message)

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

message (str)
  message to be added

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

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

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

#### Hg.vcsCheckout

vcsCheckout(vcsDataDict, projectDir, noDialog=False)

Public method used to check the project out of a Mercurial repository (clone).

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

Return:
  flag indicating an execution without errors (boolean)

#### Hg.vcsCleanup

vcsCleanup(name)

Public method used to cleanup the working directory.

name
  directory name to be cleaned up (string)

#### Hg.vcsClearCommitMessages

vcsClearCommitMessages()

Public method to clear the list of saved messages.

#### Hg.vcsCommandLine

vcsCommandLine(name)

Public method used to execute arbitrary mercurial commands.

name
  directory name of the working directory (string)

#### Hg.vcsCommit

vcsCommit(name, message, noDialog=False, closeBranch=False, mq=False, merge=False)

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
closeBranch
  flag indicating a close branch commit (boolean)
mq
  flag indicating a queue commit (boolean)
merge
  flag indicating a merge commit (boolean)

#### Hg.vcsCommitMessages

vcsCommitMessages()

Public method to get the list of saved commit messages.

Return:
  list of saved commit messages

Return Type:
  list of str

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

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

#### Hg.vcsExists

vcsExists()

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

Return:
  flag indicating the existence (boolean) and an error message (string)

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

Return:
  flag indicating an execution without errors (boolean)

#### Hg.vcsForget

vcsForget(name)

Public method used to remove a file from the Mercurial repository.

This will not remove the file from the project directory.

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

#### Hg.vcsGetProjectBrowserHelper

vcsGetProjectBrowserHelper(browser, project, isTranslationsBrowser=False)

Public method to instantiate 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)

Return:
  the project browser helper object

#### Hg.vcsGetProjectHelper

vcsGetProjectHelper(project)

Public method to instantiate a helper object for the project.

project
  reference to the project object

Return:
  the project helper object

#### Hg.vcsImport

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

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

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

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

Return Type:
  tuple of (bool, bool)

#### Hg.vcsInit

vcsInit(vcsDir, noDialog=False)

Public method used to initialize the mercurial repository.

The initialization is done, when a project is converted into a Mercurial controlled project. Therefore we always return TRUE without doing anything.

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

Return:
  always TRUE

#### Hg.vcsInitConfig

vcsInitConfig(project)

Public method to initialize the VCS configuration.

This method ensures, that an ignore file exists.

project
  reference to the project (Project)

#### Hg.vcsLogBrowser

vcsLogBrowser(name=None, isFile=False)

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

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

#### Hg.vcsMerge

vcsMerge(name, rev="")

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

name (str)
  file/directory name to be merged
rev (str)
  revision to merge with

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

Return:
  flag indicating successfull operation (boolean)

#### Hg.vcsName

vcsName()

Public method returning the name of the vcs.

Return:
  always 'Mercurial' (string)

#### Hg.vcsNewProjectOptionsDialog

vcsNewProjectOptionsDialog(parent=None)

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

parent
  parent widget (QWidget)

Return:
  reference to the instantiated options dialog (HgNewProjectOptionsDialog)

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

Return:
  reference to the instantiated options dialog (HgOptionsDialog)

#### Hg.vcsRegisteredState

vcsRegisteredState(name)

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

name (str)
  file or directory name to check

Return:
  a combination of canBeCommited and canBeAdded

Return Type:
  int

#### Hg.vcsRemove

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

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) (not needed)
noDialog
  flag indicating quiet operations

Return:
  flag indicating successfull operation (boolean)

#### Hg.vcsRepositoryInfos

vcsRepositoryInfos(ppath)

Public method to retrieve information about the repository.

ppath
  local path to get the repository infos (string)

Return:
  string with ready formated info for display (string)

#### Hg.vcsResolved

vcsResolved(name, unresolve=False)

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

name
  file/directory name to be resolved (string)
unresolve
  flag indicating to mark the file/directory as unresolved (boolean)

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

#### Hg.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
  file name to be diffed (string)
extended
  flag indicating the extended variant (boolean)
revisions
  tuple of two revisions (tuple of strings)

Raises ValueError:
  raised to indicate an invalid name parameter

#### Hg.vcsShutdown

vcsShutdown()

Public method used to shutdown the Mercurial interface.

#### Hg.vcsStatus

vcsStatus(name)

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

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

#### Hg.vcsSupportCommandOptions

vcsSupportCommandOptions()

Public method to signal the support of user settable command options.

Return:
  flag indicating the support of user settable command options (boolean)

#### Hg.vcsSwitch

vcsSwitch(name)

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

name
  directory name to be switched (string)

Return:
  flag indicating, that the switch contained an add or delete (boolean)

#### Hg.vcsTag

vcsTag(name=None, revision=None, tagName=None)

Public method used to set/remove a tag in the Mercurial repository.

name
  file/directory name to determine the repo root from (string)
revision
  revision to set tag for (string)
tagName
  name of the tag (string)

Return:
  flag indicating a performed tag action (boolean)

#### Hg.vcsUpdate

vcsUpdate(name=None, noDialog=False, revision=None)

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

name
  file/directory name to be updated (not used)
noDialog
  flag indicating quiet operations (boolean)
revision
  revision to update to (string)

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

Up