Computes the commit stage of the pipeline.

@param pipeline
@param commits
173519
protected void processCommits(Pipeline pipeline, List<Commit> commits) {
		// TODO when processing commits should we only add the commits that are within the time boundaries?
    	Set<String> seenRevisionNumbers = new HashSet<>();
    	
    	if (logger.isDebugEnabled()) {
    		StringBuilder sb = new StringBuilder();
    		sb.append("\n===== Commit List =====\n");
    		for (Commit commit : commits) {
    			sb.append("    - " + commit.getId() + " (" + commit.getScmRevisionNumber() + ") - " + commit.getScmCommitLog() + "\n");
    		}
    		
    		logger.debug(sb.toString());
    	}
    	
    	for (Commit commit : commits) {
    		boolean commitNotSeen = seenRevisionNumbers.add(commit.getScmRevisionNumber());
    		
    		if (commitNotSeen) {
    			pipeline.addCommit(PipelineStage.COMMIT.getName(), new PipelineCommit(commit, commit.getScmCommitTimestamp()));
    		}
		}
    }
658914
public void commitThis(boolean onePhase) throws XAException {

        if (onePhase && state == XA_STATE_PREPARED) {
            throw new XAException(
                "Transaction is in a 2-phase state when 1-phase is requested");
        }

        if ((!onePhase) && state != XA_STATE_PREPARED) {
            throw new XAException("Attempt to do a 2-phase commit when "
                                  + "transaction is not prepared");
        }

        //if (!onePhase) {
        //  throw new XAException(
        //   "Sorry.  HSQLDB has not implemented 2-phase commits yet");
        //}
        try {

            /**
             * @todo:  Determine if work was committed, rolled back, or both,
             * and return appropriate Heuristic*Exception.
             * connection.commit();
             *  Commits the real, physical conn.
             */
            connection.commit();
        } catch (SQLException se) {
            throw new XAException(se.getMessage());
        }

        dispose();
    }
1157771
private void delete(Commit<DeleteCommand> commit) {
    try {
      if (value != null) {
        value.close();
        value = null;
      }
    } finally {
      commit.close();
    }
  }
1073104
@RequestMapping(value = "changelog/{uuid}/commits", method = RequestMethod.GET)
    public GitChangeLogCommits changeLogCommits(@PathVariable String uuid) {
        // Gets the change log
        GitChangeLog changeLog = getChangeLog(uuid);
        // Cached?
        GitChangeLogCommits commits = changeLog.getCommits();
        if (commits != null) {
            return commits;
        }
        // Loads the commits
        GitChangeLogCommits loadedCommits = changeLog.loadCommits(gitService::getChangeLogCommits);
        // Stores in cache
        logCache.put(uuid, changeLog);
        // OK
        return loadedCommits;
    }
615822
def commit(self, raise_on_error=True):
        '''
        '''
        cmds = list(chain([(('multi',), {})],
                          self.command_stack, [(('exec',), {})]))
        self.reset()
        return self.store.execute_pipeline(cmds, raise_on_error)
498980
private void completeFutures() {
    long commitIndex = queues.values().stream()
        .map(queue -> queue.ackedIndex)
        .reduce(Math::min)
        .orElse(0L);
    for (long i = context.getCommitIndex() + 1; i <= commitIndex; i++) {
      CompletableFuture<Void> future = futures.remove(i);
      if (future != null) {
        future.complete(null);
      }
    }
    context.setCommitIndex(commitIndex);
  }
261735
private CompletableFuture<Void> commitTransactions(String scope, String stream, List<Long> segments,
                                                                     List<UUID> transactionsToCommit) {
        // Chain all transaction commit futures one after the other. This will ensure that order of commit
        // if honoured and is based on the order in the list.
        CompletableFuture<Void> future = CompletableFuture.completedFuture(null);
        for (UUID txnId : transactionsToCommit) {
            log.debug("Committing transaction {} on stream {}/{}", txnId, scope, stream);
            // commit transaction in segment store
            future = future
                    // Note, we can use the same segments and transaction id as only
                    // primary id is taken for creation of txn-segment name and secondary part is erased and replaced with
                    // transaction's epoch.
                    // And we are creating duplicates of txn epoch keeping the primary same.
                    .thenCompose(v -> streamMetadataTasks.notifyTxnCommit(scope, stream, segments, txnId));
        }
        return future;
    }
