Track the repository heads given a CommitCommand.

        :param cmd: the CommitCommand
        :return: the list of parents in terms of commit-ids
770638
def track_heads(self, cmd):
        
        # Get the true set of parents
        if cmd.from_ is not None:
            parents = [cmd.from_]
        else:
            last_id = self.last_ids.get(cmd.ref)
            if last_id is not None:
                parents = [last_id]
            else:
                parents = []
        parents.extend(cmd.merges)

        # Track the heads
        self.track_heads_for_ref(cmd.ref, cmd.id, parents)
        return parents
1270196
function Cmd(commit, options, rollCall) {
	this.commit = commit;
	this.options = options;
	this.rollCall = rollCall;
}
219762
def get_commits_since(check_name, target_tag=None):
    
    root = get_root()
    target_path = os.path.join(root, check_name)
    command = 'git log --pretty=%s {}{}'.format('' if target_tag is None else '{}... '.format(target_tag), target_path)

    with chdir(root):
        return run_command(command, capture=True).stdout.splitlines()
381933
private void commitEntries() {
    context.checkThread();

    // Sort the list of replicas, order by the last index that was replicated
    // to the replica. This will allow us to determine the median index
    // for all known replicated entries across all cluster members.
    List<MemberState> members = context.getClusterState().getActiveMemberStates((m1, m2) ->
      Long.compare(m2.getMatchIndex() != 0 ? m2.getMatchIndex() : 0L, m1.getMatchIndex() != 0 ? m1.getMatchIndex() : 0L));

    // If the active members list is empty (a configuration change occurred between an append request/response)
    // ensure all commit futures are completed and cleared.
    if (members.isEmpty()) {
      long previousCommitIndex = context.getCommitIndex();
      long commitIndex = context.getLog().lastIndex();
      context.setCommitIndex(commitIndex);
      completeCommits(previousCommitIndex, commitIndex);
      return;
    }

    // Calculate the current commit index as the median matchIndex.
    long commitIndex = members.get(quorumIndex()).getMatchIndex();

    // If the commit index has increased then update the commit index. Note that in order to ensure
    // the leader completeness property holds, we verify that the commit index is greater than or equal to
    // the index of the leader's no-op entry. Update the commit index and trigger commit futures.
    long previousCommitIndex = context.getCommitIndex();
    if (commitIndex > 0 && commitIndex > previousCommitIndex && (leaderIndex > 0 && commitIndex >= leaderIndex)) {
      context.setCommitIndex(commitIndex);
      completeCommits(previousCommitIndex, commitIndex);
    }
  }
620807
def get_command_class(self, cmd):
        
        try:
            cmdpath = self.registry[cmd]
        except KeyError:
            raise CommandError("No such command %r" % cmd)
        if isinstance(cmdpath, basestring):
            Command = import_class(cmdpath)
        else:
            Command = cmdpath
        return Command
899924
def current_id(self):
        
        try:
            cmd = ['git', 'rev-parse', '--short', 'HEAD']
            return self.sh(cmd,
                        shell=False,
                        ignore_error=True).rstrip()
        except subprocess.CalledProcessError as e:
            log.exception(e)
            #if e.returncode == 128  # bare repo
            return None
1368213
def get_commits(self):
        '''
        
        '''
        if not self.is_managed_by_git():
            return []
        return self.git.get_commits(self.content.source_path, self.follow)
1704
private function fetchNameStatusFromCommit($commitId, GitRepository $git)
    {
        $arguments = [
            $git->getConfig()->getGitExecutablePath(),
            'show',
            $commitId,
            '-M',
            '--name-status',
            '--format='
        ];

        // git show $commitId -M --name-status --format=''
        return $this->runCustomGit($arguments, $git);
    }
