# eric6.Plugins.VcsPlugins.vcsGit.GitLogBrowserDialog

Module implementing a dialog to browse the log history.

### Global Attributes

COLORNAMES
COLORS

### Classes

GitLogBrowserDialog | Class implementing a dialog to browse the log history.

### Functions

None

## GitLogBrowserDialog

Class implementing a dialog to browse the log history.

### Derived from

QWidget, Ui_GitLogBrowserDialog

### Class Attributes

AuthorColumn
BranchColumn
CommitDateColumn
CommitIdColumn
CommitterColumn
DateColumn
IconColumn
SubjectColumn
TagsColumn

### Class Methods

None

### Methods

GitLogBrowserDialog | Constructor
__actionMode | Private method to get the selected action mode.
__actionsMenuHovered | Private slot to show the tooltip for an action menu entry.
__addFinishCallback | Private method to add a method to be called once the process finished.
__branchActTriggered | Private slot to create a new branch starting at the selected commit.
__branchSwitchActTriggered | Private slot to create a new branch starting at the selected commit and switch the work tree to it.
__cherryActTriggered | Private slot to handle the Copy Commits action.
__commitIdClicked | Private slot to handle the anchorClicked signal of the changeset details pane.
__describeActTriggered | Private slot to show the most recent tag reachable from a commit.
__filterLogs | Private method to filter the log entries.
__findItem | Private slot to find an item matching the entered criteria.
__finish | Private slot called when the process finished or the user pressed the button.
__generateDetailsTableText | Private method to generate an HTML table with the details of the given changeset.
__generateDiffs | Private slot to generate diff outputs for the selected item.
__generateEdges | Private method to generate edge info for the give data.
__generateFileItem | Private method to generate a changed files tree entry.
__generateIcon | Private method to generate an icon containing the revision tree for the given data.
__generateLogItem | Private method to generate a log tree entry.
__generatorFinished | Private slot connected to the finished signal of the diff generator.
__getBranchesForCommit | Private method to get all branches reachable from a commit ID.
__getColor | Private method to get the (rotating) name of the color given an index.
__getCommitForTag | Private method to get the commit id for a tag.
__getLogEntries | Private method to retrieve log entries from the repository.
__getTagsForCommit | Private method to get all tags reachable from a commit ID.
__identifyProject | Private method to determine the revision of the project directory.
__initActionsMenu | Private method to initialize the actions menu.
__initData | Private method to (re-)initialize some data.
__initLogTreeContextMenu | Private method to initialize the log tree context menu.
__mergeFileSeparators | Private method to merge the file separator entries.
__prepareFieldSearch | Private slot to prepare the filed search data.
__procFinished | Private slot connected to the finished signal.
__processBuffer | Private method to process the buffered output of the git log command.
__processBufferItem | Private method to process a log entry.
__readStderr | Private slot to handle the readyReadStandardError signal.
__readStdout | Private slot to handle the readyReadStandardOutput signal.
__reloadGeometry | Private method to restore the geometry.
__resetUI | Private method to reset the user interface.
__resizeColumnsFiles | Private method to resize the changed files tree columns.
__resizeColumnsLog | Private method to resize the log tree columns.
__resortFiles | Private method to resort the changed files tree.
__restoreSplitterStates | Private method to restore the state of the various splitters.
__shortlogActTriggered | Private slot to show a short log suitable for release announcements.
__showAuthorColumns | Private slot to show/hide the committer columns.
__showBranchesColumn | Private slot to show/hide the branches column.
__showCommitIdColumn | Private slot to show/hide the commit ID column.
__showCommitterColumns | Private slot to show/hide the committer columns.
__showError | Private slot to show some error.
__showTagsColumn | Private slot to show/hide the tags column.
__switchActTriggered | Private slot to switch the working directory to the selected commit.
__tagActTriggered | Private slot to tag the selected commit.
__updateDetailsAndFiles | Private slot to update the details and file changes panes.
__updateFilesTree | Private method to update the files tree with changes of the given item.
__updateSbsSelectLabel | Private slot to update the enabled status of the diff buttons.
__updateToolMenuActions | Private slot to update the status of the tool menu actions and the tool menu button.
closeEvent | Protected slot implementing a close event handler.
col2x | Local function to calculate a x-position for a column.
keyPressEvent | Protected slot to handle a key press event.
on_buttonBox_clicked | Private slot called by a button of the button box clicked.
on_diffSelectLabel_linkActivated | Private slot to handle the selection of a diff target.
on_downButton_clicked | Private slot to move the current item down one entry.
on_fieldCombo_activated | Private slot called, when a new filter field is selected.
on_filesTree_currentItemChanged | Private slot called, when the current item of the files tree changes.
on_findNextButton_clicked | Private slot to find the next item matching the entered criteria.
on_findPrevButton_clicked | Private slot to find the previous item matching the entered criteria.
on_fromDate_dateChanged | Private slot called, when the from date changes.
on_input_returnPressed | Private slot to handle the press of the return key in the input field.
on_logTree_currentItemChanged | Private slot called, when the current item of the log tree changes.
on_logTree_customContextMenuRequested | Private slot to show the context menu of the log tree.
on_logTree_itemSelectionChanged | Private slot called, when the selection has changed.
on_modeComboBox_currentIndexChanged | Private slot to react on mode changes.
on_nextButton_clicked | Private slot to handle the Next button.
on_passwordCheckBox_toggled | Private slot to handle the password checkbox toggled.
on_refreshButton_clicked | Private slot to refresh the log.
on_rxEdit_returnPressed | Private slot handling a press of the Return key in the rxEdit input.
on_rxEdit_textChanged | Private slot called, when a filter expression is entered.
on_saveLabel_linkActivated | Private slot to handle the selection of the save link.
on_sbsSelectLabel_linkActivated | Private slot to handle selection of a side-by-side link.
on_sendButton_clicked | Private slot to send the input to the git process.
on_stopCheckBox_clicked | Private slot called, when the stop on copy/move checkbox is clicked.
on_toDate_dateChanged | Private slot called, when the from date changes.
on_upButton_clicked | Private slot to move the current item up one entry.
show | Public slot to show the dialog.
start | Public slot to start the git log command.

