eric6/Plugins/VcsPlugins/vcsMercurial/hg.py

changeset 7167
b3557e77314a
parent 7155
334c7d0b5036
child 7192
a22eee00b052
equal deleted inserted replaced
7166:5a184952ba77 7167:b3557e77314a
271 @param noDialog flag indicating quiet operations (boolean) 271 @param noDialog flag indicating quiet operations (boolean)
272 @return always TRUE 272 @return always TRUE
273 """ 273 """
274 return True 274 return True
275 275
276 def vcsConvertProject(self, vcsDataDict, project): 276 def vcsConvertProject(self, vcsDataDict, project, addAll=True):
277 """ 277 """
278 Public method to convert an uncontrolled project to a version 278 Public method to convert an uncontrolled project to a version
279 controlled project. 279 controlled project.
280 280
281 @param vcsDataDict dictionary of data required for the conversion 281 @param vcsDataDict dictionary of data required for the conversion
282 @type dict
282 @param project reference to the project object 283 @param project reference to the project object
283 """ 284 @type Project
284 success = self.vcsImport(vcsDataDict, project.ppath)[0] 285 @param addAll flag indicating to add all files to the repository
286 @type bool
287 """
288 success = self.vcsImport(vcsDataDict, project.ppath, addAll=addAll)[0]
285 if not success: 289 if not success:
286 E5MessageBox.critical( 290 E5MessageBox.critical(
287 self.__ui, 291 self.__ui,
288 self.tr("Create project repository"), 292 self.tr("Create project repository"),
289 self.tr( 293 self.tr(
293 if not os.path.isfile(pfn): 297 if not os.path.isfile(pfn):
294 pfn += "z" 298 pfn += "z"
295 project.closeProject() 299 project.closeProject()
296 project.openProject(pfn) 300 project.openProject(pfn)
297 301
298 def vcsImport(self, vcsDataDict, projectDir, noDialog=False): 302 def vcsImport(self, vcsDataDict, projectDir, noDialog=False, addAll=True):
299 """ 303 """
300 Public method used to import the project into the Mercurial repository. 304 Public method used to import the project into the Mercurial repository.
301 305
302 @param vcsDataDict dictionary of data required for the import 306 @param vcsDataDict dictionary of data required for the import
307 @type dict
303 @param projectDir project directory (string) 308 @param projectDir project directory (string)
309 @type str
304 @param noDialog flag indicating quiet operations 310 @param noDialog flag indicating quiet operations
305 @return flag indicating an execution without errors (boolean) 311 @type bool
306 and a flag indicating the version controll status (boolean) 312 @param addAll flag indicating to add all files to the repository
313 @type bool
314 @return tuple containing a flag indicating an execution without errors
315 and a flag indicating the version controll status
316 @rtype tuple of (bool, bool)
307 """ 317 """
308 msg = vcsDataDict["message"] 318 msg = vcsDataDict["message"]
309 if not msg: 319 if not msg:
310 msg = '***' 320 msg = '***'
311 321
321 if status: 331 if status:
322 ignoreName = os.path.join(projectDir, Hg.IgnoreFileName) 332 ignoreName = os.path.join(projectDir, Hg.IgnoreFileName)
323 if not os.path.exists(ignoreName): 333 if not os.path.exists(ignoreName):
324 status = self.hgCreateIgnoreFile(projectDir) 334 status = self.hgCreateIgnoreFile(projectDir)
325 335
326 if status: 336 if status and addAll:
327 args = self.initCommand("commit") 337 args = self.initCommand("commit")
328 args.append('--addremove') 338 args.append('--addremove')
329 args.append('--message') 339 args.append('--message')
330 args.append(msg) 340 args.append(msg)
331 dia = HgDialog( 341 dia = HgDialog(

eric ide

mercurial