[Notice] Announcing the End of Demo Server [Read me]
dependency: Update jgit and play
Play: 2.3.6 -> 2.3.10 jgit: 3.5 -> 4.5
@f3240682db9e627638ee3542ff786dbdb6abcb94
--- app/Global.java
+++ app/Global.java
... | ... | @@ -27,7 +27,6 @@ |
27 | 27 |
import mailbox.MailboxService; |
28 | 28 |
import models.*; |
29 | 29 |
import org.apache.commons.lang3.StringUtils; |
30 |
-import org.apache.http.impl.cookie.DateUtils; |
|
31 | 30 |
import play.Application; |
32 | 31 |
import play.Configuration; |
33 | 32 |
import play.GlobalSettings; |
... | ... | @@ -58,7 +57,9 @@ |
58 | 57 |
import java.nio.file.Path; |
59 | 58 |
import java.nio.file.Paths; |
60 | 59 |
import java.security.SecureRandom; |
61 |
-import java.util.Date; |
|
60 |
+import java.time.ZoneId; |
|
61 |
+import java.time.ZonedDateTime; |
|
62 |
+import java.time.format.DateTimeFormatter; |
|
62 | 63 |
|
63 | 64 |
import static play.data.Form.form; |
64 | 65 |
import static play.mvc.Results.badRequest; |
... | ... | @@ -185,7 +186,7 @@ |
185 | 186 |
} catch (Exception e) { |
186 | 187 |
play.Logger.warn("Failed to update the preferred language", e); |
187 | 188 |
} |
188 |
- ctx.response().setHeader("Date", DateUtils.formatDate(new Date())); |
|
189 |
+ ctx.response().setHeader("Date", DateTimeFormatter.RFC_1123_DATE_TIME.format(ZonedDateTime.now(ZoneId.of("GMT")))); |
|
189 | 190 |
ctx.response().setHeader("Cache-Control", "no-cache"); |
190 | 191 |
Promise<Result> promise = delegate.call(ctx); |
191 | 192 |
AccessLogger.log(request, promise, start); |
--- app/models/PullRequest.java
+++ app/models/PullRequest.java
... | ... | @@ -434,7 +434,7 @@ |
434 | 434 |
String refName = getNameOfRefToMerged(); |
435 | 435 |
RevCommit commit = null; |
436 | 436 |
try { |
437 |
- ObjectId objectId = getRepository().getRef(refName).getObjectId(); |
|
437 |
+ ObjectId objectId = getRepository().findRef(refName).getObjectId(); |
|
438 | 438 |
commit = new RevWalk(getRepository()).parseCommit(objectId); |
439 | 439 |
} catch (Exception e) { |
440 | 440 |
play.Logger.info("Failed to get the merged branch", e); |
... | ... | @@ -471,7 +471,7 @@ |
471 | 471 |
ObjectInserter inserter = getRepository().newObjectInserter(); |
472 | 472 |
mergeCommitId = inserter.insert(mergeCommit); |
473 | 473 |
inserter.flush(); |
474 |
- inserter.release(); |
|
474 |
+ inserter.close(); |
|
475 | 475 |
|
476 | 476 |
return new MergeRefUpdate(mergeCommitId, whoMerges); |
477 | 477 |
} |
--- app/playRepository/BareCommit.java
+++ app/playRepository/BareCommit.java
... | ... | @@ -89,7 +89,7 @@ |
89 | 89 |
} catch (OverlappingFileLockException e) { |
90 | 90 |
play.Logger.error("Overlapping File Lock Error: " + e.getMessage()); |
91 | 91 |
} finally { |
92 |
- objectInserter.release(); |
|
92 |
+ objectInserter.close(); |
|
93 | 93 |
repository.close(); |
94 | 94 |
refHeadFileLock.release(); |
95 | 95 |
} |
... | ... | @@ -193,7 +193,7 @@ |
193 | 193 |
} |
194 | 194 |
|
195 | 195 |
private boolean hasOldCommit(String refName) throws IOException { |
196 |
- return this.repository.getRef(refName).getObjectId() != null; |
|
196 |
+ return this.repository.findRef(refName).getObjectId() != null; |
|
197 | 197 |
} |
198 | 198 |
|
199 | 199 |
private PersonIdent getPersonIdent() { |
... | ... | @@ -215,18 +215,18 @@ |
215 | 215 |
} |
216 | 216 |
|
217 | 217 |
public void setHeadObjectId(String refName) throws IOException { |
218 |
- if(this.repository.getRef(refName).getObjectId() == null){ |
|
218 |
+ if(this.repository.findRef(refName).getObjectId() == null){ |
|
219 | 219 |
this.headObjectId = ObjectId.zeroId(); |
220 | 220 |
} else { |
221 |
- this.headObjectId = this.repository.getRef(refName).getObjectId(); |
|
221 |
+ this.headObjectId = this.repository.findRef(refName).getObjectId(); |
|
222 | 222 |
} |
223 | 223 |
} |
224 | 224 |
|
225 | 225 |
public ObjectId getCurrentMomentHeadObjectId() throws IOException { |
226 |
- if( this.repository.getRef(refName).getObjectId() == null ){ |
|
226 |
+ if( this.repository.findRef(refName).getObjectId() == null ){ |
|
227 | 227 |
return ObjectId.zeroId(); |
228 | 228 |
} else { |
229 |
- return this.repository.getRef(refName).getObjectId(); |
|
229 |
+ return this.repository.findRef(refName).getObjectId(); |
|
230 | 230 |
} |
231 | 231 |
} |
232 | 232 |
|
... | ... | @@ -245,7 +245,7 @@ |
245 | 245 |
} |
246 | 246 |
|
247 | 247 |
refHeadFile = new File(repository.getDirectory().getPath(), |
248 |
- repository.getRef(refName).getLeaf().getName()); |
|
248 |
+ repository.findRef(refName).getLeaf().getName()); |
|
249 | 249 |
if(refHeadFile.exists()){ |
250 | 250 |
channel = new RandomAccessFile(refHeadFile, "rw").getChannel(); |
251 | 251 |
lock = channel.lock(); |
--- app/playRepository/BareRepository.java
+++ app/playRepository/BareRepository.java
... | ... | @@ -76,7 +76,7 @@ |
76 | 76 |
|
77 | 77 |
public static ObjectId getFileObjectId(Repository repository, String fileNameWithPath) throws IOException { |
78 | 78 |
TreeWalk treeWalk = new TreeWalk(repository); |
79 |
- RevTree revTree = getRevTreeFromRef(repository, repository.getRef(HEAD)); |
|
79 |
+ RevTree revTree = getRevTreeFromRef(repository, repository.findRef(HEAD)); |
|
80 | 80 |
if( revTree == null ){ |
81 | 81 |
return ObjectId.zeroId(); |
82 | 82 |
} |
... | ... | @@ -88,7 +88,7 @@ |
88 | 88 |
|
89 | 89 |
private static ObjectId getFirstFoundREADMEfileObjectId(Repository repository) throws IOException { |
90 | 90 |
TreeWalk treeWalk = new TreeWalk(repository); |
91 |
- RevTree revTree = getRevTreeFromRef(repository, repository.getRef(HEAD)); |
|
91 |
+ RevTree revTree = getRevTreeFromRef(repository, repository.findRef(HEAD)); |
|
92 | 92 |
if( revTree == null ){ |
93 | 93 |
return ObjectId.zeroId(); |
94 | 94 |
} |
--- app/playRepository/GitRepository.java
+++ app/playRepository/GitRepository.java
... | ... | @@ -38,10 +38,14 @@ |
38 | 38 |
import org.eclipse.jgit.api.Git; |
39 | 39 |
import org.eclipse.jgit.api.LogCommand; |
40 | 40 |
import org.eclipse.jgit.api.errors.GitAPIException; |
41 |
+import org.eclipse.jgit.attributes.AttributesNode; |
|
42 |
+import org.eclipse.jgit.attributes.AttributesNodeProvider; |
|
43 |
+import org.eclipse.jgit.attributes.AttributesRule; |
|
41 | 44 |
import org.eclipse.jgit.blame.BlameResult; |
42 | 45 |
import org.eclipse.jgit.diff.*; |
43 | 46 |
import org.eclipse.jgit.diff.Edit.Type; |
44 | 47 |
import org.eclipse.jgit.errors.MissingObjectException; |
48 |
+import org.eclipse.jgit.internal.storage.dfs.DfsRepository; |
|
45 | 49 |
import org.eclipse.jgit.lib.*; |
46 | 50 |
import org.eclipse.jgit.lib.RefUpdate.Result; |
47 | 51 |
import org.eclipse.jgit.revwalk.RevCommit; |
... | ... | @@ -59,15 +63,13 @@ |
59 | 63 |
import org.eclipse.jgit.util.io.NullOutputStream; |
60 | 64 |
import org.tmatesoft.svn.core.SVNException; |
61 | 65 |
import play.Logger; |
66 |
+import play.api.Play; |
|
62 | 67 |
import play.libs.Json; |
63 | 68 |
import utils.FileUtil; |
64 | 69 |
import utils.GravatarUtil; |
65 | 70 |
|
66 | 71 |
import javax.naming.LimitExceededException; |
67 |
-import java.io.ByteArrayOutputStream; |
|
68 |
-import java.io.File; |
|
69 |
-import java.io.FileNotFoundException; |
|
70 |
-import java.io.IOException; |
|
72 |
+import java.io.*; |
|
71 | 73 |
import java.nio.file.*; |
72 | 74 |
import java.nio.file.attribute.BasicFileAttributes; |
73 | 75 |
import java.util.*; |
... | ... | @@ -1110,7 +1112,7 @@ |
1110 | 1112 |
diffFormatter.setDetectRenames(true); |
1111 | 1113 |
return diffFormatter.scan(commitA, commitB); |
1112 | 1114 |
} finally { |
1113 |
- diffFormatter.release(); |
|
1115 |
+ diffFormatter.close(); |
|
1114 | 1116 |
} |
1115 | 1117 |
} |
1116 | 1118 |
|
... | ... | @@ -1148,7 +1150,7 @@ |
1148 | 1150 |
.setStartCommit(start).call(); |
1149 | 1151 |
return getAuthorsFromBlameResult(edits, blameResult); |
1150 | 1152 |
} finally { |
1151 |
- diffFormatter.release(); |
|
1153 |
+ diffFormatter.close(); |
|
1152 | 1154 |
} |
1153 | 1155 |
} |
1154 | 1156 |
|
... | ... | @@ -1269,7 +1271,7 @@ |
1269 | 1271 |
RevWalk revWalk = new RevWalk(fromRepo); |
1270 | 1272 |
RevCommit commit = revWalk.parseCommit(fromRepo.resolve(branchName)); |
1271 | 1273 |
String commitName = commit.name(); // fromBranch's head commit name |
1272 |
- revWalk.release(); |
|
1274 |
+ revWalk.close(); |
|
1273 | 1275 |
|
1274 | 1276 |
// check whether the target repository has the commit witch is the fromBranch's head commit. |
1275 | 1277 |
Repository toRepo = buildGitRepository(pullRequest.toProject); |
... | ... | @@ -1310,7 +1312,7 @@ |
1310 | 1312 |
throw new RuntimeException(e); |
1311 | 1313 |
} finally { |
1312 | 1314 |
if(revWalk != null) { |
1313 |
- revWalk.release(); |
|
1315 |
+ revWalk.close(); |
|
1314 | 1316 |
} |
1315 | 1317 |
if(repo != null) { |
1316 | 1318 |
repo.close(); |
... | ... | @@ -1506,6 +1508,11 @@ |
1506 | 1508 |
} |
1507 | 1509 |
return union; |
1508 | 1510 |
} |
1511 |
+ |
|
1512 |
+ @Override |
|
1513 |
+ public void close() { |
|
1514 |
+ play.Logger.warn("MultipleRepositoryObjectReader#close - Not implemented method but called!"); |
|
1515 |
+ } |
|
1509 | 1516 |
} |
1510 | 1517 |
|
1511 | 1518 |
final MultipleRepositoryObjectReader reader = new MultipleRepositoryObjectReader(); |
... | ... | @@ -1536,6 +1543,11 @@ |
1536 | 1543 |
} |
1537 | 1544 |
|
1538 | 1545 |
@Override |
1546 |
+ public AttributesNodeProvider createAttributesNodeProvider() { |
|
1547 |
+ return new EmptyAttributesNodeProvider(); |
|
1548 |
+ } |
|
1549 |
+ |
|
1550 |
+ @Override |
|
1539 | 1551 |
public void scanForRepoChanges() throws IOException { |
1540 | 1552 |
throw new UnsupportedOperationException(); |
1541 | 1553 |
} |
... | ... | @@ -1552,6 +1564,32 @@ |
1552 | 1564 |
|
1553 | 1565 |
public ObjectReader newObjectReader() { |
1554 | 1566 |
return reader; |
1567 |
+ } |
|
1568 |
+ |
|
1569 |
+ // Borrowed from org.eclipse.jgit.internal.storage.dfs.DfsRepository |
|
1570 |
+ class EmptyAttributesNodeProvider implements AttributesNodeProvider { |
|
1571 |
+ private EmptyAttributesNodeProvider.EmptyAttributesNode emptyAttributesNode |
|
1572 |
+ = new EmptyAttributesNodeProvider.EmptyAttributesNode(); |
|
1573 |
+ |
|
1574 |
+ public AttributesNode getInfoAttributesNode() throws IOException { |
|
1575 |
+ return emptyAttributesNode; |
|
1576 |
+ } |
|
1577 |
+ |
|
1578 |
+ public AttributesNode getGlobalAttributesNode() throws IOException { |
|
1579 |
+ return emptyAttributesNode; |
|
1580 |
+ } |
|
1581 |
+ |
|
1582 |
+ class EmptyAttributesNode extends AttributesNode { |
|
1583 |
+ |
|
1584 |
+ public EmptyAttributesNode() { |
|
1585 |
+ super(Collections.<AttributesRule> emptyList()); |
|
1586 |
+ } |
|
1587 |
+ |
|
1588 |
+ @Override |
|
1589 |
+ public void parse(InputStream in) throws IOException { |
|
1590 |
+ // Do nothing |
|
1591 |
+ } |
|
1592 |
+ } |
|
1555 | 1593 |
} |
1556 | 1594 |
}; |
1557 | 1595 |
|
... | ... | @@ -1791,7 +1829,7 @@ |
1791 | 1829 |
|
1792 | 1830 |
@Override |
1793 | 1831 |
public String getDefaultBranch() throws IOException { |
1794 |
- return repository.getRef(Constants.HEAD).getTarget().getName(); |
|
1832 |
+ return repository.findRef(Constants.HEAD).getTarget().getName(); |
|
1795 | 1833 |
} |
1796 | 1834 |
|
1797 | 1835 |
@Override |
--- app/utils/diff_match_patch.java
+++ app/utils/diff_match_patch.java
... | ... | @@ -1761,6 +1761,7 @@ |
1761 | 1761 |
* @return LinkedList of Patch objects. |
1762 | 1762 |
* @deprecated Prefer patch_make(String text1, LinkedList<Diff> diffs). |
1763 | 1763 |
*/ |
1764 |
+ @Deprecated |
|
1764 | 1765 |
public LinkedList<Patch> patch_make(String text1, String text2, |
1765 | 1766 |
LinkedList<Diff> diffs) { |
1766 | 1767 |
return patch_make(text1, diffs); |
... | ... | @@ -2311,6 +2312,11 @@ |
2311 | 2312 |
return false; |
2312 | 2313 |
} |
2313 | 2314 |
} |
2315 |
+ |
|
2316 |
+ @Override |
|
2317 |
+ public int hashCode() { |
|
2318 |
+ return super.hashCode(); |
|
2319 |
+ } |
|
2314 | 2320 |
} |
2315 | 2321 |
|
2316 | 2322 |
|
--- build.sbt
+++ build.sbt
... | ... | @@ -16,13 +16,12 @@ |
16 | 16 |
"com.h2database" % "h2" % "1.3.176", |
17 | 17 |
// JDBC driver for mariadb |
18 | 18 |
"org.mariadb.jdbc" % "mariadb-java-client" % "1.3.6", |
19 |
- "net.contentobjects.jnotify" % "jnotify" % "0.94", |
|
20 | 19 |
// Core Library |
21 |
- "org.eclipse.jgit" % "org.eclipse.jgit" % "3.5.3.201412180710-r", |
|
20 |
+ "org.eclipse.jgit" % "org.eclipse.jgit" % "4.5.0.201609210915-r", |
|
22 | 21 |
// Smart HTTP Servlet |
23 |
- "org.eclipse.jgit" % "org.eclipse.jgit.http.server" % "3.5.3.201412180710-r", |
|
24 |
- // Symlink support for Java7 |
|
25 |
- "org.eclipse.jgit" % "org.eclipse.jgit.java7" % "3.5.3.201412180710-r", |
|
22 |
+ "org.eclipse.jgit" % "org.eclipse.jgit.http.server" % "4.5.0.201609210915-r", |
|
23 |
+ // JGit Large File Storage |
|
24 |
+ "org.eclipse.jgit" % "org.eclipse.jgit.lfs" % "4.5.0.201609210915-r", |
|
26 | 25 |
// svnkit |
27 | 26 |
"org.tmatesoft.svnkit" % "svnkit" % "1.8.12", |
28 | 27 |
// svnkit-dav |
... | ... | @@ -54,7 +53,8 @@ |
54 | 53 |
|
55 | 54 |
val projectSettings = Seq( |
56 | 55 |
// Add your own project settings here |
57 |
- resolvers += "jgit-repository" at "http://download.eclipse.org/jgit/maven", |
|
56 |
+ resolvers += "jgit-repository" at "https://repo.eclipse.org/content/groups/releases/", |
|
57 |
+ resolvers += "java-semVer" at "http://oss.sonatype.org/content/repositories/snapshots/", |
|
58 | 58 |
resolvers += "scm-manager release repository" at "http://maven.scm-manager.org/nexus/content/groups/public", |
59 | 59 |
resolvers += "tmatesoft release repository" at "http://maven.tmatesoft.com/content/repositories/releases", |
60 | 60 |
resolvers += "julienrf.github.com" at "http://julienrf.github.com/repo/", |
... | ... | @@ -124,3 +124,6 @@ |
124 | 124 |
</FindBugsFilter> |
125 | 125 |
) |
126 | 126 |
) |
127 |
+ |
|
128 |
+ |
|
129 |
+fork in run := true(No newline at end of file) |
--- project/plugins.sbt
+++ project/plugins.sbt
... | ... | @@ -5,7 +5,7 @@ |
5 | 5 |
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/" |
6 | 6 |
|
7 | 7 |
// Use the Play sbt plugin for Play projects |
8 |
-addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.6") |
|
8 |
+addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.10") |
|
9 | 9 |
|
10 | 10 |
// Dependency graph plugin |
11 | 11 |
addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.7.4") |
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?