231 @param noDialog flag indicating quiet operations (boolean) |
231 @param noDialog flag indicating quiet operations (boolean) |
232 @return always TRUE |
232 @return always TRUE |
233 """ |
233 """ |
234 return True |
234 return True |
235 |
235 |
236 def vcsConvertProject(self, vcsDataDict, project): |
236 def vcsConvertProject(self, vcsDataDict, project, addAll=True): |
237 """ |
237 """ |
238 Public method to convert an uncontrolled project to a version |
238 Public method to convert an uncontrolled project to a version |
239 controlled project. |
239 controlled project. |
240 |
240 |
241 @param vcsDataDict dictionary of data required for the conversion |
241 @param vcsDataDict dictionary of data required for the conversion |
|
242 @type dict |
242 @param project reference to the project object |
243 @param project reference to the project object |
243 """ |
244 @type Project |
244 success = self.vcsImport(vcsDataDict, project.ppath)[0] |
245 @param addAll flag indicating to add all files to the repository |
|
246 @type bool |
|
247 """ |
|
248 success = self.vcsImport(vcsDataDict, project.ppath, addAll=addAll)[0] |
245 if not success: |
249 if not success: |
246 E5MessageBox.critical( |
250 E5MessageBox.critical( |
247 self.__ui, |
251 self.__ui, |
248 self.tr("Create project repository"), |
252 self.tr("Create project repository"), |
249 self.tr( |
253 self.tr( |
253 if not os.path.isfile(pfn): |
257 if not os.path.isfile(pfn): |
254 pfn += "z" |
258 pfn += "z" |
255 project.closeProject() |
259 project.closeProject() |
256 project.openProject(pfn) |
260 project.openProject(pfn) |
257 |
261 |
258 def vcsImport(self, vcsDataDict, projectDir, noDialog=False): |
262 def vcsImport(self, vcsDataDict, projectDir, noDialog=False, addAll=True): |
259 """ |
263 """ |
260 Public method used to import the project into the Git repository. |
264 Public method used to import the project into the Git repository. |
261 |
265 |
262 @param vcsDataDict dictionary of data required for the import |
266 @param vcsDataDict dictionary of data required for the import |
|
267 @type dict |
263 @param projectDir project directory (string) |
268 @param projectDir project directory (string) |
|
269 @type str |
264 @param noDialog flag indicating quiet operations |
270 @param noDialog flag indicating quiet operations |
265 @return flag indicating an execution without errors (boolean) |
271 @type bool |
266 and a flag indicating the version controll status (boolean) |
272 @param addAll flag indicating to add all files to the repository |
|
273 @type bool |
|
274 @return tuple containing a flag indicating an execution without errors |
|
275 and a flag indicating the version controll status |
|
276 @rtype tuple of (bool, bool) |
267 """ |
277 """ |
268 msg = vcsDataDict["message"] |
278 msg = vcsDataDict["message"] |
269 if not msg: |
279 if not msg: |
270 msg = '***' |
280 msg = '***' |
271 |
281 |
280 if status: |
290 if status: |
281 ignoreName = os.path.join(projectDir, Git.IgnoreFileName) |
291 ignoreName = os.path.join(projectDir, Git.IgnoreFileName) |
282 if not os.path.exists(ignoreName): |
292 if not os.path.exists(ignoreName): |
283 status = self.gitCreateIgnoreFile(projectDir) |
293 status = self.gitCreateIgnoreFile(projectDir) |
284 |
294 |
285 if status: |
295 if status and addAll: |
286 args = self.initCommand("add") |
296 args = self.initCommand("add") |
287 args.append("-v") |
297 args.append("-v") |
288 args.append(".") |
298 args.append(".") |
289 dia = GitDialog( |
299 dia = GitDialog( |
290 self.tr('Adding files to Git repository'), |
300 self.tr('Adding files to Git repository'), |