### Static Methods

None

#### GitLogBrowserDialog (Constructor)

GitLogBrowserDialog(vcs, parent=None)

Constructor

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

#### GitLogBrowserDialog.__actionMode

__actionMode()

Private method to get the selected action mode.

Returns:
  selected action mode (string, one of filter or find)

#### GitLogBrowserDialog.__actionsMenuHovered

__actionsMenuHovered(action)

Private slot to show the tooltip for an action menu entry.

action (QAction)
  action to show tooltip for

#### GitLogBrowserDialog.__addFinishCallback

__addFinishCallback(callback)

Private method to add a method to be called once the process finished.

The callback methods are invoke in a FIFO style and are consumed. If a callback method needs to be called again, it must be added again.

callback (function)
  callback method

#### GitLogBrowserDialog.__branchActTriggered

__branchActTriggered()

Private slot to create a new branch starting at the selected commit.

#### GitLogBrowserDialog.__branchSwitchActTriggered

__branchSwitchActTriggered()

Private slot to create a new branch starting at the selected commit and switch the work tree to it.

#### GitLogBrowserDialog.__cherryActTriggered

__cherryActTriggered()

Private slot to handle the Copy Commits action.

#### GitLogBrowserDialog.__commitIdClicked

__commitIdClicked(url)

Private slot to handle the anchorClicked signal of the changeset details pane.

url (QUrl)
  URL that was clicked

#### GitLogBrowserDialog.__describeActTriggered

__describeActTriggered()

Private slot to show the most recent tag reachable from a commit.

#### GitLogBrowserDialog.__filterLogs

__filterLogs()

Private method to filter the log entries.

#### GitLogBrowserDialog.__findItem

__findItem(backwards=False, interactive=False)

Private slot to find an item matching the entered criteria.

backwards
  flag indicating to search backwards (boolean)
interactive
  flag indicating an interactive search (boolean)

#### GitLogBrowserDialog.__finish

__finish()

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

#### GitLogBrowserDialog.__generateDetailsTableText

__generateDetailsTableText(itm)

Private method to generate an HTML table with the details of the given changeset.

itm (QTreeWidgetItem)
  reference to the item the table should be based on

Returns:
  HTML table containing details

Return Type:
  str

#### GitLogBrowserDialog.__generateDiffs

__generateDiffs(parent=1)

Private slot to generate diff outputs for the selected item.

parent (int)
  number of parent to diff against

#### GitLogBrowserDialog.__generateEdges

__generateEdges(commitId, parents)

Private method to generate edge info for the give data.

commitId
  commit id to calculate edge info for (string)
