Merge branch 'stable-2.6'
* stable-2.6: Enable expanding skipped lines even if 'Syntax Coloring' is off Fix: `gerrit review` with --message does not work with no labels Reword 'Working ...' message changes in 2.6 release notes TrivialRebase: Support custom labels MergeUtil: Remove legacy label ID TrivialRebase: Call gerrit review instead of approve
This commit is contained in:
@@ -66,12 +66,9 @@ choice to save the login data locally in the user's password store.
|
|||||||
|
|
||||||
* Always show 'Working ...' message
|
* Always show 'Working ...' message
|
||||||
+
|
+
|
||||||
The 'Working ...' message is now not anymore sticked to the Gerrit page
|
The 'Working ...' message is relatively positioned from the top of
|
||||||
top border so that it is now always displayed, even if the user has
|
the browser, so that the message is always visible, even if the user
|
||||||
scrolled down the page and the top border is not visible.
|
has scrolled down the page.
|
||||||
+
|
|
||||||
This change make 'Working ...' message relatively positioned to
|
|
||||||
browser top border, so that it is always visible for users.
|
|
||||||
|
|
||||||
* link:http://gerrit-documentation.googlecode.com/svn/Documentation/2.6/config-gerrit.html#suggest.from[
|
* link:http://gerrit-documentation.googlecode.com/svn/Documentation/2.6/config-gerrit.html#suggest.from[
|
||||||
suggest.from] configures a minimum number of characters before
|
suggest.from] configures a minimum number of characters before
|
||||||
|
@@ -204,7 +204,7 @@ class TrivialRebase:
|
|||||||
comment_msg = ("\'--message=New patchset patch-id matches previous patchset"
|
comment_msg = ("\'--message=New patchset patch-id matches previous patchset"
|
||||||
", but commit message has changed.'")
|
", but commit message has changed.'")
|
||||||
comment_cmd = [self.ssh, self.ssh_port_flag, self.port, self.server, 'gerrit',
|
comment_cmd = [self.ssh, self.ssh_port_flag, self.port, self.server, 'gerrit',
|
||||||
'approve', '--project', self.project, comment_msg, self.commit]
|
'review', '--project', self.project, comment_msg, self.commit]
|
||||||
self.CheckCall(comment_cmd)
|
self.CheckCall(comment_cmd)
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -226,16 +226,17 @@ class TrivialRebase:
|
|||||||
# We don't care about previous submit attempts
|
# We don't care about previous submit attempts
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
print "Unsupported category: %s" % approval
|
self.AppendAcctApproval(acct_approvals, approval['account_id'], '--%s %s' %
|
||||||
continue
|
(approval['category_id'].lower().replace(' ', '-'),
|
||||||
|
approval['value']))
|
||||||
|
|
||||||
gerrit_approve_msg = ("\'Automatically re-added by Gerrit trivial rebase "
|
gerrit_review_msg = ("\'Automatically re-added by Gerrit trivial rebase "
|
||||||
"detection script.\'")
|
"detection script.\'")
|
||||||
for acct, flags in self.acct_approvals.items():
|
for acct, flags in self.acct_approvals.items():
|
||||||
gerrit_approve_cmd = ['gerrit', 'approve', '--project', self.project,
|
gerrit_review_cmd = ['gerrit', 'review', '--project', self.project,
|
||||||
'--message', gerrit_approve_msg, flags, self.commit]
|
'--message', gerrit_review_msg, flags, self.commit]
|
||||||
email_addr = self.GetEmailFromAcctId(acct)
|
email_addr = self.GetEmailFromAcctId(acct)
|
||||||
self.SuExec(email_addr, ' '.join(gerrit_approve_cmd))
|
self.SuExec(email_addr, ' '.join(gerrit_review_cmd))
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
try:
|
try:
|
||||||
|
@@ -298,17 +298,17 @@ public abstract class AbstractPatchContentTable extends NavigationTable<Object>
|
|||||||
protected SparseHtmlFile getSparseHtmlFileB(PatchScript s) {
|
protected SparseHtmlFile getSparseHtmlFileB(PatchScript s) {
|
||||||
AccountDiffPreference dp = new AccountDiffPreference(s.getDiffPrefs());
|
AccountDiffPreference dp = new AccountDiffPreference(s.getDiffPrefs());
|
||||||
|
|
||||||
|
SparseFileContent b = s.getB();
|
||||||
PrettyFormatter f = ClientSideFormatter.FACTORY.get();
|
PrettyFormatter f = ClientSideFormatter.FACTORY.get();
|
||||||
f.setDiffPrefs(dp);
|
f.setDiffPrefs(dp);
|
||||||
f.setFileName(s.getB().getPath());
|
f.setFileName(b.getPath());
|
||||||
f.setEditFilter(PrettyFormatter.B);
|
f.setEditFilter(PrettyFormatter.B);
|
||||||
f.setEditList(s.getEdits());
|
f.setEditList(s.getEdits());
|
||||||
|
|
||||||
if (dp.isSyntaxHighlighting() && s.getA().isWholeFile() && !s.getB().isWholeFile()) {
|
if (s.getA().isWholeFile() && !b.isWholeFile()) {
|
||||||
f.format(s.getB().apply(s.getA(), s.getEdits()));
|
b = b.apply(s.getA(), s.getEdits());
|
||||||
} else {
|
|
||||||
f.format(s.getB());
|
|
||||||
}
|
}
|
||||||
|
f.format(b);
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -198,10 +198,10 @@ class PatchScriptBuilder {
|
|||||||
context = diffPrefs.getContext();
|
context = diffPrefs.getContext();
|
||||||
hugeFile = true;
|
hugeFile = true;
|
||||||
|
|
||||||
} else if (diffPrefs.isSyntaxHighlighting()) {
|
} else {
|
||||||
// In order to syntax highlight the file properly we need to
|
// In order to expand the skipped common lines or syntax highlight the
|
||||||
// give the client the complete file contents. So force our
|
// file properly we need to give the client the complete file contents.
|
||||||
// context temporarily to the complete file size.
|
// So force our context temporarily to the complete file size.
|
||||||
//
|
//
|
||||||
context = MAX_CONTEXT;
|
context = MAX_CONTEXT;
|
||||||
}
|
}
|
||||||
|
@@ -315,11 +315,11 @@ public class MergeUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isCodeReview(LabelId id) {
|
private static boolean isCodeReview(LabelId id) {
|
||||||
return "CRVW".equals(id.get()) || "Code-Review".equalsIgnoreCase(id.get());
|
return "Code-Review".equalsIgnoreCase(id.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isVerified(LabelId id) {
|
private static boolean isVerified(LabelId id) {
|
||||||
return "VRIF".equals(id.get()) || "Verified".equalsIgnoreCase(id.get());
|
return "Verified".equalsIgnoreCase(id.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<PatchSetApproval> getApprovalsForCommit(final CodeReviewCommit n) {
|
public List<PatchSetApproval> getApprovalsForCommit(final CodeReviewCommit n) {
|
||||||
|
@@ -218,10 +218,8 @@ public class ReviewCommand extends SshCommand {
|
|||||||
|
|
||||||
private void applyReview(final ChangeControl ctl, final PatchSet patchSet,
|
private void applyReview(final ChangeControl ctl, final PatchSet patchSet,
|
||||||
final PostReview.Input review) throws Exception {
|
final PostReview.Input review) throws Exception {
|
||||||
if (!review.labels.isEmpty()) {
|
reviewProvider.get().apply(new RevisionResource(
|
||||||
reviewProvider.get().apply(new RevisionResource(
|
new ChangeResource(ctl), patchSet), review);
|
||||||
new ChangeResource(ctl), patchSet), review);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void approveOne(final PatchSet patchSet) throws Exception {
|
private void approveOne(final PatchSet patchSet) throws Exception {
|
||||||
@@ -246,7 +244,7 @@ public class ReviewCommand extends SshCommand {
|
|||||||
// If review labels are being applied, the comment will be included
|
// If review labels are being applied, the comment will be included
|
||||||
// on the review note. We don't need to add it again on the abandon
|
// on the review note. We don't need to add it again on the abandon
|
||||||
// or restore comment.
|
// or restore comment.
|
||||||
if (!review.labels.isEmpty()) {
|
if (!review.labels.isEmpty() && (abandonChange || restoreChange)) {
|
||||||
changeComment = null;
|
changeComment = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user