Plugins/VcsPlugins/vcsMercurial/hg.py

changeset 2222
105f425944a2
parent 1990
7fee3661c4f9
child 2278
72d794b6fef8
equal deleted inserted replaced
2221:f72f8b0478cb 2222:105f425944a2
429 name = self.__commitData["name"] 429 name = self.__commitData["name"]
430 msg = self.__commitData["msg"] 430 msg = self.__commitData["msg"]
431 noDialog = self.__commitData["noDialog"] 431 noDialog = self.__commitData["noDialog"]
432 closeBranch = self.__commitData["closeBranch"] 432 closeBranch = self.__commitData["closeBranch"]
433 433
434 if not noDialog:
435 # check, if there are unsaved changes, that should be committed
436 if isinstance(name, list):
437 nameList = name
438 else:
439 nameList = [name]
440 ok = True
441 for nam in nameList:
442 # check for commit of the project
443 if os.path.isdir(nam):
444 project = e5App().getObject("Project")
445 if nam == project.getProjectPath():
446 ok &= project.checkAllScriptsDirty(reportSyntaxErrors=True) and \
447 project.checkDirty()
448 continue
449 elif os.path.isfile(nam):
450 editor = e5App().getObject("ViewManager").getOpenEditor(nam)
451 if editor:
452 ok &= editor.checkDirty()
453 if not ok:
454 break
455
456 if not ok:
457 res = E5MessageBox.yesNo(self.__ui,
458 self.trUtf8("Commit Changes"),
459 self.trUtf8("""The commit affects files, that have unsaved"""
460 """ changes. Shall the commit be continued?"""),
461 icon = E5MessageBox.Warning)
462 if not res:
463 return
464
434 if self.__commitDialog is not None: 465 if self.__commitDialog is not None:
435 msg = self.__commitDialog.logMessage() 466 msg = self.__commitDialog.logMessage()
436 amend = self.__commitDialog.amend() 467 amend = self.__commitDialog.amend()
437 commitSubrepositories = self.__commitDialog.commitSubrepositories() 468 commitSubrepositories = self.__commitDialog.commitSubrepositories()
438 self.__commitDialog.accepted.disconnect(self.__vcsCommit_Step2) 469 self.__commitDialog.accepted.disconnect(self.__vcsCommit_Step2)

eric ide

mercurial