parents
  list of parent commits (list of strings)

Returns:
  tuple containing the column and color index for the given node and a list of tuples indicating the edges between the given node and its parents (integer, integer, [(integer, integer, integer), ...])

#### GitLogBrowserDialog.__generateFileItem

__generateFileItem(action, path, copyfrom, additions, deletions)

Private method to generate a changed files tree entry.

action
  indicator for the change action ("A", "C", "D", "M", "R", "T", "U", "X")
path
  path of the file in the repository (string)
copyfrom
  path the file was copied from (string)
additions
  number of added lines (int)
deletions
  number of deleted lines (int)

Returns:
  reference to the generated item (QTreeWidgetItem)

#### GitLogBrowserDialog.__generateIcon

__generateIcon(column, color, bottomedges, topedges, dotColor, currentCommit)

Private method to generate an icon containing the revision tree for the given data.

column
  column index of the revision (integer)
color
  color of the node (integer)
bottomedges
  list of edges for the bottom of the node (list of tuples of three integers)
topedges
  list of edges for the top of the node (list of tuples of three integers)
dotColor
  color to be used for the dot (QColor)
currentCommit
  flag indicating to draw the icon for the current commit (boolean)

Returns:
  icon for the node (QIcon)

#### GitLogBrowserDialog.__generateLogItem

__generateLogItem(author, date, committer, commitDate, subject, message, commitId, changedPaths, parents, refnames, authorMail, committerMail)

Private method to generate a log tree entry.

author
  author info (string)
date
  date info (string)
committer
  committer info (string)
commitDate
  commit date info (string)
subject
  subject of the log entry (string)
message
  text of the log message (list of strings)
commitId
  commit id info (string)
changedPaths
  list of dictionary objects containing info about the changed files/directories
parents
  list of parent revisions (list of integers)
refnames
  tags and branches of the commit (string)
authorMail
  author's email address (string)
committerMail
  committer's email address (string)

Returns:
  reference to the generated item (QTreeWidgetItem)

#### GitLogBrowserDialog.__generatorFinished

__generatorFinished()

Private slot connected to the finished signal of the diff generator.

#### GitLogBrowserDialog.__getBranchesForCommit

__getBranchesForCommit(commitId)

Private method to get all branches reachable from a commit ID.

commitId (str)
  commit ID to get the branches for

Returns:
  list of tuples containing the branch name and the associated commit ID of its branch head

Return Type:
  tuple of (str, str)

#### GitLogBrowserDialog.__getColor

__getColor(n)

Private method to get the (rotating) name of the color given an index.

n
  color index (integer)

Returns:
  color name (string)

#### GitLogBrowserDialog.__getCommitForTag

__getCommitForTag(tag)

Private method to get the commit id for a tag.

tag
  tag name (string)

Returns:
  commit id shortened to 10 characters (string)

#### GitLogBrowserDialog.__getLogEntries

__getLogEntries(skip=0, noEntries=0)

Private method to retrieve log entries from the repository.

skip
  number of log entries to skip (integer)
noEntries=
  number of entries to get (0 = default) (int)

#### GitLogBrowserDialog.__getTagsForCommit

__getTagsForCommit(commitId)

Private method to get all tags reachable from a commit ID.

commitId (str)
  commit ID to get the tags for

Returns:
  list of tuples containing the tag name and the associated commit ID

Return Type:
  tuple of (str, str)

#### GitLogBrowserDialog.__identifyProject

__identifyProject()

Private method to determine the revision of the project directory.

#### GitLogBrowserDialog.__initActionsMenu

__initActionsMenu()

Private method to initialize the actions menu.

#### GitLogBrowserDialog.__initData

__initData()

Private method to (re-)initialize some data.

#### GitLogBrowserDialog.__initLogTreeContextMenu

__initLogTreeContextMenu()

Private method to initialize the log tree context menu.

#### GitLogBrowserDialog.__mergeFileSeparators

__mergeFileSeparators(fileSeparators)

Private method to merge the file separator entries.

fileSeparators
  list of file separator entries to be merged

Returns:
  merged list of file separator entries

#### GitLogBrowserDialog.__prepareFieldSearch

__prepareFieldSearch()

Private slot to prepare the filed search data.

Returns:
  tuple of field index, search expression and flag indicating that the field index is a data role (integer, string, boolean)

#### GitLogBrowserDialog.__procFinished

__procFinished(exitCode, exitStatus)

