59 """ one is kept as a backup.</p>""" |
61 """ one is kept as a backup.</p>""" |
60 )) |
62 )) |
61 self.hgConvertToNormalAct.triggered[()].connect( |
63 self.hgConvertToNormalAct.triggered[()].connect( |
62 lambda: self.__hgLfconvert("normal")) |
64 lambda: self.__hgLfconvert("normal")) |
63 self.actions.append(self.hgConvertToNormalAct) |
65 self.actions.append(self.hgConvertToNormalAct) |
|
66 |
|
67 self.hgLfPullAct = E5Action( |
|
68 self.tr('Pull Large Files'), |
|
69 UI.PixmapCache.getIcon("vcsUpdate.png"), |
|
70 self.tr('Pull Large Files'), |
|
71 0, 0, self, 'mercurial_pull_largefiles') |
|
72 self.hgLfPullAct.setStatusTip(self.tr( |
|
73 'Pull large files from a remote repository' |
|
74 )) |
|
75 self.hgLfPullAct.setWhatsThis(self.tr( |
|
76 """<b>Pull Large Files</b>""" |
|
77 """<p>This pulls missing large files from a remote repository""" |
|
78 """ into the local repository.</p>""" |
|
79 )) |
|
80 self.hgLfPullAct.triggered[()].connect(self.__hgLfPull) |
|
81 self.actions.append(self.hgLfPullAct) |
|
82 |
|
83 self.hgLfSummaryAct = E5Action( |
|
84 self.tr('Show Summary'), |
|
85 UI.PixmapCache.getIcon("vcsSummary.png"), |
|
86 self.tr('Show summary...'), |
|
87 0, 0, self, 'mercurial_summary_largefiles') |
|
88 self.hgLfSummaryAct.setStatusTip(self.tr( |
|
89 'Show summary information of the working directory status' |
|
90 )) |
|
91 self.hgLfSummaryAct.setWhatsThis(self.tr( |
|
92 """<b>Show summary</b>""" |
|
93 """<p>This shows some summary information of the working""" |
|
94 """ directory status.</p>""" |
|
95 )) |
|
96 self.hgLfSummaryAct.triggered[()].connect(self.__hgLfSummary) |
|
97 self.actions.append(self.hgLfSummaryAct) |
|
98 |
|
99 self.hgVerifyLargeAct = E5Action( |
|
100 self.tr('Verify large files of current revision'), |
|
101 self.tr('Verify large files of current revision...'), |
|
102 0, 0, self, 'mercurial_verify_large') |
|
103 self.hgVerifyLargeAct.setStatusTip(self.tr( |
|
104 'Verify that all large files in the current revision exist' |
|
105 )) |
|
106 self.hgVerifyLargeAct.setWhatsThis(self.tr( |
|
107 """<b>Verify large files of current revision</b>""" |
|
108 """<p>This verifies that all large files in the current""" |
|
109 """ revision exist.</p>""" |
|
110 )) |
|
111 self.hgVerifyLargeAct.triggered[()].connect( |
|
112 lambda: self.__hgLfVerify("large")) |
|
113 self.actions.append(self.hgVerifyLargeAct) |
|
114 |
|
115 self.hgVerifyLfaAct = E5Action( |
|
116 self.tr('Verify large files of all revision'), |
|
117 self.tr('Verify large files of all revision...'), |
|
118 0, 0, self, 'mercurial_verify_lfa') |
|
119 self.hgVerifyLfaAct.setStatusTip(self.tr( |
|
120 'Verify that all large files in all revisions exist' |
|
121 )) |
|
122 self.hgVerifyLfaAct.setWhatsThis(self.tr( |
|
123 """<b>Verify large files of all revision</b>""" |
|
124 """<p>This verifies that all large files in all""" |
|
125 """ revisions exist.</p>""" |
|
126 )) |
|
127 self.hgVerifyLfaAct.triggered[()].connect( |
|
128 lambda: self.__hgLfVerify("lfa")) |
|
129 self.actions.append(self.hgVerifyLfaAct) |
|
130 |
|
131 self.hgVerifyLfcAct = E5Action( |
|
132 self.tr('Verify large files contents'), |
|
133 self.tr('Verify large files contents...'), |
|
134 0, 0, self, 'mercurial_verify_lfc') |
|
135 self.hgVerifyLfcAct.setStatusTip(self.tr( |
|
136 'Verify the contents of all large files' |
|
137 )) |
|
138 self.hgVerifyLfcAct.setWhatsThis(self.tr( |
|
139 """<b>Verify large files contents</b>""" |
|
140 """<p>This verifies the contents of all large files.</p>""" |
|
141 )) |
|
142 self.hgVerifyLfcAct.triggered[()].connect( |
|
143 lambda: self.__hgLfVerify("lfc")) |
|
144 self.actions.append(self.hgVerifyLfcAct) |
64 |
145 |
65 def initMenu(self, mainMenu): |
146 def initMenu(self, mainMenu): |
66 """ |
147 """ |
67 Public method to generate the extension menu. |
148 Public method to generate the extension menu. |
68 |
149 |
70 @return populated menu (QMenu) |
151 @return populated menu (QMenu) |
71 """ |
152 """ |
72 menu = QMenu(self.menuTitle(), mainMenu) |
153 menu = QMenu(self.menuTitle(), mainMenu) |
73 menu.setTearOffEnabled(True) |
154 menu.setTearOffEnabled(True) |
74 |
155 |
|
156 self.__adminMenu = QMenu(self.tr("Administration"), menu) |
|
157 self.__adminMenu.setTearOffEnabled(True) |
|
158 self.__adminMenu.addAction(self.hgVerifyLargeAct) |
|
159 self.__adminMenu.addAction(self.hgVerifyLfaAct) |
|
160 self.__adminMenu.addAction(self.hgVerifyLfcAct) |
|
161 |
75 menu.addAction(self.hgConvertToLargefilesAct) |
162 menu.addAction(self.hgConvertToLargefilesAct) |
76 menu.addAction(self.hgConvertToNormalAct) |
163 menu.addAction(self.hgConvertToNormalAct) |
|
164 menu.addSeparator() |
|
165 menu.addAction(self.hgLfPullAct) |
|
166 menu.addSeparator() |
|
167 menu.addAction(self.hgLfSummaryAct) |
|
168 menu.addSeparator() |
|
169 menu.addMenu(self.__adminMenu) |
77 |
170 |
78 return menu |
171 return menu |
79 |
172 |
80 def menuTitle(self): |
173 def menuTitle(self): |
81 """ |
174 """ |
83 |
176 |
84 @return title of the menu (string) |
177 @return title of the menu (string) |
85 """ |
178 """ |
86 return self.tr("Large Files") |
179 return self.tr("Large Files") |
87 |
180 |
|
181 def shutdown(self): |
|
182 """ |
|
183 Public method to perform shutdown actions. |
|
184 |
|
185 Note: Derived class may implement this method if needed. |
|
186 """ |
|
187 if self.__adminMenu.isTearOffMenuVisible(): |
|
188 self.__adminMenu.hideTearOffMenu() |
|
189 |
88 def __hgLfconvert(self, direction): |
190 def __hgLfconvert(self, direction): |
89 """ |
191 """ |
90 Private slot to convert the repository format of the current project. |
192 Private slot to convert the repository format of the current project. |
91 |
193 |
92 @param direction direction of the conversion (string, one of |
194 @param direction direction of the conversion (string; one of |
93 'largefiles' or 'normal') |
195 'largefiles' or 'normal') |
94 """ |
196 """ |
95 assert direction in ["largefiles", "normal"] |
197 assert direction in ["largefiles", "normal"] |
96 |
198 |
97 self.vcs.getExtensionObject("largefiles").hgLfconvert( |
199 self.vcs.getExtensionObject("largefiles").hgLfconvert( |
98 direction, self.project.getProjectFile()) |
200 direction, self.project.getProjectFile()) |
|
201 |
|
202 def __hgLfPull(self): |
|
203 """ |
|
204 Private slot to pull missing large files into the local repository. |
|
205 """ |
|
206 self.vcs.getExtensionObject("largefiles").hgLfPull( |
|
207 self.project.getProjectPath()) |
|
208 |
|
209 def __hgLfSummary(self): |
|
210 """ |
|
211 Private slot to show a working directory summary. |
|
212 """ |
|
213 self.vcs.hgSummary(largefiles=True) |
|
214 |
|
215 def __hgLfVerify(self, mode): |
|
216 """ |
|
217 Private slot to verify large files integrity. |
|
218 |
|
219 @param mode verify mode (string; one of 'large', 'lfa' or 'lfc') |
|
220 """ |
|
221 assert mode in ['large', 'lfa', 'lfc'] |
|
222 |
|
223 self.vcs.getExtensionObject("largefiles").hgLfVerify( |
|
224 self.project.getProjectPath(), mode) |