diff options
author | Shawn Pearce <sop@google.com> | 2013-06-13 21:49:46 -0700 |
---|---|---|
committer | Shawn Pearce <sop@google.com> | 2013-06-13 21:49:46 -0700 |
commit | 734671c5d05dc26494af76ec95e21fd1e332df5d (patch) | |
tree | 6a8dce92d64c3a79312a24e3e751a2089a15a070 /gerrit-httpd | |
parent | 54ef7366c3cd8b179bd99813ea8d0aaec0bc6e8f (diff) | |
parent | 2f1ce34eb2db4fbc75884f2b866738ae810c9b39 (diff) |
Merge branch 'stable-2.6' into stable-2.7
* stable-2.6:
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-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeScreen.java
Change-Id: I81caac73d26869f7be875118cc1e312a54e43a07
Diffstat (limited to 'gerrit-httpd')
-rw-r--r-- | gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/patch/PatchScriptFactory.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/patch/PatchScriptFactory.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/patch/PatchScriptFactory.java index e0ec4654c1..797229c992 100644 --- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/patch/PatchScriptFactory.java +++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/patch/PatchScriptFactory.java @@ -138,6 +138,11 @@ class PatchScriptFactory extends Handler<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); @@ -232,6 +237,9 @@ class PatchScriptFactory extends Handler<PatchScript> { // proper rename detection between the patch sets. // for (final PatchSet ps : db.patchSets().byChange(changeId)) { + if (!control.isPatchVisible(ps, db)) { + continue; + } String name = patchKey.get(); if (psa != null) { switch (changeType) { |