# eric6.Plugins.VcsPlugins.vcsMercurial.HgDiffGenerator

Module implementing a class to generate the output of the hg diff command.

### Global Attributes

None

### Classes

HgDiffGenerator | Class implementing the generation of output of the hg diff command.

### Functions

None

## HgDiffGenerator

Class implementing the generation of output of the hg diff command.

### Signals

finished()
  emitted when all processes have finished

### Derived from

QObject

### Class Attributes

None

### Class Methods

None

### Methods

HgDiffGenerator | Constructor
__extractFileName | Private method to extract the file name out of a file separator line.
__finish | Private slot called when the process finished or the user pressed the button.
__getVersionArg | Private method to get a hg revision argument for the given revision.
__processFileLine | Private slot to process a line giving the old/new file.
__processOutputLine | Private method to process the lines of output.
getResult | Public method to return the result data.
start | Public slot to start the hg diff command.
stopProcess | Public slot to stop the diff process.

### Static Methods

None

#### HgDiffGenerator (Constructor)

HgDiffGenerator(vcs, parent=None)

Constructor

vcs
  reference to the vcs object
parent
  parent widget (QWidget)

#### HgDiffGenerator.__extractFileName

__extractFileName(line)

Private method to extract the file name out of a file separator line.

line
  line to be processed (string)

Returns:
  extracted file name (string)

#### HgDiffGenerator.__finish

__finish()

Private slot called when the process finished or the user pressed the button.

#### HgDiffGenerator.__getVersionArg

__getVersionArg(version)

Private method to get a hg revision argument for the given revision.

version
  revision (integer or string)

Returns:
  version argument (string)

#### HgDiffGenerator.__processFileLine

__processFileLine(line)

Private slot to process a line giving the old/new file.

line
  line to be processed (string)

#### HgDiffGenerator.__processOutputLine

__processOutputLine(line)

Private method to process the lines of output.

line
  output line to be processed (string)

#### HgDiffGenerator.getResult

getResult()

Public method to return the result data.

Returns:
  tuple of lists of string containing lines of the diff, the list of errors and a list of tuples of filenames and the line into the diff output.

#### HgDiffGenerator.start

start(fn, versions=None, bundle=None, qdiff=False)

Public slot to start the hg diff command.

fn
  filename to be diffed (string)
versions=
  list of versions to be diffed (list of up to 2 strings or None)
bundle=
  name of a bundle file (string)
qdiff=
  flag indicating qdiff command shall be used (boolean)

Returns:
  flag indicating a successful start of the diff command (boolean)

#### HgDiffGenerator.stopProcess

stopProcess()

Public slot to stop the diff process.

Up