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:
Shawn Pearce
2013-04-22 10:40:10 -07:00
6 changed files with 25 additions and 29 deletions

View File

@@ -66,12 +66,9 @@ choice to save the login data locally in the user's password store.
* Always show 'Working ...' message
+
The 'Working ...' message is now not anymore sticked to the Gerrit page
top border so that it is now always displayed, even if the user has
scrolled down the page and the top border is not visible.
+
This change make 'Working ...' message relatively positioned to
browser top border, so that it is always visible for users.
The 'Working ...' message is relatively positioned from the top of
the browser, so that the message is always visible, even if the user
has scrolled down the page.
* link:http://gerrit-documentation.googlecode.com/svn/Documentation/2.6/config-gerrit.html#suggest.from[
suggest.from] configures a minimum number of characters before

View File

@@ -204,7 +204,7 @@ class TrivialRebase:
comment_msg = ("\'--message=New patchset patch-id matches previous patchset"
", but commit message has changed.'")
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)
return
@@ -226,16 +226,17 @@ class TrivialRebase:
# We don't care about previous submit attempts
continue
else:
print "Unsupported category: %s" % approval
continue
self.AppendAcctApproval(acct_approvals, approval['account_id'], '--%s %s' %
(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.\'")
for acct, flags in self.acct_approvals.items():
gerrit_approve_cmd = ['gerrit', 'approve', '--project', self.project,
'--message', gerrit_approve_msg, flags, self.commit]
gerrit_review_cmd = ['gerrit', 'review', '--project', self.project,
'--message', gerrit_review_msg, flags, self.commit]
email_addr = self.GetEmailFromAcctId(acct)
self.SuExec(email_addr, ' '.join(gerrit_approve_cmd))
self.SuExec(email_addr, ' '.join(gerrit_review_cmd))
if __name__ == "__main__":
try:

View File

@@ -298,17 +298,17 @@ public abstract class AbstractPatchContentTable extends NavigationTable<Object>
protected SparseHtmlFile getSparseHtmlFileB(PatchScript s) {
AccountDiffPreference dp = new AccountDiffPreference(s.getDiffPrefs());
SparseFileContent b = s.getB();
PrettyFormatter f = ClientSideFormatter.FACTORY.get();
f.setDiffPrefs(dp);
f.setFileName(s.getB().getPath());
f.setFileName(b.getPath());
f.setEditFilter(PrettyFormatter.B);
f.setEditList(s.getEdits());
if (dp.isSyntaxHighlighting() && s.getA().isWholeFile() && !s.getB().isWholeFile()) {
f.format(s.getB().apply(s.getA(), s.getEdits()));
} else {
f.format(s.getB());
if (s.getA().isWholeFile() && !b.isWholeFile()) {
b = b.apply(s.getA(), s.getEdits());
}
f.format(b);
return f;
}

View File

@@ -198,10 +198,10 @@ class PatchScriptBuilder {
context = diffPrefs.getContext();
hugeFile = true;
} else if (diffPrefs.isSyntaxHighlighting()) {
// In order to syntax highlight the file properly we need to
// give the client the complete file contents. So force our
// context temporarily to the complete file size.
} else {
// In order to expand the skipped common lines or syntax highlight the
// file properly we need to give the client the complete file contents.
// So force our context temporarily to the complete file size.
//
context = MAX_CONTEXT;
}

View File

@@ -315,11 +315,11 @@ public class MergeUtil {
}
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) {
return "VRIF".equals(id.get()) || "Verified".equalsIgnoreCase(id.get());
return "Verified".equalsIgnoreCase(id.get());
}
public List<PatchSetApproval> getApprovalsForCommit(final CodeReviewCommit n) {

View File

@@ -218,11 +218,9 @@ public class ReviewCommand extends SshCommand {
private void applyReview(final ChangeControl ctl, final PatchSet patchSet,
final PostReview.Input review) throws Exception {
if (!review.labels.isEmpty()) {
reviewProvider.get().apply(new RevisionResource(
new ChangeResource(ctl), patchSet), review);
}
}
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
// on the review note. We don't need to add it again on the abandon
// or restore comment.
if (!review.labels.isEmpty()) {
if (!review.labels.isEmpty() && (abandonChange || restoreChange)) {
changeComment = null;
}