@@ -222,39 +222,9 @@ public void setProxy(String host, int port, String proxyUser, String proxyPasswo
222
222
authManager .setProxy (host , port , proxyUser , proxyPassword .toCharArray ());
223
223
}
224
224
225
- @ Override
226
- public String getFileContentFromBranch (String branchName , String filePath ) throws EVCSFileNotFound {
227
- return getFileContent (branchName , filePath , null );
228
- }
229
225
230
226
@ Override
231
- public String getFileContentFromRevision (String revision , String filePath ) throws EVCSFileNotFound {
232
- final String [] branchNames = new String [1 ];
233
- ISVNLogEntryHandler handler = new ISVNLogEntryHandler () {
234
- @ Override
235
- public void handleLogEntry (SVNLogEntry arg0 ) throws SVNException {
236
- Map <String , SVNLogEntryPath > map = arg0 .getChangedPaths ();
237
- for (Map .Entry <String , SVNLogEntryPath > entry : map .entrySet ()) {
238
- if (branchNames [0 ] == null ) {
239
- SVNLogEntryPath svnLogEntryPath = entry .getValue ();
240
- branchNames [0 ] = svnLogEntryPath .getPath ().replace (filePath , "" ).replaceFirst ("/" , "" );
241
- }
242
- }
243
- }
244
- };
245
-
246
- try {
247
- repository .log (new String [] {"" }, Long .parseLong (revision ), Long .parseLong (revision ), true , true , 1 , handler );
248
- return getFileContent (branchNames [0 ].equals (MASTER_PATH ) ? null : branchNames [0 ], filePath , revision );
249
- } catch (SVNException e ) {
250
- throw new EVCSException (e );
251
-
252
- } catch (Exception e ) {
253
- throw new RuntimeException (e );
254
- }
255
- }
256
-
257
- private String getFileContent (String branchName , String filePath , String revision ) {
227
+ public String getFileContent (String branchName , String filePath , String revision ) {
258
228
ByteArrayOutputStream baos = new ByteArrayOutputStream ();
259
229
try {
260
230
repository .getFile (new File (getBranchName (branchName ), filePath ).getPath ().replace ("\\ " , "/" ),
@@ -269,7 +239,7 @@ private String getFileContent(String branchName, String filePath, String revisio
269
239
} catch (SVNException e1 ) {
270
240
throw new EVCSException (e1 );
271
241
}
272
- throw new EVCSFileNotFound (getRepoUrl (), filePath , revision );
242
+ throw new EVCSFileNotFound (getRepoUrl (), getBranchName ( branchName ), filePath , revision );
273
243
}
274
244
throw new EVCSException (e );
275
245
} catch (Exception e ) {
0 commit comments