Merge branch 'stable-2.8'
* stable-2.8: Replace "\--" with "--" in documentation. Warn in 2.8 rel. notes that ChangeScreen2 needs download-commands plugin Add warning about removal of `approve` alias to 2.8 release notes Add one more fix in the 2.8 release notes Update 2.8 release notes with changes from stable-2.6 and stable-2.7 Update 2.8.1 release notes with recently merged changes Fix ArrayIndexOutOfBoundsException on initial commits SideBySide2: Map .py files to text/x-python SideBySide2: Map *.cxx and *.hxx to clike CodeMirror mode Enable syntax coloring for Go, BUCK and .gitmodules Conflicts: Documentation/pgm-daemon.txt Documentation/pgm-init.txt gerrit-server/src/main/java/com/google/gerrit/server/DefaultFileExtensionRegistry.java Change-Id: I05c5d47c72d2a5fb524a0622b57ba607fed3bfe3
This commit is contained in:
@@ -30,12 +30,17 @@ public class DefaultFileExtensionRegistry extends MimeDetector {
|
||||
private static final MimeType INI = newMimeType("text/x-ini", 2);
|
||||
private static final MimeType PYTHON = newMimeType("text/x-python", 2);
|
||||
|
||||
private static final ImmutableMap<String, MimeType> TYPES = ImmutableMap.of(
|
||||
".gitmodules", INI,
|
||||
"project.config", INI,
|
||||
"BUCK", PYTHON,
|
||||
"defs", newMimeType(PYTHON.toString(), 1),
|
||||
"go", newMimeType("text/x-go", 1));
|
||||
private static final ImmutableMap<String, MimeType> TYPES =
|
||||
ImmutableMap.<String,MimeType>builder()
|
||||
.put(".gitmodules", INI)
|
||||
.put("project.config", INI)
|
||||
.put("BUCK", PYTHON)
|
||||
.put("defs", newMimeType(PYTHON.toString(), 1))
|
||||
.put("py", newMimeType(PYTHON.toString(), 1))
|
||||
.put("go", newMimeType("text/x-go", 1))
|
||||
.put("cxx", newMimeType("text/x-c++src", 1))
|
||||
.put("hxx", newMimeType("text/x-c++hdr", 1))
|
||||
.build();
|
||||
|
||||
private static MimeType newMimeType(String type, final int specificity) {
|
||||
return new MimeType(type) {
|
||||
|
||||
@@ -365,8 +365,7 @@ public class PatchSetInserter {
|
||||
public static ChangeKind getChangeKind(MergeUtil.Factory mergeUtilFactory, ProjectState project,
|
||||
Repository git, RevCommit prior, RevCommit next) {
|
||||
if (!next.getFullMessage().equals(prior.getFullMessage())) {
|
||||
if (next.getTree() == prior.getTree()
|
||||
&& prior.getParent(0).equals(next.getParent(0))) {
|
||||
if (next.getTree() == prior.getTree() && isSameParents(prior, next)) {
|
||||
return ChangeKind.NO_CODE_CHANGE;
|
||||
} else {
|
||||
return ChangeKind.REWORK;
|
||||
@@ -379,7 +378,7 @@ public class PatchSetInserter {
|
||||
}
|
||||
|
||||
if (next.getTree() == prior.getTree() &&
|
||||
prior.getParent(0).equals(next.getParent(0))) {
|
||||
isSameParents(prior, next)) {
|
||||
return ChangeKind.TRIVIAL_REBASE;
|
||||
}
|
||||
|
||||
@@ -404,6 +403,15 @@ public class PatchSetInserter {
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isSameParents(RevCommit prior, RevCommit next) {
|
||||
if (prior.getParentCount() != next.getParentCount()) {
|
||||
return false;
|
||||
} else if (prior.getParentCount() == 0) {
|
||||
return true;
|
||||
}
|
||||
return prior.getParent(0).equals(next.getParent(0));
|
||||
}
|
||||
|
||||
public class ChangeModifiedException extends InvalidChangeOperationException {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user