Get old revision of a renamed file cause problems

View: New views
4 Messages — Rating Filter:   Alert me  

Get old revision of a renamed file cause problems

by d1rk :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi!
We access the svn repository via http. There is a file called testNEU.xml which was renamed to testrename.xml. Now testrename.xml has the revision 574,572,571,570 and before revision 572 it was testNEU.xml

If we call getFile(filename, revision, fileProperties, baos) for revision 574 and 572 it works fine, but for revision 571 and 570 we get the following exception:
Caused by: org.tmatesoft.svn.core.SVNException: svn: '/svn/!svn/bc/571/Artikel/testrename.xml' path not found: 404 Not Found (http://ourserverip

If we open revision 571 or 570 with Subclipse it works fine.
Any idea ?

Re: Get old revision of a renamed file cause problems

by Alexander Kitaev-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

If you're using SVNRepository API, then you should first get path of a
file in particular revision and then use that file to get file contents.

Assuming you have file path at revision 574, and then would like to get
file contents at revision 570:

SVNRepository repos = SVNRepositoryFactory.create(fileParentURL);

Collection locations =
      repos.getLocations("testrename.xml", null, 574, new long[] {570});
SVNLocationEntry location = (SVNLocationEntry) locations.get(0);

// location will contain path of the file as it was at revision 570.
// location's revision will be 570.

repos.getFile(location.getPath(), location.getRevision(), prop, output);

 > If we open revision 571 or 570 with Subclipse it works fine.
 > Any idea ?
Subclipse, when it uses SVNKit, works with the higher-level API, which
internally performs necessary path discovery.

Alexander Kitaev,
TMate Software,
http://svnkit.com/ - Java [Sub]Versioning Library!

d1rk wrote:

> Hi!
> We access the svn repository via http. There is a file called testNEU.xml
> which was renamed to testrename.xml. Now testrename.xml has the revision
> 574,572,571,570 and before revision 572 it was testNEU.xml
>
> If we call getFile(filename, revision, fileProperties, baos) for revision
> 574 and 572 it works fine, but for revision 571 and 570 we get the following
> exception:
> Caused by: org.tmatesoft.svn.core.SVNException: svn:
> '/svn/!svn/bc/571/Artikel/testrename.xml' path not found: 404 Not Found
> (http://ourserverip
>
> If we open revision 571 or 570 with Subclipse it works fine.
> Any idea ?
>

---------------------------------------------------------------------
To unsubscribe, e-mail: svnkit-users-unsubscribe@...
For additional commands, e-mail: svnkit-users-help@...


Re: Get old revision of a renamed file cause problems

by d1rk :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Oh, thank you, that's it what I was looking for and now I understand how revisions and it's locations work.

Now I have another question, but I don't want to start a new topic.
We use the SVN low lvl API and work directly on the repository.
I will set an example:
A file "test" has revisions 600, 599 and 598, now I delete this file and add "test" again and it has revision 602.

We delete files with SVNCommitClient doDelete(...), I know that it is possible with ISVNEditor deleteEntry(...) too. By the way, what is the difference?
We get FileRevisions with repository.log, it works fine for copied and moved files.

If I do the log operation for file "test" with startrevision -1 or 602 I'll get only revision 602 as history.
If I do it with startrevision 600 I'll get the old revisions 600, 599 and 598.

The question is:
Is it possible to get all the revision without knowing the revision when a file was deleted? So do the log operation with -1 and get revisions 602,600,599 and 598?

Otherwise I must save filename and revision if I delete a file.

Thanks much!



Re: Get old revision of a renamed file cause problems

by Alexander Kitaev-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

 > The question is:
 > Is it possible to get all the revision without knowing the revision
when a
 > file was deleted? So do the log operation with -1 and get revisions
 > 602,600,599 and 598?
Unfortunately, this is not possible. Subversion treats those two files
as unrelated with separate history, despite those two files has the same
path in repository:

r1: A path/file.txt
r2: M path/file.txt
r3: M path/file.txt
r4: D path/file.txt
r5: A path/file.txt - this is new file, it has no relation to the
deleted one.

Also, deletion and addition could be performed in the same commit, in
that case it is called "replacement":

r3: M path/file.txt
r4: R path/file.txt - file.txt was deleted and new one created with the
same name.

Alexander Kitaev,
TMate Software,
http://svnkit.com/ - Java [Sub]Versioning Library!

d1rk wrote:

> Oh, thank you, that's it what I was looking for and now I understand how
> revisions and it's locations work.
>
> Now I have another question, but I don't want to start a new topic.
> We use the SVN low lvl API and work directly on the repository.
> I will set an example:
> A file "test" has revisions 600, 599 and 598, now I delete this file and add
> "test" again and it has revision 602.
>
> We delete files with SVNCommitClient doDelete(...), I know that it is
> possible with ISVNEditor deleteEntry(...) too. By the way, what is the
> difference?
> We get FileRevisions with repository.log, it works fine for copied and moved
> files.
>
> If I do the log operation for file "test" with startrevision -1 or 602 I'll
> get only revision 602 as history.
> If I do it with startrevision 600 I'll get the old revisions 600, 599 and
> 598.
>
> The question is:
> Is it possible to get all the revision without knowing the revision when a
> file was deleted? So do the log operation with -1 and get revisions
> 602,600,599 and 598?
>
> Otherwise I must save filename and revision if I delete a file.
>
> Thanks much!
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: svnkit-users-unsubscribe@...
For additional commands, e-mail: svnkit-users-help@...

LightInTheBox - Buy quality products at wholesale price!