# eric6.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.
__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.
hgForget | Public method used to remove a file from 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.
hgResolved | Public method used to resolve conflicts of a file/directory.
hgRevert | Public method used to revert changes made to a file/directory.
hgRollback | Public method used to rollback the last transaction.
hgSbsDiff | Public method used to view the difference of a file to the Mercurial repository side-by-side.
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.
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 a Mercurial repository (clone).
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 the hg executable.
vcsExport | Public method used to export a directory 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.
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.__getExtensionsInfo

__getExtensionsInfo()

Private method to get the active extensions from Mercurial.

#### Hg.__getInOutBookmarks

__getInOutBookmarks(repodir, incoming)

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

repodir
  directory name of the repository (string)
incoming
  flag indicating to get incoming bookmarks (boolean)

Returns:
  list of bookmarks (list of string)

#### Hg.__getMostRecentCommitMessage

__getMostRecentCommitMessage(repodir)

Private method to get the most recent commit message.

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

repodir (str)
  path containing the repository

Returns:
  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)

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

#### Hg.__hgGraftSubCommand

__hgGraftSubCommand(path, subcommand, title)

Private method to perform a Mercurial graft subcommand.

path (str)
  directory name of the project
subcommand (str)
  subcommand flag
title (str)
  tirle of the dialog

Returns:
  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(name)

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

name
  directory name pointing into the repository (string)

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

Returns:
  reference to the monitor thread (QThread)

#### Hg.canCommitMerge

canCommitMerge(name)

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

name (str)
  file/directory name

Returns:
  flag indicating commit merge capability

Return Type:
  bool

#### Hg.canPull

canPull()

Public method to check, if pull is possible.

Returns:
  flag indicating pull capability (boolean)

#### Hg.canPush

canPush()

Public method to check, if push is possible.

Returns:
  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.

Returns:
  reference to the client (HgClient)

#### Hg.getEncoding

getEncoding()

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

Returns:
  encoding (string)

#### Hg.getExtensionObject

getExtensionObject(extensionName)

Public method to get a reference to an extension object.

extensionName
  name of the extension (string)

Returns:
  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.

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

#### Hg.getPlugin

getPlugin()

Public method to get a reference to the plugin object.

Returns:
  reference to the plugin object (VcsMercurialPlugin)

#### Hg.hasSubrepositories

hasSubrepositories()

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

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

#### Hg.hgAbortMerge

hgAbortMerge(name)

Public method to abort an uncommitted merge.

name
  file/directory name (string)

Returns:
  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)

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

name
  file name to show the annotations for (string)

#### Hg.hgArchive

hgArchive()

Public method to create an unversioned archive from the repository.

#### Hg.hgBackout

hgBackout(name)

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

name
  directory name (string or list of strings)

#### Hg.hgBisect

hgBisect(name, subcommand)

Public method to perform bisect commands.

name
  file/directory name (string)
subcommand
  name of the subcommand (string, one of 'good', 'bad', 'skip' or 'reset')

Raises ValueError:
  raised to indicate an invalid bisect subcommand

#### Hg.hgBookmarkDefine

hgBookmarkDefine(name, revision=None, bookmark=None)

Public method to define a bookmark.

name
  file/directory name (string)
revision
  revision to set bookmark for (string)
bookmark
  name of the bookmark (string)

#### Hg.hgBookmarkDelete

hgBookmarkDelete(name, bookmark=None)

Public method to delete a bookmark.

name
  file/directory name (string)
bookmark
  name of the bookmark (string)

#### Hg.hgBookmarkIncoming

hgBookmarkIncoming(name)

Public method to show a list of incoming bookmarks.

name
  file/directory name (string)

#### Hg.hgBookmarkMove

hgBookmarkMove(name, revision=None, bookmark=None)

Public method to move a bookmark.

name
  file/directory name (string)
revision
  revision to set bookmark for (string)
bookmark
  name of the bookmark (string)

#### Hg.hgBookmarkOutgoing

hgBookmarkOutgoing(name)

Public method to show a list of outgoing bookmarks.

name
  file/directory name (string)

#### Hg.hgBookmarkPull

hgBookmarkPull(name, current=False, bookmark=None)

Public method to pull a bookmark from a remote repository.

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

#### Hg.hgBookmarkPush

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

Public method to push a bookmark to a remote repository.

name (str)
  file/directory name
current (bool)
  flag indicating to push the current bookmark
bookmark (str)
  name of the bookmark

#### Hg.hgBookmarkRename

hgBookmarkRename(name, renameInfo=None)

Public method to rename a bookmark.

name (str)
  file/directory name
renameInfo (tuple of str and str)
  old and new names of the bookmark

#### Hg.hgBranch

hgBranch(name)

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

name
  file/directory name to be branched (string)

#### Hg.hgBundle

hgBundle(name, bundleData=None)

Public method to create a changegroup file.

name (str)
  file/directory name
bundleData (dict)
  dictionary containing the bundle creation information

#### Hg.hgConflicts

hgConflicts(name)

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

name
  file/directory name to be resolved (string)

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

Returns:
  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)

Returns:
  flag indicating success

#### Hg.hgDeleteBackups

hgDeleteBackups()

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

#### Hg.hgEditConfig

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

Public method used to edit the repository configuration file.

name
  file/directory name (string)
withLargefiles
  flag indicating to configure the largefiles section (boolean)
largefilesData
  dictionary with data for the largefiles section of the data dialog (dict)

#### Hg.hgEditUserConfig

hgEditUserConfig()

Public method used to edit the user configuration file.

#### Hg.hgExport

