15 |
15 |
16 class HgCloseHeadSelectionDialog(QDialog, Ui_HgCloseHeadSelectionDialog): |
16 class HgCloseHeadSelectionDialog(QDialog, Ui_HgCloseHeadSelectionDialog): |
17 """ |
17 """ |
18 Class implementing a dialog to select the heads to be closed. |
18 Class implementing a dialog to select the heads to be closed. |
19 """ |
19 """ |
20 def __init__(self, vcs, ppath, parent=None): |
20 def __init__(self, vcs, parent=None): |
21 """ |
21 """ |
22 Constructor |
22 Constructor |
23 |
23 |
24 @param vcs reference to the VCS object |
24 @param vcs reference to the VCS object |
25 @type Hg |
25 @type Hg |
26 @param ppath directory containing the repository |
|
27 @type str |
|
28 @param parent reference to the parent widget |
26 @param parent reference to the parent widget |
29 @type QWidget |
27 @type QWidget |
30 """ |
28 """ |
31 super(HgCloseHeadSelectionDialog, self).__init__(parent) |
29 super(HgCloseHeadSelectionDialog, self).__init__(parent) |
32 self.setupUi(self) |
30 self.setupUi(self) |
33 |
31 |
34 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) |
32 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) |
35 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False) |
33 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False) |
36 |
34 |
37 heads = self.__getHeads(vcs, ppath) |
35 heads = self.__getHeads(vcs) |
38 for revision, branch in heads: |
36 for revision, branch in heads: |
39 QTreeWidgetItem(self.headsList, [revision, branch]) |
37 QTreeWidgetItem(self.headsList, [revision, branch]) |
40 |
38 |
41 def __getHeads(self, vcs, ppath): |
39 def __getHeads(self, vcs): |
42 """ |
40 """ |
43 Private method to get the open heads. |
41 Private method to get the open heads. |
44 |
42 |
45 @param vcs reference to the VCS object |
43 @param vcs reference to the VCS object |
46 @type Hg |
44 @type Hg |
47 @param ppath directory containing the repository |
|
48 @type str |
|
49 @return list of tuples containing the revision and the corresponding |
45 @return list of tuples containing the revision and the corresponding |
50 branch name |
46 branch name |
51 @rtype list of tuples of (str, str) |
47 @rtype list of tuples of (str, str) |
52 """ |
48 """ |
53 args = vcs.initCommand("heads") |
49 args = vcs.initCommand("heads") |