Package org.eclipse.jgit.internal.storage.file

Examples of org.eclipse.jgit.internal.storage.file.LockFile.commit()


      final LockFile lf;
      lf = new LockFile(new File(db.getDirectory(), Constants.HEAD), db.getFS());
      if (!lf.lock())
        throw new IOException(MessageFormat.format(CLIText.get().cannotLock, Constants.HEAD));
      lf.write(id);
      if (!lf.commit())
        throw new IOException(CLIText.get().cannotDeatchHEAD);
    }
  }

  private void deleteAllRefs() throws Exception {
View Full Code Here


        try {
          lck.write(content);
        } catch (IOException ioe) {
          throw new ObjectWritingException(MessageFormat.format(CLIText.get().cantWrite, file));
        }
        if (!lck.commit())
          throw new ObjectWritingException(MessageFormat.format(CLIText.get().cantWrite, file));
      }
    }.writePackedRefs();
  }
View Full Code Here

   */
  public boolean commit() {
    final LockFile tmp = myLock;
    requireLocked(tmp);
    myLock = null;
    if (!tmp.commit())
      return false;
    snapshot = tmp.getCommitSnapshot();
    if (indexChangedListener != null
        && !Arrays.equals(readIndexChecksum, writeIndexChecksum))
      indexChangedListener.onIndexChanged(new IndexChangedEvent());
View Full Code Here

            result.add(h);
          }
        } finally {
          w.close();
        }
        lock.commit();
      }
    } finally {
      lock.unlock();
    }
  }
View Full Code Here

    try {
      lck.write(bin);
    } catch (IOException ioe) {
      throw new ObjectWritingException("Can't write " + p);
    }
    if (!lck.commit())
      throw new ObjectWritingException("Can't write " + p);
  }

  /** Helper to build a branch with one or more commits */
  public class BranchBuilder {
View Full Code Here

    if (!lf.lock())
      throw new LockFailedException(getFile());
    try {
      lf.setNeedSnapshot(true);
      lf.write(out);
      if (!lf.commit())
        throw new IOException(MessageFormat.format(JGitText.get().cannotCommitWriteTo, getFile()));
    } finally {
      lf.unlock();
    }
    snapshot = lf.getCommitSnapshot();
View Full Code Here

      final LockFile lf;
      lf = new LockFile(new File(db.getDirectory(), Constants.HEAD), db.getFS());
      if (!lf.lock())
        throw new IOException(MessageFormat.format(CLIText.get().cannotLock, Constants.HEAD));
      lf.write(id);
      if (!lf.commit())
        throw new IOException(CLIText.get().cannotDeatchHEAD);
    }
  }

  private void deleteAllRefs() throws Exception {
View Full Code Here

        try {
          lck.write(content);
        } catch (IOException ioe) {
          throw new ObjectWritingException(MessageFormat.format(CLIText.get().cantWrite, file));
        }
        if (!lck.commit())
          throw new ObjectWritingException(MessageFormat.format(CLIText.get().cantWrite, file));
      }
    }.writePackedRefs();
  }
View Full Code Here

    if (!lf.lock())
      throw new LockFailedException(getFile());
    try {
      lf.setNeedSnapshot(true);
      lf.write(out);
      if (!lf.commit())
        throw new IOException(MessageFormat.format(JGitText.get().cannotCommitWriteTo, getFile()));
    } finally {
      lf.unlock();
    }
    snapshot = lf.getCommitSnapshot();
View Full Code Here

   */
  public boolean commit() {
    final LockFile tmp = myLock;
    requireLocked(tmp);
    myLock = null;
    if (!tmp.commit())
      return false;
    snapshot = tmp.getCommitSnapshot();
    if (indexChangedListener != null
        && !Arrays.equals(readIndexChecksum, writeIndexChecksum))
      indexChangedListener.onIndexChanged(new IndexChangedEvent());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.