919596
private synchronized Stage persistStage(Pipeline pipeline, Stage stage) {
        long pipelineId = pipeline.getId();
        stage.setOrderId(resolveStageOrder(pipelineId, stage.getName()));
        Stage savedStage = stageDao.save(pipeline, stage);

        savedStage.setIdentifier(new StageIdentifier(pipeline.getName(), pipeline.getCounter(), pipeline.getLabel(), stage.getName(), String.valueOf(stage.getCounter())));
        for (JobInstance jobInstance : savedStage.getJobInstances()) {
            jobInstance.setIdentifier(new JobIdentifier(pipeline, savedStage, jobInstance));
        }
        return savedStage;
    }
432965
@Override
    public void executeNext()
    {
        final LifecycleStage nextStage = getNextStage();
        if (nextStage == null) {
            throw new IllegalStateException("Lifecycle already hit the final stage!");
        }
        execute(nextStage);
    }
456643
protected function buildPipelineField($commits) {
		// Get filtered commits
		$filteredCommits = array();
		foreach ($commits as $commit) {
			$title = sprintf(
				"%s (%s, %s old)",
				$commit->Message,
				substr($commit->SHA,0,8),
				$commit->dbObject('Created')->TimeDiff()
			);
			$filteredCommits[$commit->SHA] = $title;
		}
		if($filteredCommits) {
			return new DropdownField('FilteredCommits', '', $filteredCommits);
		} else {
			return DropdownField::create('FilteredCommits)', '')
				->setEmptyString('No deployments available')
				->performDisabledTransformation();
		}
	}
420193
private void completeCommits(long previousCommitIndex, long commitIndex) {
    for (long i = previousCommitIndex + 1; i <= commitIndex; i++) {
      CompletableFuture<Long> future = appendFutures.remove(i);
      if (future != null) {
        future.complete(i);
      }
    }
  }
1227193
private void initGithubScmScoreChildrenSettings(ScmScoreSettings scmScoreSettings) {
    ScoreComponentSettings commitsPerDaySettings = Utils.getInstanceIfNull(scmScoreSettings.getCommitsPerDay(), ScoreComponentSettings.class);
    commitsPerDaySettings.setCriteria(
      Utils.mergeCriteria(scmScoreSettings.getCriteria(), commitsPerDaySettings.getCriteria())
    );
    scmScoreSettings.setCommitsPerDay(commitsPerDaySettings);
  }
613394
public void commit(Xid xid, boolean onePhase) throws XAException {
    String command = "XA COMMIT " + xidToString(xid);
    if (onePhase) {
      command += " ONE PHASE";
    }
    execute(command);
  }
721109
protected function handleStage(&$stages, $stage)
    {
        if ($stage instanceof Pipeline) {
            $stages = array_merge($stages, $stage->stages());
        } else {
            $stages[] = is_callable($stage) ? new Callback($stage) : $stage;
        }
    }
1046806
public synchronized void commit() throws IOException {
        if (logStream != null) {
            logStream.flush();
        }
        for (FileOutputStream log : streamsToFlush) {
            log.flush();
            if (forceSync) {
                log.getChannel().force(false);
            }
        }
        while (streamsToFlush.size() > 1) {
            streamsToFlush.removeFirst().close();
        }
    }
1227347
public void addStep(DeploymentOperationStep step) {
    if(currentStep != null) {
      steps.add(steps.indexOf(currentStep)+1, step);
    } else {
      steps.add(step);
    }
  }
785290
@Override
    public void commitChanges(SynchronizationBarrier barrier) throws JMSException
    {
    	checkNotClosed();
    	checkTransactionLock();
    	
    	if (!committables.isEmpty())
        {
    		long start = System.currentTimeMillis();
    		
    		Iterator<Committable> allCommitables = committables.iterator();
        	while (allCommitables.hasNext())
        	{
        		Committable committable = allCommitables.next();
        		committable.commitChanges(barrier);
        	}
        	
        	long end = System.currentTimeMillis();
        	notifyCommitTime(end-start);
        	
        	pendingChanges = false;
        }
    }