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

committed()
emitted after the commit action has completed

Derived from

VersionControl

Class Attributes

None

Methods

Hg Constructor
__hgURL Private method to format a url for Mercurial.
__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.
clearStatusCache Public method to clear the status cache.
getPlugin Public method to get a reference to the plugin object.
hgAnnotate Public method to show the output of the hg annotate command.
hgBackout Public method used to backout an earlier changeset from the Mercurial repository.
hgBisect Public method to perform bisect commands.
hgBranch Public method used to create a branch in the Mercurial repository.
hgBundle Public method to create a changegroup file.
hgCopy Public method used to copy a file/directory.
hgCreateIgnoreFile Public method to create the ignore file.
hgEditConfig Public method used to edit the repository config file.
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.
hgIdentify Public method to identify the current working directory.
hgIdentifyBundle Public method used to identify a changegroup 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.
hgListTagBranch Public method used to list the available tags or branches.
hgLogBrowser Public method used to browse the log of a file/directory from the Mercurial repository.
hgLogLimited Public method used to view the (limited) log of a file/directory from the Mercurial repository.
hgNormalizeURL Public method to normalize a url for Mercurial.
hgOutgoing Public method used to view the log of outgoing changes from the Mercurial repository.
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.
hgRecover Public method to recover an interrupted transaction.
hgResolve Public method used to resolve conflicts of a file/directory.
hgShowBranch Public method used to show the current branch the working directory.
hgShowConfig Public method to show the combined config.
hgShowPaths Public method to show the path aliases for remote repositories.
hgUnbundle Public method to apply changegroup files.
hgVerify Public method to verify the integrity of the repository.
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 Subversion repository.
vcsGetProjectBrowserHelper Public method to instanciate a helper object for the different project browsers.
vcsGetProjectHelper Public method to instanciate a helper object for the project.
vcsImport Public method used to import the project into the Subversion repository.
vcsInit Public method used to initialize the mercurial repository.
vcsLog Public method used to view 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.
vcsRevert Public method used to revert changes made to a file/directory.
vcsShutdown Public method used to shutdown the Mercurial interface.
vcsStatus Public method used to view the status of files/directories in the Mercurial repository.
vcsSwitch Public method used to switch a working directory to a different revision.
vcsTag Public method used to set the tag in the Mercurial repository.
vcsUpdate Public method used to update a file/directory with the Mercurial repository.

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

__hgURL(url)

Private method to format a url for Mercurial.

url
unformatted url string (string)
Returns:
properly formated url for subversion (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.

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

Hg.clearStatusCache

clearStatusCache()

Public method to clear the status cache.

Hg.getPlugin

getPlugin()

Public method to get a reference to the plugin object.

Returns:
reference to the plugin object (VcsMercurialPlugin)

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

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)

Public method to create a changegroup file.

name
file/directory name (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 successfull 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.hgEditConfig

hgEditConfig(name)

Public method used to edit the repository config file.

name
file/directory name (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.hgIdentify

hgIdentify(name)

Public method to identify the current working directory.

name
file/directory name (string)

Hg.hgIdentifyBundle

hgIdentifyBundle(name)

Public method used to identify a changegroup file.

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

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

hgLogBrowser(path)

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

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

Hg.hgLogLimited

hgLogLimited(name)

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

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

Hg.hgNormalizeURL

hgNormalizeURL(url)

Public method to normalize a url for Mercurial.

url
url string (string)
Returns:
properly normalized url for subversion (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.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)

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

name
directory name of the project to be pulled to (string)

Hg.hgPush

hgPush(name)

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

name
directory name of the project to be pushed from (string)

Hg.hgRecover

hgRecover(name)

Public method to recover an interrupted transaction.

name
file/directory name (string)

Hg.hgResolve

hgResolve(name)

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

name
file/directory name to be resolved (string)

Hg.hgShowBranch

hgShowBranch(name)

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

name
file/directory name (string)

Hg.hgShowConfig

hgShowConfig(name)

Public method to show the combined config.

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

hgUnbundle(name)

Public method to apply changegroup files.

name
directory name (string)

Hg.hgVerify

hgVerify(name)

Public method to verify the integrity of the repository.

name
file/directory name (string)

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)

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)

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

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 existance (boolean) and an error message (string)

Hg.vcsExport

vcsExport(vcsDataDict, projectDir)

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

vcsDataDict
dictionary of data required for the checkout
projectDir
project directory to create (string)
Returns:
flag indicating an execution without errors (boolean)

Hg.vcsGetProjectBrowserHelper

vcsGetProjectBrowserHelper(browser, project, isTranslationsBrowser = False)

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

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

Hg.vcsGetProjectHelper

vcsGetProjectHelper(project)

Public method to instanciate a helper object for the project.

project
reference to the project object
Returns:
the project helper object

Hg.vcsImport

vcsImport(vcsDataDict, projectDir, noDialog = False)

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

vcsDataDict
dictionary of data required for the import
projectDir
project directory (string)
noDialog
flag indicating quiet operations
Returns:
flag indicating an execution without errors (boolean) and a flag indicating the version controll status (boolean)

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

Hg.vcsMerge

vcsMerge(name)

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

name
file/directory name to be merged (string)

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)

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)

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

vcsRevert(name)

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

name
file/directory name to be reverted (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.vcsSwitch

vcsSwitch(name)

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

name
directory name to be switched (string)

Hg.vcsTag

vcsTag(name)

Public method used to set the tag in the Mercurial repository.

name
file/directory name to be tagged (string)

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