/** {@inheritDoc} */ @Override public void notifyIndexChanged(boolean internal) { synchronized (snapshotLock) { snapshot = FileSnapshot.save(getIndexFile()); } fireEvent(new IndexChangedEvent(internal)); }
/** * Commit this change and release the lock. * <p> * If this method fails (returns false) the lock is still released. * * @return true if the commit was successful and the file contains the new * data; false if the commit failed and the file remains with the * old data. * @throws java.lang.IllegalStateException * the lock is not held. */ 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(true)); } return true; }
@Override public void notifyIndexChanged() { snapshot = FileSnapshot.save(getIndexFile()); fireEvent(new IndexChangedEvent()); }
/** {@inheritDoc} */ @Override public void notifyIndexChanged(boolean internal) { synchronized (snapshotLock) { snapshot = FileSnapshot.save(getIndexFile()); } fireEvent(new IndexChangedEvent(internal)); }
/** * Commit this change and release the lock. * <p> * If this method fails (returns false) the lock is still released. * * @return true if the commit was successful and the file contains the new * data; false if the commit failed and the file remains with the * old data. * @throws IllegalStateException * the lock is not held. */ 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()); return true; }
/** * Commit this change and release the lock. * <p> * If this method fails (returns false) the lock is still released. * * @return true if the commit was successful and the file contains the new * data; false if the commit failed and the file remains with the * old data. * @throws java.lang.IllegalStateException * the lock is not held. */ 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(true)); } return true; }
RepositoryMapping mapping = RepositoryMapping.getMapping(path); if (mapping != null) mapping.getRepository().fireEvent(new IndexChangedEvent()); if (out != null) try {