Ejemplo n.º 1
0
  private void attemptToCommit() {
    try {
      MercurialUtilities.setOfferAutoCommitMerge(false);
      RunnableHandler handler = merging ? new CommitMergeHandler() : new ContinueRebaseHandler();

      handler.setShell(getSite().getShell());
      handler.run(hgRoot);
    } catch (CoreException e) {
      MercurialEclipsePlugin.logError(e);
    }
  }
Ejemplo n.º 2
0
  private void populateView(boolean attemptToCommit) throws HgException {
    boolean bAllResolved = true;
    List<ResolveStatus> status = null;
    status = HgResolveClient.list(hgRoot);
    table.setItems(status);
    for (ResolveStatus flagged : status) {
      if (flagged.isUnresolved()) {
        bAllResolved = false;
      }
    }
    completeAction.setEnabled(bAllResolved);

    /* TODO: remove this block? Commit button enablement provides sufficient feedback
    if (bAllResolved) {
    	String label;
    	if (merging) {
    		label = Messages.getString("MergeView.PleaseCommitMerge");
    	} else {
    		label = Messages.getString("MergeView.PleaseCommitRebase");
    	}
    	showInfo(label);
    } else {
    	hideStatus();
    }*/

    // Show commit dialog
    if (attemptToCommit && MercurialUtilities.isOfferAutoCommitMerge() && areAllResolved()) {
      /*
       * Offer commit of merge or rebase exactly once if no conflicts are found. Uses {@link
       * ResourceProperties#MERGE_COMMIT_OFFERED} to avoid showing the user the commit dialog
       * repeatedly. This flag should be cleared when any of the following operations occur:
       * commit, rebase, revert.
       */
      attemptToCommit();
    }
  }