| | |
| | |
|
| | | import com.gitblit.Constants;
|
| | | import com.gitblit.Constants.AccessPermission;
|
| | | import com.gitblit.Constants.AuthorizationControl;
|
| | | import com.gitblit.Keys;
|
| | | import com.gitblit.git.PatchsetCommand;
|
| | | import com.gitblit.git.PatchsetReceivePack;
|
| | |
| | | * RESPONSIBLE LIST
|
| | | */
|
| | | Set<String> userlist = new TreeSet<String>(ticket.getParticipants());
|
| | | for (RegistrantAccessPermission rp : app().repositories().getUserAccessPermissions(getRepositoryModel())) {
|
| | | if (rp.permission.atLeast(AccessPermission.PUSH) && !rp.isTeam()) {
|
| | | userlist.add(rp.registrant);
|
| | | if (UserModel.ANONYMOUS.canPush(getRepositoryModel())
|
| | | || AuthorizationControl.AUTHENTICATED == getRepositoryModel().authorizationControl) {
|
| | | // authorization is ANONYMOUS or AUTHENTICATED (i.e. all users can be set responsible)
|
| | | userlist.addAll(app().users().getAllUsernames());
|
| | | } else {
|
| | | // authorization is by NAMED users (users with PUSH permission can be set responsible)
|
| | | for (RegistrantAccessPermission rp : app().repositories().getUserAccessPermissions(getRepositoryModel())) {
|
| | | if (rp.permission.atLeast(AccessPermission.PUSH)) {
|
| | | userlist.add(rp.registrant);
|
| | | }
|
| | | }
|
| | | }
|
| | | List<TicketResponsible> responsibles = new ArrayList<TicketResponsible>();
|
| | |
| | | Fragment patchsetFrag = new Fragment("patchset", "patchsetFragment", this);
|
| | | patchsetFrag.add(new Label("commitsInPatchset", MessageFormat.format(getString("gb.commitsInPatchsetN"), currentPatchset.number)));
|
| | |
|
| | | // current revision
|
| | | MarkupContainer panel = createPatchsetPanel("panel", repository, user);
|
| | | patchsetFrag.add(panel);
|
| | | addUserAttributions(patchsetFrag, currentRevision, avatarWidth);
|
| | | addUserAttributions(panel, currentRevision, 0);
|
| | | addDateAttributions(panel, currentRevision);
|
| | | patchsetFrag.add(createMergePanel(user, repository));
|
| | |
|
| | | if (ticket.isOpen()) {
|
| | | // current revision
|
| | | MarkupContainer panel = createPatchsetPanel("panel", repository, user);
|
| | | patchsetFrag.add(panel);
|
| | | addUserAttributions(patchsetFrag, currentRevision, avatarWidth);
|
| | | addUserAttributions(panel, currentRevision, 0);
|
| | | addDateAttributions(panel, currentRevision);
|
| | | } else {
|
| | | // current revision
|
| | | patchsetFrag.add(new Label("panel").setVisible(false));
|
| | | }
|
| | |
|
| | | // commits
|
| | | List<RevCommit> commits = JGitUtils.getRevLog(getRepository(), currentPatchset.base, currentPatchset.tip);
|
| | |
| | |
|
| | | addPtCheckoutInstructions(user, repository, panel);
|
| | | addGitCheckoutInstructions(user, repository, panel);
|
| | | panel.add(createMergePanel(user, repository));
|
| | |
|
| | | return panel;
|
| | | }
|