| | |
| | | import com.gitblit.models.PathModel.PathChangeModel;
|
| | | import com.gitblit.models.RegistrantAccessPermission;
|
| | | import com.gitblit.models.RepositoryModel;
|
| | | import com.gitblit.models.RepositoryUrl;
|
| | | import com.gitblit.models.SubmoduleModel;
|
| | | import com.gitblit.models.TicketModel;
|
| | | import com.gitblit.models.TicketModel.Change;
|
| | |
| | | import com.gitblit.tickets.TicketLabel;
|
| | | import com.gitblit.tickets.TicketMilestone;
|
| | | import com.gitblit.tickets.TicketResponsible;
|
| | | import com.gitblit.utils.ArrayUtils;
|
| | | import com.gitblit.utils.JGitUtils;
|
| | | import com.gitblit.utils.JGitUtils.MergeStatus;
|
| | | import com.gitblit.utils.MarkdownUtils;
|
| | |
| | | */
|
| | | if (currentPatchset == null) {
|
| | | // no patchset available
|
| | | if (ticket.isOpen() && app().tickets().isAcceptingNewPatchsets(repository)) {
|
| | | String repoUrl = getRepositoryUrl(user, repository);
|
| | | if (ticket.isOpen() && app().tickets().isAcceptingNewPatchsets(repository) && !StringUtils.isEmpty(repoUrl)) {
|
| | | // ticket & repo will accept a proposal patchset
|
| | | // show the instructions for proposing a patchset
|
| | | String repoUrl = getRepositoryUrl(user, repository);
|
| | | Fragment changeIdFrag = new Fragment("patchset", "proposeFragment", this);
|
| | | changeIdFrag.add(new Label("proposeInstructions", MarkdownUtils.transformMarkdown(getString("gb.proposeInstructions"))).setEscapeModelStrings(false));
|
| | | changeIdFrag.add(new Label("ptWorkflow", MessageFormat.format(getString("gb.proposeWith"), "Barnum")));
|
| | |
| | | String displayPath = entry.path;
|
| | | String path = entry.path;
|
| | | if (entry.isSymlink()) {
|
| | | RevCommit commit = JGitUtils.getCommit(getRepository(), Constants.R_TICKETS_PATCHSETS + ticket.number);
|
| | | RevCommit commit = JGitUtils.getCommit(getRepository(), PatchsetCommand.getTicketBranch(ticket.number));
|
| | | path = JGitUtils.getStringContent(getRepository(), commit.getTree(), path);
|
| | | displayPath = entry.path + " -> " + path;
|
| | | }
|
| | |
| | | */
|
| | | protected String getRepositoryUrl(UserModel user, RepositoryModel repository) {
|
| | | HttpServletRequest req = ((WebRequest) getRequest()).getHttpServletRequest();
|
| | | String primaryurl = app().gitblit().getRepositoryUrls(req, user, repository).get(0).url;
|
| | | List<RepositoryUrl> urls = app().gitblit().getRepositoryUrls(req, user, repository);
|
| | | if (ArrayUtils.isEmpty(urls)) {
|
| | | return null;
|
| | | }
|
| | | String primaryurl = urls.get(0).url;
|
| | | String url = primaryurl;
|
| | | try {
|
| | | url = new URIish(primaryurl).setUser(null).toString();
|