Merge branch 'stable-2.7'
* stable-2.7: Use user's full name even when email is not configured Only handle last value change event for attached change screens Update the 2.6 release notes Fixed: Draft patch sets are visible in diff screens Conflicts: gerrit-server/src/main/java/com/google/gerrit/server/patch/PatchScriptFactory.java Change-Id: I26fd898a92577444a33b2cb7459487562d78a0b8
This commit is contained in:
@@ -1192,7 +1192,7 @@ but was coming up black on initial page load due to a style setup
|
||||
ordering issue between the SearchPanel and the HintTextBox.
|
||||
|
||||
* link:https://code.google.com/p/gerrit/issues/detail?id=1661[Issue 1661]:
|
||||
Update links to Change-Id and Signed-off-by docu on project info
|
||||
Update links to Change-Id and Signed-off-by documentation on project info
|
||||
screen
|
||||
|
||||
* Use href="javascript;" for All {Side-by-Side,Unified} links
|
||||
@@ -1232,6 +1232,9 @@ Correctly handle paths with URL-escaped characters
|
||||
URL-unescape the path portion of a change history token to correctly
|
||||
handle paths with URL-escapable characters, i.e. '+', ' ', etc.
|
||||
|
||||
* link:https://code.google.com/p/gerrit/issues/detail?id=1915[Issue 1915]:
|
||||
Don't show non-visible drafts in the diff screens.
|
||||
|
||||
|
||||
REST API
|
||||
~~~~~~~~
|
||||
|
@@ -98,10 +98,11 @@ public class FromAddressGeneratorProvider implements
|
||||
@Override
|
||||
public Address from(final Account.Id fromId) {
|
||||
if (fromId != null) {
|
||||
final Account a = accountCache.get(fromId).getAccount();
|
||||
if (a.getPreferredEmail() != null) {
|
||||
return new Address(a.getFullName(), a.getPreferredEmail());
|
||||
}
|
||||
Account a = accountCache.get(fromId).getAccount();
|
||||
String userEmail = a.getPreferredEmail();
|
||||
return new Address(
|
||||
a.getFullName(),
|
||||
userEmail != null ? userEmail : srvAddr.getEmail());
|
||||
}
|
||||
return srvAddr;
|
||||
}
|
||||
|
@@ -126,6 +126,11 @@ public class PatchScriptFactory implements Callable<PatchScript> {
|
||||
aId = psa != null ? toObjectId(db, psa) : null;
|
||||
bId = toObjectId(db, psb);
|
||||
|
||||
if ((psa != null && !control.isPatchVisible(db.patchSets().get(psa), db)) ||
|
||||
(psb != null && !control.isPatchVisible(db.patchSets().get(psb), db))) {
|
||||
throw new NoSuchChangeException(changeId);
|
||||
}
|
||||
|
||||
final Repository git;
|
||||
try {
|
||||
git = repoManager.openRepository(projectKey);
|
||||
@@ -220,6 +225,9 @@ public class PatchScriptFactory implements Callable<PatchScript> {
|
||||
// proper rename detection between the patch sets.
|
||||
//
|
||||
for (final PatchSet ps : db.patchSets().byChange(changeId)) {
|
||||
if (!control.isPatchVisible(ps, db)) {
|
||||
continue;
|
||||
}
|
||||
String name = fileName;
|
||||
if (psa != null) {
|
||||
switch (changeType) {
|
||||
|
@@ -102,12 +102,13 @@ public class FromAddressGeneratorProviderTest extends TestCase {
|
||||
public void testUSER_NoPreferredEmailUser() {
|
||||
setFrom("USER");
|
||||
|
||||
final Account.Id user = user("A U. Thor", null);
|
||||
final String name = "A U. Thor";
|
||||
final Account.Id user = user(name, null);
|
||||
|
||||
replay(accountCache);
|
||||
final Address r = create().from(user);
|
||||
assertNotNull(r);
|
||||
assertEquals(ident.getName(), r.name);
|
||||
assertEquals(name, r.name);
|
||||
assertEquals(ident.getEmailAddress(), r.email);
|
||||
verify(accountCache);
|
||||
}
|
||||
|
Reference in New Issue
Block a user