hgExport(name)

Public method to export patches to files.

name
  directory name of the project to export from (string)

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

hgForget(name)

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

This will not remove the file from the project directory.

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

#### Hg.hgGetBookmarksList

hgGetBookmarksList(repodir)

Public method to get the list of bookmarks.

repodir
  directory name of the repository (string)

Returns:
  list of bookmarks (list of string)

#### Hg.hgGetBranchesList

hgGetBranchesList(repodir)

Public method to get the list of branches.

repodir
  directory name of the repository (string)

Returns:
  list of branches (list of string)

#### Hg.hgGetCurrentBranch

hgGetCurrentBranch(repodir)

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

repodir (str)
  directory name of the repository

Returns:
  name of the current branch

Return Type:
  str

#### Hg.hgGetTagsList

hgGetTagsList(repodir, withType=False)

Public method to get the list of tags.

repodir
  directory name of the repository (string)
withType
  flag indicating to get the tag type as well (boolean)

Returns:
  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(path, revs=None)

Public method to copy changesets from another branch.

path
  directory name of the project (string)
revs
  list of revisions to show in the revisions pane (list of strings)

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

#### Hg.hgGraftAbort

hgGraftAbort(path)

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

path (str)
  directory name of the project

Returns:
  flag indicating that the project should be reread

Return Type:
  bool

#### Hg.hgGraftContinue

hgGraftContinue(path)

Public method to continue copying changesets from another branch.

path (str)
  directory name of the project

Returns:
  flag indicating that the project should be reread

Return Type:
  bool

#### Hg.hgGraftStop

hgGraftStop(path)

Public method to stop an interrupted copying session.

path (str)
  directory name of the project

Returns:
  flag indicating that the project should be reread

Return Type:
  bool

#### Hg.hgIdentify

hgIdentify(name)

Public method to identify the current working directory.

name
  file/directory name (string)

#### Hg.hgImport

hgImport(name)

Public method to import a patch file.

name
  directory name of the project to import into (string)

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

#### Hg.hgIncoming

hgIncoming(name)

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

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

#### Hg.hgInfo

hgInfo(ppath, mode="heads")

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

ppath
  local path to get the repository infos (string)
mode=
  mode of the operation (string, one of heads, parents, tip)

#### Hg.hgListBookmarks

hgListBookmarks(path)

Public method used to list the available bookmarks.

path
  directory name of the project (string)

#### Hg.hgListTagBranch

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

#### Hg.hgNormalizeURL

hgNormalizeURL(url)

Public method to normalize a url for Mercurial.

url
  url string (string)

Returns:
  properly normalized url for mercurial (string)

#### Hg.hgOutgoing

hgOutgoing(name)

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

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

#### Hg.hgPhase

hgPhase(name, data=None)

Public method to change the phase of revisions.

name
  directory name of the project to export from (string)
data
  tuple giving phase data (list of revisions, phase, flag indicating a forced operation) (list of strings, string, boolean)

Returns:
  flag indicating success (boolean)

Raises ValueError:
  raised to indicate an invalid phase

#### Hg.hgPreviewBundle

hgPreviewBundle(name)

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

name
  directory name on which to base the changegroup (string)

#### Hg.hgPull

hgPull(name, revisions=None)

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

name (str)
  directory name of the project to be pulled to
revisions (list of str)
  list of revisions to be pulled

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

Return Type:
  bool

#### Hg.hgPush

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

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

name
  directory name of the project to be pushed from (string)
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(name)

Public method to recover an interrupted transaction.

name
  file/directory name (string)

#### Hg.hgRemoveSubrepositories

hgRemoveSubrepositories()

Public method to remove sub-repositories.

#### Hg.hgResolved

hgResolved(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.hgRevert

hgRevert(name)

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

name
  file/directory name to be reverted (string)

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

#### Hg.hgRollback

hgRollback(name)

Public method used to rollback the last transaction.

name
  directory name (string or list of strings)

#### Hg.hgSbsDiff

hgSbsDiff(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.hgServe

hgServe(name)

Public method used to serve the project.

name
  directory name (string)

#### Hg.hgShowBranch

hgShowBranch(name)

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

name
  file/directory name (string)

#### Hg.hgShowConfig

hgShowConfig(name)

Public method to show the combined configuration.

name
  file/directory name (string)

#### Hg.hgShowPaths

hgShowPaths(name)

Public method to show the path aliases for remote repositories.

name
  file/directory name (string)

#### 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(name, files=None)

Public method to apply changegroup files.

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

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

Return Type:
  bool

#### Hg.hgVerify

hgVerify(name)

Public method to verify the integrity of the repository.

name
  file/directory name (string)

#### Hg.initCommand

initCommand(command)

Public method to initialize a command arguments list.

command
  command name (string)

Returns:
  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)

Returns:
  flag indicating an active extension (boolean)

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

Returns:
  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

Returns:
  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.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.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.

Returns:
  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)

Returns:
  flag indicating an execution without errors (boolean)

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

Returns:
  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

Returns:
  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

Returns:
  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)

Returns:
  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, 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

Returns:
  flag indicating successfull operation (boolean)

#### Hg.vcsName

vcsName()

Public method returning the name of the vcs.

Returns:
  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)

Returns:
  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)

Returns:
  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
  filename to check (string)

Returns:
  a combination of canBeCommited and canBeAdded

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

Returns:
  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)

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

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

Returns:
  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)

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

#### Hg.vcsTag

vcsTag(name, 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)

Returns:
  flag indicating a performed tag action (boolean)

#### Hg.vcsUpdate

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

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

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

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

Up