Upgrade JGit to support improved BatchRefUpdates
Now with atomic support for traditional on-disk repos, and finer-grained control over reflogs. RefUpdate.Result also grew some new error values, so extend existing switch statements to cover them. Change-Id: If685ed7f34d965e82cf11fcf59dd832394f2bb4a
This commit is contained in:
parent
81b9c31e21
commit
a6985bcfa8
@ -338,6 +338,8 @@ public class PublicKeyStore implements AutoCloseable {
|
||||
case REJECTED:
|
||||
case REJECTED_CURRENT_BRANCH:
|
||||
case RENAMED:
|
||||
case REJECTED_MISSING_OBJECT:
|
||||
case REJECTED_OTHER_REASON:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -88,6 +88,8 @@ public class DeleteGpgKey implements RestModifyView<GpgKey, Input> {
|
||||
case REJECTED:
|
||||
case REJECTED_CURRENT_BRANCH:
|
||||
case RENAMED:
|
||||
case REJECTED_MISSING_OBJECT:
|
||||
case REJECTED_OTHER_REASON:
|
||||
default:
|
||||
throw new ResourceConflictException("Failed to delete public key: " + saveResult);
|
||||
}
|
||||
|
@ -236,6 +236,8 @@ public class PostGpgKeys implements RestModifyView<AccountResource, Input> {
|
||||
case REJECTED:
|
||||
case REJECTED_CURRENT_BRANCH:
|
||||
case RENAMED:
|
||||
case REJECTED_MISSING_OBJECT:
|
||||
case REJECTED_OTHER_REASON:
|
||||
default:
|
||||
// TODO(dborowitz): Backoff and retry on LOCK_FAILURE.
|
||||
throw new ResourceConflictException("Failed to save public keys: " + saveResult);
|
||||
|
@ -323,6 +323,8 @@ public class PublicKeyCheckerTest {
|
||||
case REJECTED:
|
||||
case REJECTED_CURRENT_BRANCH:
|
||||
case RENAMED:
|
||||
case REJECTED_MISSING_OBJECT:
|
||||
case REJECTED_OTHER_REASON:
|
||||
default:
|
||||
throw new AssertionError(result);
|
||||
}
|
||||
|
@ -128,6 +128,8 @@ public abstract class VersionedMetaDataOnInit extends VersionedMetaData {
|
||||
case REJECTED:
|
||||
case REJECTED_CURRENT_BRANCH:
|
||||
case RENAMED:
|
||||
case REJECTED_MISSING_OBJECT:
|
||||
case REJECTED_OTHER_REASON:
|
||||
default:
|
||||
throw new IOException(
|
||||
"Failed to update " + getRefName() + " of " + project + ": " + r.name());
|
||||
|
@ -412,6 +412,8 @@ public class StarredChangesUtil {
|
||||
case REJECTED:
|
||||
case REJECTED_CURRENT_BRANCH:
|
||||
case RENAMED:
|
||||
case REJECTED_MISSING_OBJECT:
|
||||
case REJECTED_OTHER_REASON:
|
||||
default:
|
||||
throw new OrmException(
|
||||
String.format("Update star labels on ref %s failed: %s", refName, result.name()));
|
||||
@ -439,6 +441,8 @@ public class StarredChangesUtil {
|
||||
case REJECTED:
|
||||
case REJECTED_CURRENT_BRANCH:
|
||||
case RENAMED:
|
||||
case REJECTED_MISSING_OBJECT:
|
||||
case REJECTED_OTHER_REASON:
|
||||
default:
|
||||
throw new OrmException(
|
||||
String.format("Delete star ref %s failed: %s", refName, result.name()));
|
||||
|
@ -757,6 +757,8 @@ public class ExternalIdsUpdate {
|
||||
case NOT_ATTEMPTED:
|
||||
case REJECTED:
|
||||
case REJECTED_CURRENT_BRANCH:
|
||||
case REJECTED_MISSING_OBJECT:
|
||||
case REJECTED_OTHER_REASON:
|
||||
default:
|
||||
throw new IOException("Updating external IDs failed with " + res);
|
||||
}
|
||||
|
@ -616,6 +616,8 @@ public class ConsistencyChecker {
|
||||
case REJECTED:
|
||||
case REJECTED_CURRENT_BRANCH:
|
||||
case RENAMED:
|
||||
case REJECTED_MISSING_OBJECT:
|
||||
case REJECTED_OTHER_REASON:
|
||||
default:
|
||||
p.status = Status.FIX_FAILED;
|
||||
p.outcome = "Failed to update patch set ref: " + result;
|
||||
|
@ -285,6 +285,8 @@ public class ChangeEditUtil {
|
||||
case REJECTED:
|
||||
case REJECTED_CURRENT_BRANCH:
|
||||
case RENAMED:
|
||||
case REJECTED_MISSING_OBJECT:
|
||||
case REJECTED_OTHER_REASON:
|
||||
default:
|
||||
throw new IOException(String.format("Failed to delete ref %s: %s", refName, result));
|
||||
}
|
||||
|
@ -359,6 +359,8 @@ public abstract class VersionedMetaData {
|
||||
case REJECTED:
|
||||
case REJECTED_CURRENT_BRANCH:
|
||||
case RENAMED:
|
||||
case REJECTED_MISSING_OBJECT:
|
||||
case REJECTED_OTHER_REASON:
|
||||
default:
|
||||
throw new IOException(
|
||||
"Cannot delete "
|
||||
@ -444,6 +446,8 @@ public abstract class VersionedMetaData {
|
||||
case REJECTED:
|
||||
case REJECTED_CURRENT_BRANCH:
|
||||
case RENAMED:
|
||||
case REJECTED_MISSING_OBJECT:
|
||||
case REJECTED_OTHER_REASON:
|
||||
default:
|
||||
throw new IOException(
|
||||
"Cannot update "
|
||||
|
@ -163,6 +163,8 @@ public class CreateBranch implements RestModifyView<ProjectResource, BranchInput
|
||||
case REJECTED:
|
||||
case REJECTED_CURRENT_BRANCH:
|
||||
case RENAMED:
|
||||
case REJECTED_MISSING_OBJECT:
|
||||
case REJECTED_OTHER_REASON:
|
||||
default:
|
||||
{
|
||||
throw new IOException(result.name());
|
||||
|
@ -353,6 +353,8 @@ public class CreateProject implements RestModifyView<TopLevelResource, ProjectIn
|
||||
case REJECTED:
|
||||
case REJECTED_CURRENT_BRANCH:
|
||||
case RENAMED:
|
||||
case REJECTED_MISSING_OBJECT:
|
||||
case REJECTED_OTHER_REASON:
|
||||
default:
|
||||
{
|
||||
throw new IOException(
|
||||
|
@ -169,6 +169,8 @@ public class DeleteRef {
|
||||
case NOT_ATTEMPTED:
|
||||
case REJECTED:
|
||||
case RENAMED:
|
||||
case REJECTED_MISSING_OBJECT:
|
||||
case REJECTED_OTHER_REASON:
|
||||
default:
|
||||
log.error("Cannot delete " + ref + ": " + result.name());
|
||||
throw new ResourceConflictException("cannot delete: " + result.name());
|
||||
|
@ -100,6 +100,8 @@ public class SetHead implements RestModifyView<ProjectResource, Input> {
|
||||
case NOT_ATTEMPTED:
|
||||
case REJECTED:
|
||||
case REJECTED_CURRENT_BRANCH:
|
||||
case REJECTED_MISSING_OBJECT:
|
||||
case REJECTED_OTHER_REASON:
|
||||
default:
|
||||
throw new IOException("Setting HEAD failed with " + res);
|
||||
}
|
||||
|
@ -1,12 +1,12 @@
|
||||
load("//tools/bzl:maven_jar.bzl", "GERRIT", "MAVEN_LOCAL", "MAVEN_CENTRAL", "maven_jar")
|
||||
|
||||
_JGIT_VERS = "4.8.0.201706111038-r"
|
||||
_JGIT_VERS = "4.8.0.201706111038-r.71-g45da0fc6f"
|
||||
|
||||
_DOC_VERS = _JGIT_VERS # Set to _JGIT_VERS unless using a snapshot
|
||||
|
||||
JGIT_DOC_URL = "http://download.eclipse.org/jgit/site/" + _DOC_VERS + "/apidocs"
|
||||
|
||||
_JGIT_REPO = MAVEN_CENTRAL # Leave here even if set to MAVEN_CENTRAL.
|
||||
_JGIT_REPO = GERRIT # Leave here even if set to MAVEN_CENTRAL.
|
||||
|
||||
# set this to use a local version.
|
||||
# "/home/<user>/projects/jgit"
|
||||
@ -26,28 +26,28 @@ def jgit_maven_repos():
|
||||
name = "jgit_lib",
|
||||
artifact = "org.eclipse.jgit:org.eclipse.jgit:" + _JGIT_VERS,
|
||||
repository = _JGIT_REPO,
|
||||
sha1 = "f0978a9e868accf9a405d9387bec091a99d87633",
|
||||
src_sha1 = "93cefbf1d73f1179b40419a3898c53a64e52aa93",
|
||||
sha1 = "7248b0a7d7f76dd4f7e55ed081b981cf4d8aa26e",
|
||||
src_sha1 = "6ed203c95decc3f795f44ca17149e7554b92212d",
|
||||
unsign = True,
|
||||
)
|
||||
maven_jar(
|
||||
name = "jgit_servlet",
|
||||
artifact = "org.eclipse.jgit:org.eclipse.jgit.http.server:" + _JGIT_VERS,
|
||||
repository = _JGIT_REPO,
|
||||
sha1 = "3c099afdc063bad438a3b87eea643e9722a07de8",
|
||||
sha1 = "f21fc0c651cc9475db92061432d919ba28b7a7ad",
|
||||
unsign = True,
|
||||
)
|
||||
maven_jar(
|
||||
name = "jgit_archive",
|
||||
artifact = "org.eclipse.jgit:org.eclipse.jgit.archive:" + _JGIT_VERS,
|
||||
repository = _JGIT_REPO,
|
||||
sha1 = "1350a5cf1fad91dd33b66f9fb804dc8e68270890",
|
||||
sha1 = "0f179321f527840dfc8ca79894eba2f6b255dbab",
|
||||
)
|
||||
maven_jar(
|
||||
name = "jgit_junit",
|
||||
artifact = "org.eclipse.jgit:org.eclipse.jgit.junit:" + _JGIT_VERS,
|
||||
repository = _JGIT_REPO,
|
||||
sha1 = "4f45f8f6714df649dbad8c1b1baf68b9510b5047",
|
||||
sha1 = "7e5225064cf14115bddaae9448246c83c89f78ad",
|
||||
unsign = True,
|
||||
)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user