Merge branch 'stable-2.12'

* stable-2.12:
  Fix sending of inline comments on commit message for initial change
  AbstractQueryChangesTest: Add test for query by draft status
  Fix schema 115: Create a new MetaDataUpdate instance for each update
  Add the --strict-labels option to SSH review command
  Allow to add custom core plugins in release build
  Maven: Split Maven repository settings out to a separate def file

Change-Id: I6025858f08214056c288823fe1ce79685800182a
This commit is contained in:
David Pursehouse
2015-12-18 11:02:48 +09:00
5 changed files with 41 additions and 6 deletions

View File

@@ -26,6 +26,7 @@ import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectReader; import org.eclipse.jgit.lib.ObjectReader;
import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit; import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.revwalk.RevObject;
import org.eclipse.jgit.revwalk.RevTree; import org.eclipse.jgit.revwalk.RevTree;
import org.eclipse.jgit.revwalk.RevWalk; import org.eclipse.jgit.revwalk.RevWalk;
import org.eclipse.jgit.treewalk.TreeWalk; import org.eclipse.jgit.treewalk.TreeWalk;
@@ -56,7 +57,11 @@ public class PatchFile {
if (patchList.isAgainstParent()) { if (patchList.isAgainstParent()) {
a = Text.EMPTY; a = Text.EMPTY;
} else { } else {
a = Text.forCommit(reader, patchList.getOldId()); // For the initial commit, we have an empty tree on Side A
RevObject object = rw.parseAny(patchList.getOldId());
a = object instanceof RevCommit
? Text.forCommit(reader, object)
: Text.EMPTY;
} }
b = Text.forCommit(reader, bCommit); b = Text.forCommit(reader, bCommit);

View File

@@ -286,6 +286,28 @@ public abstract class AbstractQueryChangesTest extends GerritServerTests {
assertQuery("is:open", expected); assertQuery("is:open", expected);
} }
@Test
public void byStatusDraft() throws Exception {
TestRepository<Repo> repo = createProject("repo");
ChangeInserter ins1 = newChange(repo, null, null, null, null);
Change change1 = ins1.getChange();
change1.setStatus(Change.Status.NEW);
insert(ins1);
ChangeInserter ins2 = newChange(repo, null, null, null, null);
Change change2 = ins2.getChange();
change2.setStatus(Change.Status.DRAFT);
insert(ins2);
Change[] expected = new Change[] {change2};
assertQuery("status:draft", expected);
assertQuery("status:DRAFT", expected);
assertQuery("status:d", expected);
assertQuery("status:dr", expected);
assertQuery("status:dra", expected);
assertQuery("status:draf", expected);
assertQuery("is:draft", expected);
}
@Test @Test
public void byStatusClosed() throws Exception { public void byStatusClosed() throws Exception {
TestRepository<Repo> repo = createProject("repo"); TestRepository<Repo> repo = createProject("repo");

View File

@@ -6,6 +6,9 @@ CORE = [
'reviewnotes', 'reviewnotes',
'singleusergroup' 'singleusergroup'
] ]
CUSTOM = [
# Add custom core plugins here
]
# buck audit parses and resolves all deps even if not reachable # buck audit parses and resolves all deps even if not reachable
# from the root(s) passed to audit. Filter dependencies to only # from the root(s) passed to audit. Filter dependencies to only
@@ -20,7 +23,7 @@ def core_plugins(names):
else: else:
n.append(p) n.append(p)
return h, n return h, n
HAVE, NEED = core_plugins(CORE) HAVE, NEED = core_plugins(CORE + CUSTOM)
genrule( genrule(
name = 'core', name = 'core',

View File

@@ -1,12 +1,14 @@
include_defs('//VERSION') include_defs('//VERSION')
include_defs('//tools/maven/package.defs') include_defs('//tools/maven/package.defs')
include_defs('//tools/maven/repository.defs')
URL = 'https://oss.sonatype.org/content/repositories/snapshots' \ if GERRIT_VERSION.endswith('-SNAPSHOT'):
if GERRIT_VERSION.endswith('-SNAPSHOT') else \ URL = MAVEN_SNAPSHOT_URL
'https://oss.sonatype.org/service/local/staging/deploy/maven2' else:
URL = MAVEN_RELEASE_URL
maven_package( maven_package(
repository = 'sonatype-nexus-staging', repository = MAVEN_REPOSITORY,
url = URL, url = URL,
version = GERRIT_VERSION, version = GERRIT_VERSION,
jar = { jar = {

View File

@@ -0,0 +1,3 @@
MAVEN_REPOSITORY = 'sonatype-nexus-staging'
MAVEN_SNAPSHOT_URL = 'https://oss.sonatype.org/content/repositories/snapshots'
MAVEN_RELEASE_URL = 'https://oss.sonatype.org/service/local/staging/deploy/maven2'