Merge "Merge branch 'stable-3.0'"
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -9,7 +9,6 @@
|
|||||||
/.apt_generated
|
/.apt_generated
|
||||||
/.apt_generated_tests
|
/.apt_generated_tests
|
||||||
/.bazel_path
|
/.bazel_path
|
||||||
/.buckd
|
|
||||||
/.classpath
|
/.classpath
|
||||||
/.factorypath
|
/.factorypath
|
||||||
/.idea
|
/.idea
|
||||||
|
@@ -69,7 +69,7 @@ bazel build plugins/<plugin-name>:<plugin-name>
|
|||||||
The output can be normally found in the following directory:
|
The output can be normally found in the following directory:
|
||||||
|
|
||||||
----
|
----
|
||||||
bazel-genfiles/plugins/<plugin-name>/<plugin-name>.jar
|
bazel-bin/plugins/<plugin-name>/<plugin-name>.jar
|
||||||
----
|
----
|
||||||
|
|
||||||
Some plugins describe their build process in `src/main/resources/Documentation/build.md`
|
Some plugins describe their build process in `src/main/resources/Documentation/build.md`
|
||||||
|
@@ -217,6 +217,14 @@ public class ProjectConfig extends VersionedMetaData implements ValidationError.
|
|||||||
r.load(update, id);
|
r.load(update, id);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@UsedAt(UsedAt.Project.COLLABNET)
|
||||||
|
public ProjectConfig read(Repository repo, Project.NameKey name)
|
||||||
|
throws IOException, ConfigInvalidException {
|
||||||
|
ProjectConfig r = create(name);
|
||||||
|
r.load(repo);
|
||||||
|
return r;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private final StoredConfig baseConfig;
|
private final StoredConfig baseConfig;
|
||||||
|
@@ -136,6 +136,7 @@ limitations under the License.
|
|||||||
* * num {number} The number identifying the patch set
|
* * num {number} The number identifying the patch set
|
||||||
* * desc {!string} Optional patch set description
|
* * desc {!string} Optional patch set description
|
||||||
* * wip {boolean} If true, this patch set was never subject to review.
|
* * wip {boolean} If true, this patch set was never subject to review.
|
||||||
|
* * sha {string} hash of the commit
|
||||||
*
|
*
|
||||||
* The wip property is determined by the change's current work_in_progress
|
* The wip property is determined by the change's current work_in_progress
|
||||||
* property and its log of change messages.
|
* property and its log of change messages.
|
||||||
@@ -148,14 +149,18 @@ limitations under the License.
|
|||||||
if (!change) { return []; }
|
if (!change) { return []; }
|
||||||
let patchNums = [];
|
let patchNums = [];
|
||||||
if (change.revisions && Object.keys(change.revisions).length) {
|
if (change.revisions && Object.keys(change.revisions).length) {
|
||||||
|
const revisions = Object.keys(change.revisions).map(sha => {
|
||||||
|
return Object.assign({sha}, change.revisions[sha]);
|
||||||
|
});
|
||||||
patchNums =
|
patchNums =
|
||||||
Gerrit.PatchSetBehavior.sortRevisions(Object.values(change.revisions))
|
Gerrit.PatchSetBehavior.sortRevisions(revisions)
|
||||||
.map(e => {
|
.map(e => {
|
||||||
// TODO(kaspern): Mark which patchset an edit was made on, if an
|
// TODO(kaspern): Mark which patchset an edit was made on, if an
|
||||||
// edit exists -- perhaps with a temporary description.
|
// edit exists -- perhaps with a temporary description.
|
||||||
return {
|
return {
|
||||||
num: e._number,
|
num: e._number,
|
||||||
desc: e.description,
|
desc: e.description,
|
||||||
|
sha: e.sha,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -901,17 +901,17 @@ limitations under the License.
|
|||||||
|
|
||||||
test('patch set from revisions', () => {
|
test('patch set from revisions', () => {
|
||||||
const expected = [
|
const expected = [
|
||||||
{num: 4, desc: 'test'},
|
{num: 4, desc: 'test', sha: 'rev4'},
|
||||||
{num: 3, desc: 'test'},
|
{num: 3, desc: 'test', sha: 'rev3'},
|
||||||
{num: 2, desc: 'test'},
|
{num: 2, desc: 'test', sha: 'rev2'},
|
||||||
{num: 1, desc: 'test'},
|
{num: 1, desc: 'test', sha: 'rev1'},
|
||||||
];
|
];
|
||||||
const patchNums = element.computeAllPatchSets({
|
const patchNums = element.computeAllPatchSets({
|
||||||
revisions: {
|
revisions: {
|
||||||
rev3: {_number: 3, description: 'test'},
|
rev3: {_number: 3, description: 'test', date: 3},
|
||||||
rev1: {_number: 1, description: 'test'},
|
rev1: {_number: 1, description: 'test', date: 1},
|
||||||
rev4: {_number: 4, description: 'test'},
|
rev4: {_number: 4, description: 'test', date: 4},
|
||||||
rev2: {_number: 2, description: 'test'},
|
rev2: {_number: 2, description: 'test', date: 2},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
assert.equal(patchNums.length, expected.length);
|
assert.equal(patchNums.length, expected.length);
|
||||||
|
@@ -62,6 +62,10 @@
|
|||||||
|
|
||||||
behaviors: [Gerrit.PatchSetBehavior],
|
behaviors: [Gerrit.PatchSetBehavior],
|
||||||
|
|
||||||
|
_getShaForPatch(patch) {
|
||||||
|
return patch.sha.substring(0, 10);
|
||||||
|
},
|
||||||
|
|
||||||
_computeBaseDropdownContent(availablePatches, patchNum, _sortedRevisions,
|
_computeBaseDropdownContent(availablePatches, patchNum, _sortedRevisions,
|
||||||
changeComments, revisionInfo) {
|
changeComments, revisionInfo) {
|
||||||
// Polymer 2: check for undefined
|
// Polymer 2: check for undefined
|
||||||
@@ -85,7 +89,7 @@
|
|||||||
for (const basePatch of availablePatches) {
|
for (const basePatch of availablePatches) {
|
||||||
const basePatchNum = basePatch.num;
|
const basePatchNum = basePatch.num;
|
||||||
const entry = this._createDropdownEntry(basePatchNum, 'Patchset ',
|
const entry = this._createDropdownEntry(basePatchNum, 'Patchset ',
|
||||||
_sortedRevisions, changeComments);
|
_sortedRevisions, changeComments, this._getShaForPatch(basePatch));
|
||||||
dropdownContent.push(Object.assign({}, entry, {
|
dropdownContent.push(Object.assign({}, entry, {
|
||||||
disabled: this._computeLeftDisabled(
|
disabled: this._computeLeftDisabled(
|
||||||
basePatch.num, patchNum, _sortedRevisions),
|
basePatch.num, patchNum, _sortedRevisions),
|
||||||
@@ -133,7 +137,7 @@
|
|||||||
const patchNum = patch.num;
|
const patchNum = patch.num;
|
||||||
const entry = this._createDropdownEntry(
|
const entry = this._createDropdownEntry(
|
||||||
patchNum, patchNum === 'edit' ? '' : 'Patchset ', _sortedRevisions,
|
patchNum, patchNum === 'edit' ? '' : 'Patchset ', _sortedRevisions,
|
||||||
changeComments);
|
changeComments, this._getShaForPatch(patch));
|
||||||
dropdownContent.push(Object.assign({}, entry, {
|
dropdownContent.push(Object.assign({}, entry, {
|
||||||
disabled: this._computeRightDisabled(basePatchNum, patchNum,
|
disabled: this._computeRightDisabled(basePatchNum, patchNum,
|
||||||
_sortedRevisions),
|
_sortedRevisions),
|
||||||
@@ -142,12 +146,17 @@
|
|||||||
return dropdownContent;
|
return dropdownContent;
|
||||||
},
|
},
|
||||||
|
|
||||||
_createDropdownEntry(patchNum, prefix, sortedRevisions, changeComments) {
|
_computeText(patchNum, prefix, changeComments, sha) {
|
||||||
|
return `${prefix}${patchNum}` +
|
||||||
|
`${this._computePatchSetCommentsString(changeComments, patchNum)}`
|
||||||
|
+ (` | ${sha}`);
|
||||||
|
},
|
||||||
|
|
||||||
|
_createDropdownEntry(patchNum, prefix, sortedRevisions, changeComments,
|
||||||
|
sha) {
|
||||||
const entry = {
|
const entry = {
|
||||||
triggerText: `${prefix}${patchNum}`,
|
triggerText: `${prefix}${patchNum}`,
|
||||||
text: `${prefix}${patchNum}` +
|
text: this._computeText(patchNum, prefix, changeComments, sha),
|
||||||
`${this._computePatchSetCommentsString(
|
|
||||||
changeComments, patchNum)}`,
|
|
||||||
mobileText: this._computeMobileText(patchNum, changeComments,
|
mobileText: this._computeMobileText(patchNum, changeComments,
|
||||||
sortedRevisions),
|
sortedRevisions),
|
||||||
bottomText: `${this._computePatchSetDescription(
|
bottomText: `${this._computePatchSetDescription(
|
||||||
|
@@ -120,10 +120,10 @@ limitations under the License.
|
|||||||
|
|
||||||
test('_computeBaseDropdownContent', () => {
|
test('_computeBaseDropdownContent', () => {
|
||||||
const availablePatches = [
|
const availablePatches = [
|
||||||
{num: 'edit'},
|
{num: 'edit', sha: '1'},
|
||||||
{num: 3},
|
{num: 3, sha: '2'},
|
||||||
{num: 2},
|
{num: 2, sha: '3'},
|
||||||
{num: 1},
|
{num: 1, sha: '4'},
|
||||||
];
|
];
|
||||||
const revisions = [
|
const revisions = [
|
||||||
{
|
{
|
||||||
@@ -147,7 +147,7 @@ limitations under the License.
|
|||||||
{
|
{
|
||||||
disabled: true,
|
disabled: true,
|
||||||
triggerText: 'Patchset edit',
|
triggerText: 'Patchset edit',
|
||||||
text: 'Patchset edit',
|
text: 'Patchset edit | 1',
|
||||||
mobileText: 'edit',
|
mobileText: 'edit',
|
||||||
bottomText: '',
|
bottomText: '',
|
||||||
value: 'edit',
|
value: 'edit',
|
||||||
@@ -155,7 +155,7 @@ limitations under the License.
|
|||||||
{
|
{
|
||||||
disabled: true,
|
disabled: true,
|
||||||
triggerText: 'Patchset 3',
|
triggerText: 'Patchset 3',
|
||||||
text: 'Patchset 3',
|
text: 'Patchset 3 | 2',
|
||||||
mobileText: '3',
|
mobileText: '3',
|
||||||
bottomText: '',
|
bottomText: '',
|
||||||
value: 3,
|
value: 3,
|
||||||
@@ -164,7 +164,7 @@ limitations under the License.
|
|||||||
{
|
{
|
||||||
disabled: true,
|
disabled: true,
|
||||||
triggerText: 'Patchset 2',
|
triggerText: 'Patchset 2',
|
||||||
text: 'Patchset 2',
|
text: 'Patchset 2 | 3',
|
||||||
mobileText: '2 description',
|
mobileText: '2 description',
|
||||||
bottomText: 'description',
|
bottomText: 'description',
|
||||||
value: 2,
|
value: 2,
|
||||||
@@ -172,7 +172,7 @@ limitations under the License.
|
|||||||
{
|
{
|
||||||
disabled: true,
|
disabled: true,
|
||||||
triggerText: 'Patchset 1',
|
triggerText: 'Patchset 1',
|
||||||
text: 'Patchset 1',
|
text: 'Patchset 1 | 4',
|
||||||
mobileText: '1',
|
mobileText: '1',
|
||||||
bottomText: '',
|
bottomText: '',
|
||||||
value: 1,
|
value: 1,
|
||||||
@@ -197,10 +197,10 @@ limitations under the License.
|
|||||||
];
|
];
|
||||||
element.revisionInfo = getInfo(element.revisions);
|
element.revisionInfo = getInfo(element.revisions);
|
||||||
element.availablePatches = [
|
element.availablePatches = [
|
||||||
{num: 1},
|
{num: 1, sha: '1'},
|
||||||
{num: 2},
|
{num: 2, sha: '2'},
|
||||||
{num: 3},
|
{num: 3, sha: '3'},
|
||||||
{num: 'edit'},
|
{num: 'edit', sha: '4'},
|
||||||
];
|
];
|
||||||
element.patchNum = 2;
|
element.patchNum = 2;
|
||||||
element.basePatchNum = 'PARENT';
|
element.basePatchNum = 'PARENT';
|
||||||
@@ -223,10 +223,10 @@ limitations under the License.
|
|||||||
];
|
];
|
||||||
element.revisionInfo = getInfo(element.revisions);
|
element.revisionInfo = getInfo(element.revisions);
|
||||||
element.availablePatches = [
|
element.availablePatches = [
|
||||||
{num: 'edit'},
|
{num: 'edit', sha: '1'},
|
||||||
{num: 3},
|
{num: 3, sha: '2'},
|
||||||
{num: 2},
|
{num: 2, sha: '3'},
|
||||||
{num: 1},
|
{num: 1, sha: '4'},
|
||||||
];
|
];
|
||||||
element.patchNum = 2;
|
element.patchNum = 2;
|
||||||
element.basePatchNum = 'PARENT';
|
element.basePatchNum = 'PARENT';
|
||||||
@@ -250,10 +250,10 @@ limitations under the License.
|
|||||||
];
|
];
|
||||||
element.revisionInfo = getInfo(element.revisions);
|
element.revisionInfo = getInfo(element.revisions);
|
||||||
element.availablePatches = [
|
element.availablePatches = [
|
||||||
{num: 1},
|
{num: 1, sha: '1'},
|
||||||
{num: 2},
|
{num: 2, sha: '2'},
|
||||||
{num: 3},
|
{num: 3, sha: '3'},
|
||||||
{num: 'edit'},
|
{num: 'edit', sha: '4'},
|
||||||
];
|
];
|
||||||
element.patchNum = 2;
|
element.patchNum = 2;
|
||||||
element.basePatchNum = 'PARENT';
|
element.basePatchNum = 'PARENT';
|
||||||
@@ -274,10 +274,10 @@ limitations under the License.
|
|||||||
];
|
];
|
||||||
element.revisionInfo = getInfo(element.revisions);
|
element.revisionInfo = getInfo(element.revisions);
|
||||||
element.availablePatches = [
|
element.availablePatches = [
|
||||||
{num: 1},
|
{num: 1, sha: '1'},
|
||||||
{num: 2},
|
{num: 2, sha: '2'},
|
||||||
{num: 3},
|
{num: 3, sha: '3'},
|
||||||
{num: 'edit'},
|
{num: 'edit', sha: '4'},
|
||||||
];
|
];
|
||||||
element.patchNum = 2;
|
element.patchNum = 2;
|
||||||
element.basePatchNum = 'PARENT';
|
element.basePatchNum = 'PARENT';
|
||||||
@@ -293,10 +293,10 @@ limitations under the License.
|
|||||||
|
|
||||||
test('_computePatchDropdownContent', () => {
|
test('_computePatchDropdownContent', () => {
|
||||||
const availablePatches = [
|
const availablePatches = [
|
||||||
{num: 'edit'},
|
{num: 'edit', sha: '1'},
|
||||||
{num: 3},
|
{num: 3, sha: '2'},
|
||||||
{num: 2},
|
{num: 2, sha: '3'},
|
||||||
{num: 1},
|
{num: 1, sha: '4'},
|
||||||
];
|
];
|
||||||
const basePatchNum = 1;
|
const basePatchNum = 1;
|
||||||
const sortedRevisions = [
|
const sortedRevisions = [
|
||||||
@@ -310,7 +310,7 @@ limitations under the License.
|
|||||||
{
|
{
|
||||||
disabled: false,
|
disabled: false,
|
||||||
triggerText: 'edit',
|
triggerText: 'edit',
|
||||||
text: 'edit',
|
text: 'edit | 1',
|
||||||
mobileText: 'edit',
|
mobileText: 'edit',
|
||||||
bottomText: '',
|
bottomText: '',
|
||||||
value: 'edit',
|
value: 'edit',
|
||||||
@@ -318,7 +318,7 @@ limitations under the License.
|
|||||||
{
|
{
|
||||||
disabled: false,
|
disabled: false,
|
||||||
triggerText: 'Patchset 3',
|
triggerText: 'Patchset 3',
|
||||||
text: 'Patchset 3',
|
text: 'Patchset 3 | 2',
|
||||||
mobileText: '3',
|
mobileText: '3',
|
||||||
bottomText: '',
|
bottomText: '',
|
||||||
value: 3,
|
value: 3,
|
||||||
@@ -327,7 +327,7 @@ limitations under the License.
|
|||||||
{
|
{
|
||||||
disabled: false,
|
disabled: false,
|
||||||
triggerText: 'Patchset 2',
|
triggerText: 'Patchset 2',
|
||||||
text: 'Patchset 2',
|
text: 'Patchset 2 | 3',
|
||||||
mobileText: '2 description',
|
mobileText: '2 description',
|
||||||
bottomText: 'description',
|
bottomText: 'description',
|
||||||
value: 2,
|
value: 2,
|
||||||
@@ -335,7 +335,7 @@ limitations under the License.
|
|||||||
{
|
{
|
||||||
disabled: true,
|
disabled: true,
|
||||||
triggerText: 'Patchset 1',
|
triggerText: 'Patchset 1',
|
||||||
text: 'Patchset 1',
|
text: 'Patchset 1 | 4',
|
||||||
mobileText: '1',
|
mobileText: '1',
|
||||||
bottomText: '',
|
bottomText: '',
|
||||||
value: 1,
|
value: 1,
|
||||||
|
@@ -60,7 +60,13 @@ if [[ "${VERBOSE:-x}" != "x" ]]; then
|
|||||||
set -o xtrace
|
set -o xtrace
|
||||||
fi
|
fi
|
||||||
|
|
||||||
bazel build //tools/maven:gen_${command} "$@" || \
|
if [[ `which bazelisk` ]]; then
|
||||||
{ echo "bazel failed to build gen_${command}. Use VERBOSE=1 for more info" ; exit 1 ; }
|
BAZEL_CMD=bazelisk
|
||||||
|
else
|
||||||
|
BAZEL_CMD=bazel
|
||||||
|
fi
|
||||||
|
|
||||||
./bazel-genfiles/tools/maven/${command}.sh
|
${BAZEL_CMD} build //tools/maven:gen_${command} "$@" || \
|
||||||
|
{ echo "${BAZEL_CMD} failed to build gen_${command}. Use VERBOSE=1 for more info" ; exit 1 ; }
|
||||||
|
|
||||||
|
./bazel-bin/tools/maven/${command}.sh
|
||||||
|
Reference in New Issue
Block a user