
Merge branch 'fix/incorrectly-selected-branch' into 'next'
from pull-request 1514 * refs/heads/fix/incorrectly-selected-branch: code: Do not show selected branch for a commit code: Rename getBranchNames() to getRefNames() Reviewed-by: 백기선
@20e407664eced9eca260a9ff94e6544db541d782
--- app/controllers/CodeApp.java
+++ app/controllers/CodeApp.java
... | ... | @@ -94,7 +94,7 @@ |
94 | 94 |
path = HttpUtil.decodePathSegment(path); |
95 | 95 |
|
96 | 96 |
PlayRepository repository = RepositoryService.getRepository(project); |
97 |
- List<String> branches = repository.getBranchNames(); |
|
97 |
+ List<String> branches = repository.getRefNames(); |
|
98 | 98 |
List<ObjectNode> recursiveData = RepositoryService.getMetaDataFromAncestorDirectories( |
99 | 99 |
repository, branch, path); |
100 | 100 |
|
--- app/controllers/ProjectApp.java
+++ app/controllers/ProjectApp.java
... | ... | @@ -169,7 +169,7 @@ |
169 | 169 |
Project project = Project.findByOwnerAndProjectName(ownerId, projectName); |
170 | 170 |
Form<Project> projectForm = form(Project.class).fill(project); |
171 | 171 |
PlayRepository repository = RepositoryService.getRepository(project); |
172 |
- return ok(setting.render("title.projectSetting", projectForm, project, repository.getBranchNames())); |
|
172 |
+ return ok(setting.render("title.projectSetting", projectForm, project, repository.getRefNames())); |
|
173 | 173 |
} |
174 | 174 |
|
175 | 175 |
@Transactional |
... | ... | @@ -246,7 +246,7 @@ |
246 | 246 |
|
247 | 247 |
if (validateWhenUpdate(ownerId, filledUpdatedProjectForm)) { |
248 | 248 |
return badRequest(setting.render("title.projectSetting", |
249 |
- filledUpdatedProjectForm, project, repository.getBranchNames())); |
|
249 |
+ filledUpdatedProjectForm, project, repository.getRefNames())); |
|
250 | 250 |
} |
251 | 251 |
|
252 | 252 |
Project updatedProject = filledUpdatedProjectForm.get(); |
--- app/models/Project.java
+++ app/models/Project.java
... | ... | @@ -227,7 +227,7 @@ |
227 | 227 |
public Date lastUpdateDate() { |
228 | 228 |
try { |
229 | 229 |
PlayRepository repository = RepositoryService.getRepository(this); |
230 |
- List<String> branches = repository.getBranchNames(); |
|
230 |
+ List<String> branches = repository.getRefNames(); |
|
231 | 231 |
if (!branches.isEmpty() && repository instanceof GitRepository) { |
232 | 232 |
GitRepository gitRepo = new GitRepository(owner, name); |
233 | 233 |
List<Commit> history = gitRepo.getHistory(0, 2, "HEAD", null); |
--- app/playRepository/GitRepository.java
+++ app/playRepository/GitRepository.java
... | ... | @@ -842,7 +842,7 @@ |
842 | 842 |
* @return a list of the name strings |
843 | 843 |
*/ |
844 | 844 |
@Override |
845 |
- public List<String> getBranchNames() { |
|
845 |
+ public List<String> getRefNames() { |
|
846 | 846 |
List<String> branches = new ArrayList<>(); |
847 | 847 |
|
848 | 848 |
for(String refName : repository.getAllRefs().keySet()) { |
... | ... | @@ -1821,7 +1821,7 @@ |
1821 | 1821 |
|
1822 | 1822 |
@Override |
1823 | 1823 |
public boolean isEmpty() { |
1824 |
- return this.getBranchNames().isEmpty(); |
|
1824 |
+ return this.getRefNames().isEmpty(); |
|
1825 | 1825 |
} |
1826 | 1826 |
|
1827 | 1827 |
/* |
--- app/playRepository/PlayRepository.java
+++ app/playRepository/PlayRepository.java
... | ... | @@ -56,7 +56,7 @@ |
56 | 56 |
|
57 | 57 |
public abstract Commit getCommit(String rev) throws IOException, SVNException; |
58 | 58 |
|
59 |
- public abstract List<String> getBranchNames(); |
|
59 |
+ public abstract List<String> getRefNames(); |
|
60 | 60 |
|
61 | 61 |
public abstract ObjectNode getMetaDataFromPath(String branch, String path) throws IOException, SVNException, GitAPIException; |
62 | 62 |
|
--- app/playRepository/SVNRepository.java
+++ app/playRepository/SVNRepository.java
... | ... | @@ -33,7 +33,6 @@ |
33 | 33 |
import org.eclipse.jgit.diff.RawText; |
34 | 34 |
import org.joda.time.format.DateTimeFormatter; |
35 | 35 |
import org.joda.time.format.ISODateTimeFormat; |
36 |
-import org.tigris.subversion.javahl.ClientException; |
|
37 | 36 |
import org.tmatesoft.svn.core.*; |
38 | 37 |
import org.tmatesoft.svn.core.io.SVNRepositoryFactory; |
39 | 38 |
import org.tmatesoft.svn.core.wc.SVNClientManager; |
... | ... | @@ -146,7 +145,7 @@ |
146 | 145 |
@Override |
147 | 146 |
public ObjectNode getMetaDataFromPath(String branch, String path) throws |
148 | 147 |
IOException, SVNException { |
149 |
- List<String> branches = getBranchNames(); |
|
148 |
+ List<String> branches = getRefNames(); |
|
150 | 149 |
if (!branches.contains(branch)) { |
151 | 150 |
return null; |
152 | 151 |
} |
... | ... | @@ -299,7 +298,7 @@ |
299 | 298 |
} |
300 | 299 |
|
301 | 300 |
@Override |
302 |
- public List<String> getBranchNames() { |
|
301 |
+ public List<String> getRefNames() { |
|
303 | 302 |
ArrayList<String> branches = new ArrayList<>(); |
304 | 303 |
branches.add(SVNRevision.HEAD.getName()); |
305 | 304 |
return branches; |
--- app/views/code/diff.scala.html
+++ app/views/code/diff.scala.html
... | ... | @@ -36,17 +36,6 @@ |
36 | 36 |
<div class="page-wrap-outer"> |
37 | 37 |
<div class="project-page-wrap"> |
38 | 38 |
<div id="code-browse-wrap" class="code-browse-wrap"> |
39 |
- <select id="branches" data-toggle="select2" data-format="branch" data-dropdown-css-class="branches" class="pull-right"> |
|
40 |
- @defining(RepositoryService.getRepository(project).getBranchNames()) { branches => |
|
41 |
- @for(branchName <- branches){ |
|
42 |
- <option value="@routes.CodeHistoryApp.history(project.owner, project.name, URLEncoder.encode(branchName, "UTF-8"), null)" |
|
43 |
- @if(selectedBranch){ @if(branchItemName(branchName) == branchItemName(selectedBranch)){ selected } }> |
|
44 |
- @branchName |
|
45 |
- </option> |
|
46 |
- } |
|
47 |
- } |
|
48 |
- </select> |
|
49 |
- |
|
50 | 39 |
<ul class="nav nav-tabs" style="margin-bottom:20px;"> |
51 | 40 |
<li> |
52 | 41 |
<a href="@routes.CodeApp.codeBrowser(project.owner, project.name)">@Messages("code.files")</a> |
--- app/views/code/history.scala.html
+++ app/views/code/history.scala.html
... | ... | @@ -95,7 +95,7 @@ |
95 | 95 |
|
96 | 96 |
@if(path == null){ |
97 | 97 |
<select id="branches" data-toggle="select2" data-format="branch" data-dropdown-css-class="branches" class="pull-right"> |
98 |
- @defining(RepositoryService.getRepository(project).getBranchNames()) { branches => |
|
98 |
+ @defining(RepositoryService.getRepository(project).getRefNames()) { branches => |
|
99 | 99 |
@for(branchName <- branches){ |
100 | 100 |
<option value="@routes.CodeHistoryApp.history(project.owner, project.name, URLEncoder.encode(branchName, "UTF-8"), null)" |
101 | 101 |
@if(selectedBranch){ @if(branchItemName(branchName) == branchItemName(selectedBranch)){ selected } }> |
--- app/views/code/svnDiff.scala.html
+++ app/views/code/svnDiff.scala.html
... | ... | @@ -40,7 +40,7 @@ |
40 | 40 |
<span class="d-caret"><span class="caret"></span></span> |
41 | 41 |
</button> |
42 | 42 |
<ul class="dropdown-menu"> |
43 |
- @defining(RepositoryService.getRepository(project).getBranchNames()) { branches => |
|
43 |
+ @defining(RepositoryService.getRepository(project).getRefNames()) { branches => |
|
44 | 44 |
@for(branch <- branches){ |
45 | 45 |
@common.branchItem("history", project, branch, null, |
46 | 46 |
StringUtils.equals(branch, selectedBranch)) |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?