org.eclipse.jgit.lib.Repository.writeRebaseTodoFile()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(3.9k)|赞(0)|评价(0)|浏览(117)

本文整理了Java中org.eclipse.jgit.lib.Repository.writeRebaseTodoFile方法的一些代码示例,展示了Repository.writeRebaseTodoFile的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Repository.writeRebaseTodoFile方法的具体详情如下:
包路径:org.eclipse.jgit.lib.Repository
类名称:Repository
方法名:writeRebaseTodoFile

Repository.writeRebaseTodoFile介绍

[英]Write a file formatted like a git-rebase-todo file.
[中]编写一个格式类似git rebase todo文件的文件。

代码示例

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

/**
 * Removes the number of lines given in the parameter from the
 * <code>git-rebase-todo</code> file but preserves comments and other lines
 * that can not be parsed as steps
 *
 * @param numSteps
 * @throws IOException
 */
private void popSteps(int numSteps) throws IOException {
  if (numSteps == 0)
    return;
  List<RebaseTodoLine> todoLines = new LinkedList<>();
  List<RebaseTodoLine> poppedLines = new LinkedList<>();
  for (RebaseTodoLine line : repo.readRebaseTodo(
      rebaseState.getPath(GIT_REBASE_TODO), true)) {
    if (poppedLines.size() >= numSteps
        || RebaseTodoLine.Action.COMMENT.equals(line.getAction()))
      todoLines.add(line);
    else
      poppedLines.add(line);
  }
  repo.writeRebaseTodoFile(rebaseState.getPath(GIT_REBASE_TODO),
      todoLines, false);
  if (poppedLines.size() > 0) {
    repo.writeRebaseTodoFile(rebaseState.getPath(DONE), poppedLines,
        true);
  }
}

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

repo.writeRebaseTodoFile(rebaseState.getPath(GIT_REBASE_TODO),
    steps, false);

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

toDoSteps.add(new RebaseTodoLine(Action.PICK, reader
      .abbreviate(commit), commit.getShortMessage()));
repo.writeRebaseTodoFile(rebaseState.getPath(GIT_REBASE_TODO),
    toDoSteps, false);

代码示例来源:origin: sonia.jgit/org.eclipse.jgit

/**
 * Removes the number of lines given in the parameter from the
 * <code>git-rebase-todo</code> file but preserves comments and other lines
 * that can not be parsed as steps
 *
 * @param numSteps
 * @throws IOException
 */
private void popSteps(int numSteps) throws IOException {
  if (numSteps == 0)
    return;
  List<RebaseTodoLine> todoLines = new LinkedList<RebaseTodoLine>();
  List<RebaseTodoLine> poppedLines = new LinkedList<RebaseTodoLine>();
  for (RebaseTodoLine line : repo.readRebaseTodo(
      rebaseState.getPath(GIT_REBASE_TODO), true)) {
    if (poppedLines.size() >= numSteps
        || RebaseTodoLine.Action.COMMENT.equals(line.getAction()))
      todoLines.add(line);
    else
      poppedLines.add(line);
  }
  repo.writeRebaseTodoFile(rebaseState.getPath(GIT_REBASE_TODO),
      todoLines, false);
  if (poppedLines.size() > 0) {
    repo.writeRebaseTodoFile(rebaseState.getPath(DONE), poppedLines,
        true);
  }
}

代码示例来源:origin: berlam/github-bucket

/**
 * Removes the number of lines given in the parameter from the
 * <code>git-rebase-todo</code> file but preserves comments and other lines
 * that can not be parsed as steps
 *
 * @param numSteps
 * @throws IOException
 */
private void popSteps(int numSteps) throws IOException {
  if (numSteps == 0)
    return;
  List<RebaseTodoLine> todoLines = new LinkedList<>();
  List<RebaseTodoLine> poppedLines = new LinkedList<>();
  for (RebaseTodoLine line : repo.readRebaseTodo(
      rebaseState.getPath(GIT_REBASE_TODO), true)) {
    if (poppedLines.size() >= numSteps
        || RebaseTodoLine.Action.COMMENT.equals(line.getAction()))
      todoLines.add(line);
    else
      poppedLines.add(line);
  }
  repo.writeRebaseTodoFile(rebaseState.getPath(GIT_REBASE_TODO),
      todoLines, false);
  if (poppedLines.size() > 0) {
    repo.writeRebaseTodoFile(rebaseState.getPath(DONE), poppedLines,
        true);
  }
}

代码示例来源:origin: sonia.jgit/org.eclipse.jgit

repo.writeRebaseTodoFile(rebaseState.getPath(GIT_REBASE_TODO),
    steps, false);

代码示例来源:origin: berlam/github-bucket

repo.writeRebaseTodoFile(rebaseState.getPath(GIT_REBASE_TODO),
    steps, false);

代码示例来源:origin: sonia.jgit/org.eclipse.jgit

toDoSteps.add(new RebaseTodoLine(Action.PICK, reader
      .abbreviate(commit), commit.getShortMessage()));
repo.writeRebaseTodoFile(rebaseState.getPath(GIT_REBASE_TODO),
    toDoSteps, false);

代码示例来源:origin: berlam/github-bucket

toDoSteps.add(new RebaseTodoLine(Action.PICK, reader
      .abbreviate(commit), commit.getShortMessage()));
repo.writeRebaseTodoFile(rebaseState.getPath(GIT_REBASE_TODO),
    toDoSteps, false);

相关文章

Repository类方法