Private slot connected to the finished signal.

exitCode
  exit code of the process (integer)
exitStatus
  exit status of the process (QProcess.ExitStatus)

#### GitLogBrowserDialog.__processBuffer

__processBuffer()

Private method to process the buffered output of the git log command.

#### GitLogBrowserDialog.__processBufferItem

__processBufferItem(logEntry)

Private method to process a log entry.

logEntry
  dictionary as generated by __processBuffer

#### GitLogBrowserDialog.__readStderr

__readStderr()

Private slot to handle the readyReadStandardError signal.

It reads the error output of the process and inserts it into the error pane.

#### GitLogBrowserDialog.__readStdout

__readStdout()

Private slot to handle the readyReadStandardOutput signal.

It reads the output of the process and inserts it into a buffer.

#### GitLogBrowserDialog.__reloadGeometry

__reloadGeometry()

Private method to restore the geometry.

#### GitLogBrowserDialog.__resetUI

__resetUI()

Private method to reset the user interface.

#### GitLogBrowserDialog.__resizeColumnsFiles

__resizeColumnsFiles()

Private method to resize the changed files tree columns.

#### GitLogBrowserDialog.__resizeColumnsLog

__resizeColumnsLog()

Private method to resize the log tree columns.

#### GitLogBrowserDialog.__resortFiles

__resortFiles()

Private method to resort the changed files tree.

#### GitLogBrowserDialog.__restoreSplitterStates

__restoreSplitterStates()

Private method to restore the state of the various splitters.

#### GitLogBrowserDialog.__shortlogActTriggered

__shortlogActTriggered()

Private slot to show a short log suitable for release announcements.

#### GitLogBrowserDialog.__showAuthorColumns

__showAuthorColumns(on)

Private slot to show/hide the committer columns.

on
  flag indicating the selection state (boolean)

#### GitLogBrowserDialog.__showBranchesColumn

__showBranchesColumn(on)

Private slot to show/hide the branches column.

on
  flag indicating the selection state (boolean)

#### GitLogBrowserDialog.__showCommitIdColumn

__showCommitIdColumn(on)

Private slot to show/hide the commit ID column.

on
  flag indicating the selection state (boolean)

#### GitLogBrowserDialog.__showCommitterColumns

__showCommitterColumns(on)

Private slot to show/hide the committer columns.

on
  flag indicating the selection state (boolean)

#### GitLogBrowserDialog.__showError

__showError(out)

Private slot to show some error.

out
  error to be shown (string)

#### GitLogBrowserDialog.__showTagsColumn

__showTagsColumn(on)

Private slot to show/hide the tags column.

on
  flag indicating the selection state (boolean)

#### GitLogBrowserDialog.__switchActTriggered

__switchActTriggered()

Private slot to switch the working directory to the selected commit.

#### GitLogBrowserDialog.__tagActTriggered

__tagActTriggered()

Private slot to tag the selected commit.

#### GitLogBrowserDialog.__updateDetailsAndFiles

__updateDetailsAndFiles()

Private slot to update the details and file changes panes.

#### GitLogBrowserDialog.__updateFilesTree

__updateFilesTree(parent, itm)

Private method to update the files tree with changes of the given item.

parent (QTreeWidget or QTreeWidgetItem)
  parent for the items to be added
itm (QTreeWidgetItem)
  reference to the item the update should be based on

#### GitLogBrowserDialog.__updateSbsSelectLabel

__updateSbsSelectLabel()

Private slot to update the enabled status of the diff buttons.

#### GitLogBrowserDialog.__updateToolMenuActions

__updateToolMenuActions()

Private slot to update the status of the tool menu actions and the tool menu button.

#### GitLogBrowserDialog.closeEvent

closeEvent(e)

Protected slot implementing a close event handler.

e
  close event (QCloseEvent)

#### GitLogBrowserDialog.col2x

col2x(radius)

Local function to calculate a x-position for a column.

col
  column number (integer)
radius
  radius of the indicator circle (integer)

#### GitLogBrowserDialog.keyPressEvent

keyPressEvent(evt)

Protected slot to handle a key press event.

evt
  the key press event (QKeyEvent)

#### GitLogBrowserDialog.on_buttonBox_clicked

on_buttonBox_clicked(button)

Private slot called by a button of the button box clicked.

button
  button that was clicked (QAbstractButton)

#### GitLogBrowserDialog.on_diffSelectLabel_linkActivated

