[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[Subclipse-users] ISVNClientAdapter.diff - how are the paths calculated?

From: Robert Munteanu <robert.munteanu_at_gmail.com>
Date: Sat, 3 May 2014 15:35:58 -0700 (PDT)

Hi,

I'm generating diffs for local files in a SVN checkout with

  svnClient.diff(file, SVNRevision.BASE, file, SVNRevision.WORKING, tmpFile, false);

When executed in an Eclipse plug-in, the Index/---/+++ lines reference the location of the file relative to the user's home, e.g.

Index: w/runtime-ereviewboard/simple-project/src/com/example/Logic.java
===================================================================
--- w/runtime-ereviewboard/simple-project/src/com/example/Logic.java (revision 1)
+++ w/runtime-ereviewboard/simple-project/src/com/example/Logic.java (working copy)

However, when I try to narrow this down using an unit test, the Index/---/+++ lines have an absolute file path set.

Index: /tmp/junit6497857066698301842/wc/dir/nested/first.txt
===================================================================
--- /tmp/junit6497857066698301842/wc/dir/nested/first.txt (revision 1)
+++ /tmp/junit6497857066698301842/wc/dir/nested/first.txt (working copy)

In the Eclipse plug-in, I get the svnClient from an ISVNRepositoryLocation ( see also [1] )

  ISVNRepositoryLocation svnRepository = _detectLocalChangesPage.getSvnRepositoryLocation();
  ISVNClientAdapter svnClient = svnRepository.getSVNClient();

The the unit test, I get it directly from the SVNProviderPlugin

  ISVNClientAdapter svnClient = SVNProviderPlugin.getPlugin().getSVNClient();

However, changing the Eclipse plug-in to use the same mechanism changed nothing ( not that I expected it to but ...). I initially tried using svnClient.createPatch to create the diff, but that had the same results.

I'm really confused as to why this difference appears, hopefully someone with more knowledge about the implementation can shed more light into this.

Thanks,

Robert

[1]: https://github.com/rombert/ereviewboard/blob/77e2cde9ea3baf0326f4d437811172b65f284514/org.review_board.ereviewboard.subclipse.ui/src/org/review_board/ereviewboard/subclipse/internal/wizards/PostReviewRequestWizard.java#L97

------------------------------------------------------
http://subclipse.tigris.org/ds/viewMessage.do?dsForumId=1047&dsMessageId=3077484

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subclipse.tigris.org].
Received on 2014-05-04 00:46:03 CEST

This is an archived mail posted to the Subclipse Users mailing list.