Plugins/VcsPlugins/vcsMercurial/HgLogDialog.py

changeset 2841
1f79e88f18b7
parent 2838
0f1423054184
child 2847
1843ef6e2656
child 2848
15c84f1f745a
equal deleted inserted replaced
2840:10a133f3a5e8 2841:1f79e88f18b7
27 Class implementing a dialog to show the output of the hg log command process. 27 Class implementing a dialog to show the output of the hg log command process.
28 28
29 The dialog is nonmodal. Clicking a link in the upper text pane shows 29 The dialog is nonmodal. Clicking a link in the upper text pane shows
30 a diff of the revisions. 30 a diff of the revisions.
31 """ 31 """
32 def __init__(self, vcs, mode="log", bundle=None, parent=None): 32 def __init__(self, vcs, mode="log", bundle=None, isFile=False, parent=None):
33 """ 33 """
34 Constructor 34 Constructor
35 35
36 @param vcs reference to the vcs object 36 @param vcs reference to the vcs object
37 @param mode mode of the dialog (string; one of log, incoming, outgoing) 37 @param mode mode of the dialog (string; one of log, incoming, outgoing)
38 @param bundle name of a bundle file (string) 38 @param bundle name of a bundle file (string)
39 @param isFile flag indicating log for a file is to be shown (boolean)
39 @param parent parent widget (QWidget) 40 @param parent parent widget (QWidget)
40 """ 41 """
41 super().__init__(parent) 42 super().__init__(parent)
42 self.setupUi(self) 43 self.setupUi(self)
43 44
70 self.fileCopies = {} 71 self.fileCopies = {}
71 self.endInitialText = False 72 self.endInitialText = False
72 self.initialText = [] 73 self.initialText = []
73 74
74 self.diff = None 75 self.diff = None
76
77 self.sbsCheckBox.setEnabled(isFile)
75 78
76 def closeEvent(self, e): 79 def closeEvent(self, e):
77 """ 80 """
78 Private slot implementing a close event handler. 81 Private slot implementing a close event handler.
79 82
441 v1, v2 = ver.split('_') 444 v1, v2 = ver.split('_')
442 if v1 == "" or v2 == "": 445 if v1 == "" or v2 == "":
443 return 446 return
444 self.contents.scrollToAnchor(ver) 447 self.contents.scrollToAnchor(ver)
445 448
446 # TODO: add SBS option (file mode only) 449 if self.sbsCheckBox.isEnabled() and self.sbsCheckBox.isChecked():
447 if self.diff is None: 450 self.vcs.hgSbsDiff(filename, revisions=(v1, v2))
448 from .HgDiffDialog import HgDiffDialog 451 else:
449 self.diff = HgDiffDialog(self.vcs) 452 if self.diff is None:
450 self.diff.show() 453 from .HgDiffDialog import HgDiffDialog
451 self.diff.start(filename, [v1, v2], self.bundle) 454 self.diff = HgDiffDialog(self.vcs)
455 self.diff.show()
456 self.diff.start(filename, [v1, v2], self.bundle)
452 457
453 def on_passwordCheckBox_toggled(self, isOn): 458 def on_passwordCheckBox_toggled(self, isOn):
454 """ 459 """
455 Private slot to handle the password checkbox toggled. 460 Private slot to handle the password checkbox toggled.
456 461

eric ide

mercurial