From 44df7902a4779b028b40dfc49ae7014340b5f7b4 Mon Sep 17 00:00:00 2001 From: Stardrad Yin <yin8086@gmail.com> Date: Thu, 06 Mar 2014 21:03:42 -0500 Subject: [PATCH] fix some Chinese translations due to some special characters. --- src/main/java/com/gitblit/wicket/pages/TicketPage.java | 17 ++++++----------- 1 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/gitblit/wicket/pages/TicketPage.java b/src/main/java/com/gitblit/wicket/pages/TicketPage.java index 3f92eaa..69f4fe7 100644 --- a/src/main/java/com/gitblit/wicket/pages/TicketPage.java +++ b/src/main/java/com/gitblit/wicket/pages/TicketPage.java @@ -115,7 +115,6 @@ super(params); final UserModel user = GitBlitWebSession.get().getUser() == null ? UserModel.ANONYMOUS : GitBlitWebSession.get().getUser(); - final boolean isAuthenticated = !UserModel.ANONYMOUS.equals(user) && user.isAuthenticated; final RepositoryModel repository = getRepositoryModel(); final String id = WicketUtils.getObject(params); long ticketId = Long.parseLong(id); @@ -327,7 +326,7 @@ /* * UPDATE FORM (DISCUSSION TAB) */ - if (isAuthenticated && app().tickets().isAcceptingTicketUpdates(repository)) { + if (user.canEdit(ticket, repository) && app().tickets().isAcceptingTicketUpdates(repository)) { if (ticket.isOpen()) { /* * OPEN TICKET @@ -1255,16 +1254,13 @@ } protected void addGitReviewInstructions(UserModel user, RepositoryModel repository, MarkupContainer panel) { - String repoUrl = getRepositoryUrl(user, repository); - panel.add(new Label("gitStep1", MessageFormat.format(getString("gb.stepN"), 1))); panel.add(new Label("gitStep2", MessageFormat.format(getString("gb.stepN"), 2))); String ticketBranch = Repository.shortenRefName(PatchsetCommand.getTicketBranch(ticket.number)); - String reviewBranch = PatchsetCommand.getReviewBranch(ticket.number); - String step1 = MessageFormat.format("git fetch {0} {1}", repoUrl, ticketBranch); - String step2 = MessageFormat.format("git checkout -B {0} FETCH_HEAD", reviewBranch); + String step1 = "git fetch"; + String step2 = MessageFormat.format("git checkout {0} && git pull --ff-only\nOR\ngit checkout {0} && git reset --hard origin/{0}", ticketBranch); panel.add(new Label("gitPreStep1", step1)); panel.add(new Label("gitPreStep2", step2)); @@ -1418,7 +1414,6 @@ protected Component getMergeInstructions(UserModel user, RepositoryModel repository, String markupId, String infoKey) { Fragment cmd = new Fragment(markupId, "commandlineMergeFragment", this); cmd.add(new Label("instructions", MessageFormat.format(getString(infoKey), ticket.mergeTo))); - String repoUrl = getRepositoryUrl(user, repository); // git instructions cmd.add(new Label("mergeStep1", MessageFormat.format(getString("gb.stepN"), 1))); @@ -1428,9 +1423,9 @@ String ticketBranch = Repository.shortenRefName(PatchsetCommand.getTicketBranch(ticket.number)); String reviewBranch = PatchsetCommand.getReviewBranch(ticket.number); - String step1 = MessageFormat.format("git checkout -B {0} {1}", reviewBranch, ticket.mergeTo); - String step2 = MessageFormat.format("git pull {0} {1}", repoUrl, ticketBranch); - String step3 = MessageFormat.format("git checkout {0}\ngit merge {1}\ngit push origin {0}", ticket.mergeTo, reviewBranch); + String step1 = MessageFormat.format("git checkout -b {0} {1}", reviewBranch, ticket.mergeTo); + String step2 = MessageFormat.format("git pull origin {0}", ticketBranch); + String step3 = MessageFormat.format("git checkout {0}\ngit merge {1}\ngit push origin {0}\ngit branch -d {1}", ticket.mergeTo, reviewBranch); cmd.add(new Label("mergePreStep1", step1)); cmd.add(new Label("mergePreStep2", step2)); -- Gitblit v1.9.1