on_diffSelectLabel_linkActivated(link)

Private slot to handle the selection of a diff target.

link (str)
  activated link

#### GitLogBrowserDialog.on_downButton_clicked

on_downButton_clicked()

Private slot to move the current item down one entry.

#### GitLogBrowserDialog.on_fieldCombo_activated

on_fieldCombo_activated(txt)

Private slot called, when a new filter field is selected.

txt
  text of the selected field (string)

#### GitLogBrowserDialog.on_filesTree_currentItemChanged

on_filesTree_currentItemChanged(current, previous)

Private slot called, when the current item of the files tree changes.

current
  reference to the new current item (QTreeWidgetItem)
previous
  reference to the old current item (QTreeWidgetItem)

#### GitLogBrowserDialog.on_findNextButton_clicked

on_findNextButton_clicked()

Private slot to find the next item matching the entered criteria.

#### GitLogBrowserDialog.on_findPrevButton_clicked

on_findPrevButton_clicked()

Private slot to find the previous item matching the entered criteria.

#### GitLogBrowserDialog.on_fromDate_dateChanged

on_fromDate_dateChanged(date)

Private slot called, when the from date changes.

date
  new date (QDate)

#### GitLogBrowserDialog.on_input_returnPressed

on_input_returnPressed()

Private slot to handle the press of the return key in the input field.

#### GitLogBrowserDialog.on_logTree_currentItemChanged

on_logTree_currentItemChanged(current, previous)

Private slot called, when the current item of the log tree changes.

current
  reference to the new current item (QTreeWidgetItem)
previous
  reference to the old current item (QTreeWidgetItem)

#### GitLogBrowserDialog.on_logTree_customContextMenuRequested

on_logTree_customContextMenuRequested(pos)

Private slot to show the context menu of the log tree.

pos
  position of the mouse pointer (QPoint)

#### GitLogBrowserDialog.on_logTree_itemSelectionChanged

on_logTree_itemSelectionChanged()

Private slot called, when the selection has changed.

#### GitLogBrowserDialog.on_modeComboBox_currentIndexChanged

on_modeComboBox_currentIndexChanged(index)

Private slot to react on mode changes.

index
  index of the selected entry (integer)

#### GitLogBrowserDialog.on_nextButton_clicked

on_nextButton_clicked()

Private slot to handle the Next button.

#### GitLogBrowserDialog.on_passwordCheckBox_toggled

on_passwordCheckBox_toggled(isOn)

Private slot to handle the password checkbox toggled.

isOn
  flag indicating the status of the check box (boolean)

#### GitLogBrowserDialog.on_refreshButton_clicked

on_refreshButton_clicked()

Private slot to refresh the log.

#### GitLogBrowserDialog.on_rxEdit_returnPressed

on_rxEdit_returnPressed()

Private slot handling a press of the Return key in the rxEdit input.

#### GitLogBrowserDialog.on_rxEdit_textChanged

on_rxEdit_textChanged(txt)

Private slot called, when a filter expression is entered.

txt
  filter expression (string)

#### GitLogBrowserDialog.on_saveLabel_linkActivated

on_saveLabel_linkActivated(link)

Private slot to handle the selection of the save link.

link (str)
  activated link

#### GitLogBrowserDialog.on_sbsSelectLabel_linkActivated

on_sbsSelectLabel_linkActivated(link)

Private slot to handle selection of a side-by-side link.

link (str)
  text of the selected link

#### GitLogBrowserDialog.on_sendButton_clicked

on_sendButton_clicked()

Private slot to send the input to the git process.

#### GitLogBrowserDialog.on_stopCheckBox_clicked

on_stopCheckBox_clicked(checked)

Private slot called, when the stop on copy/move checkbox is clicked.

checked
  flag indicating the state of the check box (boolean)

#### GitLogBrowserDialog.on_toDate_dateChanged

on_toDate_dateChanged(date)

Private slot called, when the from date changes.

date
  new date (QDate)

#### GitLogBrowserDialog.on_upButton_clicked

on_upButton_clicked()

Private slot to move the current item up one entry.

#### GitLogBrowserDialog.show

show()

Public slot to show the dialog.

#### GitLogBrowserDialog.start

start(fn, isFile=False, noEntries=0)

Public slot to start the git log command.

fn
  filename to show the log for (string)
isFile=
  flag indicating log for a file is to be shown (boolean)
noEntries=
  number of entries to get (0 = default) (int)

Up