717463
private void commitEntries() {
    raft.checkThread();

    // Sort the list of replicas, order by the last index that was replicated
    // to the replica. This will allow us to determine the median index
    // for all known replicated entries across all cluster members.
    List<RaftMemberContext> members = raft.getCluster().getActiveMemberStates((m1, m2) ->
        Long.compare(m2.getMatchIndex() != 0 ? m2.getMatchIndex() : 0L, m1.getMatchIndex() != 0 ? m1.getMatchIndex() : 0L));

    // If the active members list is empty (a configuration change occurred between an append request/response)
    // ensure all commit futures are completed and cleared.
    if (members.isEmpty()) {
      long commitIndex = raft.getLogWriter().getLastIndex();
      long previousCommitIndex = raft.setCommitIndex(commitIndex);
      if (commitIndex > previousCommitIndex) {
        log.trace("Committed entries up to {}", commitIndex);
        completeCommits(previousCommitIndex, commitIndex);
      }
      return;
    }

    // Calculate the current commit index as the median matchIndex.
    long commitIndex = members.get(getQuorumIndex()).getMatchIndex();

    // If the commit index has increased then update the commit index. Note that in order to ensure
    // the leader completeness property holds, we verify that the commit index is greater than or equal to
    // the index of the leader's no-op entry. Update the commit index and trigger commit futures.
    long previousCommitIndex = raft.getCommitIndex();
    if (commitIndex > 0 && commitIndex > previousCommitIndex && (leaderIndex > 0 && commitIndex >= leaderIndex)) {
      log.trace("Committed entries up to {}", commitIndex);
      raft.setCommitIndex(commitIndex);
      completeCommits(previousCommitIndex, commitIndex);
    }
  }
125436
def do_commit_amends(self):
        
        commit_cumalative_count = 0
        for days in MARKED_DAYS:
            amend_date = (
                self.end_date - datetime.timedelta(days)).strftime("%Y-%m-%d %H:%M:%S")
            for commit_number_in_a_day in xrange(0, self.max_commits):
                commit_cumalative_count += 1
                subprocess.check_call(
                    ['git', 'commit', '--amend', "--date='<" + amend_date + " + 0530 >' ", '-C',
                     'HEAD~{commit_number}'.format(commit_number=commit_cumalative_count)], cwd=self.repository_name)
                subprocess.check_call(
                    ['git', 'pull', '--no-edit'], cwd=self.repository_name)
                subprocess.check_call(
                    ['git', 'push', 'origin', 'master'], cwd=self.repository_name)
1142323
def get_parent_repository_nodes(self):
        
        parent_repository_nodes = []
        for node in self._my_map['parentNodes']:
            parent_repository_nodes.append(RepositoryNode(
                node._my_map,
                runtime=self._runtime,
                proxy=self._proxy,
                lookup_session=self._lookup_session))
        return RepositoryNodeList(parent_repository_nodes)
164384
async def runCmdLine(self, line):
        '''
        

        '''
        opts = self.getCmdOpts(line)
        return await self.runCmdOpts(opts)
81508
def _push(self):
        """"""

        push_cmds = self.vcs.push_commands()
        if not push_cmds:
            return
        if utils.ask("OK to push commits to the server?"):
            for push_cmd in push_cmds:
                output = utils.system(push_cmd)
                logger.info(output)
278030
def get_command_history(self, issued_command):
        
        #pylint: disable=protected-access
        entry = issued_command._proto.commandQueueEntry
        key = self._cache_key(entry.cmdId)
        if key in self._cache:
            return self._cache[key]
        return None
528764
def get_commit_from_gitpython(self, commit: GitCommit) -> Commit:
        
        return Commit(commit, self.path, self.main_branch)
828396
@Nullable
  private String[] getReplacementCmd(String cmd) {
    if (mCommandAlias == null || !mCommandAlias.containsKey(cmd)) {
      return null;
    }
    return mCommandAlias.get(cmd);
  }
933696
def send_cmds(self, *cmds):
        
        promise = aplus.Promise()
        tagged_cmds = list(self._tag_cmds(*cmds))
        logger.debug("Sending cmds: %s", tagged_cmds)

        cmd_group = _get_cmds_id(*tagged_cmds)
        self._cmd_groups[cmd_group] = (tagged_cmds, promise)
        self.send(json.dumps(tagged_cmds))
        return promise