365 shutil.rmtree(os.path.join(projectDir, self.adminDir), True) |
365 shutil.rmtree(os.path.join(projectDir, self.adminDir), True) |
366 if os.path.exists(os.path.join(projectDir, '.hgignore')): |
366 if os.path.exists(os.path.join(projectDir, '.hgignore')): |
367 os.remove(os.path.join(projectDir, '.hgignore')) |
367 os.remove(os.path.join(projectDir, '.hgignore')) |
368 return status |
368 return status |
369 |
369 |
370 def vcsCommit(self, name, message, noDialog=False, closeBranch=False): |
370 def vcsCommit(self, name, message, noDialog=False, closeBranch=False, mq=False): |
371 """ |
371 """ |
372 Public method used to make the change of a file/directory permanent in the |
372 Public method used to make the change of a file/directory permanent in the |
373 Mercurial repository. |
373 Mercurial repository. |
374 |
374 |
375 @param name file/directory name to be committed (string or list of strings) |
375 @param name file/directory name to be committed (string or list of strings) |
376 @param message message for this operation (string) |
376 @param message message for this operation (string) |
377 @param noDialog flag indicating quiet operations |
377 @param noDialog flag indicating quiet operations |
378 @keyparam closeBranch flag indicating a close branch commit (boolean) |
378 @keyparam closeBranch flag indicating a close branch commit (boolean) |
|
379 @keyparam mq flag indicating a queue commit (boolean) |
379 """ |
380 """ |
380 msg = message |
381 msg = message |
|
382 |
|
383 if mq: |
|
384 # ensure dialog is shown for a queue commit |
|
385 noDialog = False |
381 |
386 |
382 if not noDialog and not msg: |
387 if not noDialog and not msg: |
383 # call CommitDialog and get message from there |
388 # call CommitDialog and get message from there |
384 if self.__commitDialog is None: |
389 if self.__commitDialog is None: |
385 from .HgCommitDialog import HgCommitDialog |
390 from .HgCommitDialog import HgCommitDialog |
386 self.__commitDialog = HgCommitDialog(self, self.__ui) |
391 self.__commitDialog = HgCommitDialog(self, mq, self.__ui) |
387 self.__commitDialog.accepted.connect(self.__vcsCommit_Step2) |
392 self.__commitDialog.accepted.connect(self.__vcsCommit_Step2) |
388 self.__commitDialog.show() |
393 self.__commitDialog.show() |
389 self.__commitDialog.raise_() |
394 self.__commitDialog.raise_() |
390 self.__commitDialog.activateWindow() |
395 self.__commitDialog.activateWindow() |
391 |
396 |
392 self.__commitData["name"] = name |
397 self.__commitData["name"] = name |
393 self.__commitData["msg"] = msg |
398 self.__commitData["msg"] = msg |
394 self.__commitData["noDialog"] = noDialog |
399 self.__commitData["noDialog"] = noDialog |
395 self.__commitData["closeBranch"] = closeBranch |
400 self.__commitData["closeBranch"] = closeBranch |
|
401 self.__commitData["mq"] = mq |
396 |
402 |
397 if noDialog: |
403 if noDialog: |
398 self.__vcsCommit_Step2() |
404 self.__vcsCommit_Step2() |
399 |
405 |
400 def __vcsCommit_Step2(self): |
406 def __vcsCommit_Step2(self): |
403 """ |
409 """ |
404 name = self.__commitData["name"] |
410 name = self.__commitData["name"] |
405 msg = self.__commitData["msg"] |
411 msg = self.__commitData["msg"] |
406 noDialog = self.__commitData["noDialog"] |
412 noDialog = self.__commitData["noDialog"] |
407 closeBranch = self.__commitData["closeBranch"] |
413 closeBranch = self.__commitData["closeBranch"] |
|
414 mq = self.__commitData["mq"] |
408 |
415 |
409 if not noDialog: |
416 if not noDialog: |
410 # check, if there are unsaved changes, that should be committed |
417 # check, if there are unsaved changes, that should be committed |
411 if isinstance(name, list): |
418 if isinstance(name, list): |
412 nameList = name |
419 nameList = name |
439 |
446 |
440 if self.__commitDialog is not None: |
447 if self.__commitDialog is not None: |
441 msg = self.__commitDialog.logMessage() |
448 msg = self.__commitDialog.logMessage() |
442 amend = self.__commitDialog.amend() |
449 amend = self.__commitDialog.amend() |
443 commitSubrepositories = self.__commitDialog.commitSubrepositories() |
450 commitSubrepositories = self.__commitDialog.commitSubrepositories() |
444 ## self.__commitDialog.accepted.disconnect(self.__vcsCommit_Step2) |
|
445 self.__commitDialog.deleteLater() |
451 self.__commitDialog.deleteLater() |
446 self.__commitDialog = None |
452 self.__commitDialog = None |
447 else: |
453 else: |
448 amend = False |
454 amend = False |
449 commitSubrepositories = False |
455 commitSubrepositories = False |
454 args = [] |
460 args = [] |
455 args.append('commit') |
461 args.append('commit') |
456 self.addArguments(args, self.options['global']) |
462 self.addArguments(args, self.options['global']) |
457 self.addArguments(args, self.options['commit']) |
463 self.addArguments(args, self.options['commit']) |
458 args.append("-v") |
464 args.append("-v") |
459 if closeBranch: |
465 if mq: |
460 args.append("--close-branch") |
466 args.append("--mq") |
461 if amend: |
467 else: |
462 args.append("--amend") |
468 if closeBranch: |
463 if commitSubrepositories: |
469 args.append("--close-branch") |
464 args.append("--subrepos") |
470 if amend: |
|
471 args.append("--amend") |
|
472 if commitSubrepositories: |
|
473 args.append("--subrepos") |
465 if msg: |
474 if msg: |
466 args.append("--message") |
475 args.append("--message") |
467 args.append(msg) |
476 args.append(msg) |
468 if isinstance(name, list): |
477 if isinstance(name, list): |
469 dname, fnames = self.splitPathList(name) |
478 dname, fnames = self.splitPathList(name) |