Merge branch 'stable-2.7' into stable-2.8

* stable-2.7:
  Catch missing LDAP accounts in group membership
  Update patch status before skipping duplicate emails

Conflicts:
	gerrit-server/src/main/java/com/google/gerrit/server/git/MergeOp.java

Change-Id: I94db0700e753eef5e94077f2ba0303b78708315b
This commit is contained in:
Shawn Pearce
2013-11-18 08:41:25 -08:00
2 changed files with 15 additions and 5 deletions

View File

@@ -198,7 +198,13 @@ import javax.security.auth.login.LoginException;
final HashMap<String, String> params = new HashMap<String, String>(); final HashMap<String, String> params = new HashMap<String, String>();
if (account == null) { if (account == null) {
try {
account = findAccount(schema, ctx, username); account = findAccount(schema, ctx, username);
} catch (AccountException e) {
LdapRealm.log.warn("Account " + username +
" not found, assuming empty group membership");
return Collections.emptySet();
}
} }
for (String name : schema.groupMemberQueryList.get(0).getParameters()) { for (String name : schema.groupMemberQueryList.get(0).getParameters()) {
params.put(name, account.get(name)); params.put(name, account.get(name));
@@ -215,7 +221,13 @@ import javax.security.auth.login.LoginException;
if (schema.accountMemberField != null) { if (schema.accountMemberField != null) {
if (account == null) { if (account == null) {
try {
account = findAccount(schema, ctx, username); account = findAccount(schema, ctx, username);
} catch (AccountException e) {
LdapRealm.log.warn("Account " + username +
" not found, assuming empty group membership");
return Collections.emptySet();
}
} }
final Attribute groupAtt = account.getAll(schema.accountMemberField); final Attribute groupAtt = account.getAll(schema.accountMemberField);

View File

@@ -162,7 +162,6 @@ public class Submit implements RestModifyView<RevisionResource, Input>,
*/ */
public ChangeMessage getConflictMessage(RevisionResource rsrc) public ChangeMessage getConflictMessage(RevisionResource rsrc)
throws OrmException { throws OrmException {
final Timestamp before = rsrc.getChange().getLastUpdatedOn();
ChangeMessage msg = Iterables.getFirst(Iterables.filter( ChangeMessage msg = Iterables.getFirst(Iterables.filter(
Lists.reverse(dbProvider.get().changeMessages() Lists.reverse(dbProvider.get().changeMessages()
.byChange(rsrc.getChange().getId()) .byChange(rsrc.getChange().getId())
@@ -170,8 +169,7 @@ public class Submit implements RestModifyView<RevisionResource, Input>,
new Predicate<ChangeMessage>() { new Predicate<ChangeMessage>() {
@Override @Override
public boolean apply(ChangeMessage input) { public boolean apply(ChangeMessage input) {
return input.getAuthor() == null return input.getAuthor() == null;
&& input.getWrittenOn().getTime() >= before.getTime();
} }
}), null); }), null);
return msg; return msg;