How to get delta files between revisions.

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

How to get delta files between revisions.

by Xiaoyu Du :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, guys.

I have to tags in difference directory.
what I wanna do is :

1) get changes between tow revisions.
then determine the modified/add files
2) download these changed file to an empty directory
and compute checksum for each file.


To approach this, I first use DiffClient object to
got the changes files and stored them. and then used
SVNRepository.getFile method to download all
these files.

I know this is a stupid way and slow.

could any tell me if there are any other
ways to approach this?



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


Re: How to get delta files between revisions.

by Alexander Kitaev-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Xiaoyu,

I think you may do the following:

1. run diffClient.doDiffStatus (svn diff --summarize) to get list of
changed file.

2. for each file, call SVNRepository.getFile(...) to get its checksum:

DAVRepositoryFactory.setup();

SVNRepository repos =
SVNRepositoryFactory.create(SVNURL.parseURIEncoded("http://svn.svnkit.com/repos/svnkit/trunk"));

SVNProperties properties = SVNProperties.wrap(new HashMap());
repos.getFile("README.txt", -1, properties, null);
      System.out.println(properties.getStringValue(SVNProperty.CHECKSUM));

This will give you MD5 checksum.

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

Xiaoyu Du wrote:

> Hi, guys.
>
> I have to tags in difference directory.
> what I wanna do is :
>
> 1) get changes between tow revisions.
> then determine the modified/add files
> 2) download these changed file to an empty directory
> and compute checksum for each file.
>
>
> To approach this, I first use DiffClient object to
> got the changes files and stored them. and then used
> SVNRepository.getFile method to download all
> these files.
>
> I know this is a stupid way and slow.
>
> could any tell me if there are any other
> ways to approach this?
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: svnkit-users-unsubscribe@...
> For additional commands, e-mail: svnkit-users-help@...
>
>

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


Re: How to get delta files between revisions.

by Xiaoyu Du :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for your reply, you are so kind.

在 2009-10-21三的 17:27 +0200,Alexander Kitaev写道:

> Hello Xiaoyu,
>
> I think you may do the following:
>
> 1. run diffClient.doDiffStatus (svn diff --summarize) to get list of
> changed file.
>
> 2. for each file, call SVNRepository.getFile(...) to get its checksum:
>
> DAVRepositoryFactory.setup();
>
> SVNRepository repos =
> SVNRepositoryFactory.create(SVNURL.parseURIEncoded("http://svn.svnkit.com/repos/svnkit/trunk"));
>
> SVNProperties properties = SVNProperties.wrap(new HashMap());
> repos.getFile("README.txt", -1, properties, null);
>       System.out.println(properties.getStringValue(SVNProperty.CHECKSUM));
>
> This will give you MD5 checksum.
>
> Alexander Kitaev,
> TMate Software,
> http://svnkit.com/ - Java [Sub]Versioning Library!
> http://sqljet.com/ - Java SQLite Library!
>
> Xiaoyu Du wrote:
> > Hi, guys.
> >
> > I have to tags in difference directory.
> > what I wanna do is :
> >
> > 1) get changes between tow revisions.
> > then determine the modified/add files
> > 2) download these changed file to an empty directory
> > and compute checksum for each file.
> >
> >
> > To approach this, I first use DiffClient object to
> > got the changes files and stored them. and then used
> > SVNRepository.getFile method to download all
> > these files.
> >
> > I know this is a stupid way and slow.
> >
> > could any tell me if there are any other
> > ways to approach this?
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: svnkit-users-unsubscribe@...
> > For additional commands, e-mail: svnkit-users-help@...
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: svnkit-users-unsubscribe@...
> For additional commands, e-mail: svnkit-users-help@...
>
>
--
研发部
北京信诺瑞得信息技术有限公司
地址:北京市朝阳区建国路88号SOHO现代城C座909
手机:13718143257
电话:010-85804799
传真:010-85804800



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


Re: How to get delta files between revisions.

by Xiaoyu Du :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Now I hava another requirement.

I got an svn project copy without any .svn files or other svn
infomations(I use svn export command).
but now the svn repository has update. I want replace my exported copy
replaced by the newest repository. And I want to use my exported files
checksum to determine which file has updated or deleted ?
What should I do ?




在 2009-10-22四的 09:24 +0800,Xiaoyu Du写道:

> Thanks for your reply, you are so kind.
>
> 在 2009-10-21三的 17:27 +0200,Alexander Kitaev写道:
> > Hello Xiaoyu,
> >
> > I think you may do the following:
> >
> > 1. run diffClient.doDiffStatus (svn diff --summarize) to get list of
> > changed file.
> >
> > 2. for each file, call SVNRepository.getFile(...) to get its checksum:
> >
> > DAVRepositoryFactory.setup();
> >
> > SVNRepository repos =
> > SVNRepositoryFactory.create(SVNURL.parseURIEncoded("http://svn.svnkit.com/repos/svnkit/trunk"));
> >
> > SVNProperties properties = SVNProperties.wrap(new HashMap());
> > repos.getFile("README.txt", -1, properties, null);
> >       System.out.println(properties.getStringValue(SVNProperty.CHECKSUM));
> >
> > This will give you MD5 checksum.
> >
> > Alexander Kitaev,
> > TMate Software,
> > http://svnkit.com/ - Java [Sub]Versioning Library!
> > http://sqljet.com/ - Java SQLite Library!
> >
> > Xiaoyu Du wrote:
> > > Hi, guys.
> > >
> > > I have to tags in difference directory.
> > > what I wanna do is :
> > >
> > > 1) get changes between tow revisions.
> > > then determine the modified/add files
> > > 2) download these changed file to an empty directory
> > > and compute checksum for each file.
> > >
> > >
> > > To approach this, I first use DiffClient object to
> > > got the changes files and stored them. and then used
> > > SVNRepository.getFile method to download all
> > > these files.
> > >
> > > I know this is a stupid way and slow.
> > >
> > > could any tell me if there are any other
> > > ways to approach this?
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: svnkit-users-unsubscribe@...
> > > For additional commands, e-mail: svnkit-users-help@...
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: svnkit-users-unsubscribe@...
> > For additional commands, e-mail: svnkit-users-help@...
> >
> >
--
研发部
北京信诺瑞得信息技术有限公司
地址:北京市朝阳区建国路88号SOHO现代城C座909
手机:13718143257
电话:010-85804799
传真:010-85804800



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


Re: How to get delta files between revisions.

by Alexander Sinyushkin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

Exported directories are not versioned, they do not contain any
Subversion specific information.

You could decide between two possible solutions:


1. Using SVNRepository.getFile() you check file checksum (stored in
SVNProperties) in the repository
and compare it with the checksum computed locally (you need to do it
yourself), for example, you
could use SVNFileUtil.computeChecksum(File) - though it's an internal
class and is not suggested to be
used in production code, you may use it as an example. Before getting
file you probably have to check whether
its path still exists in the repository (SVNRepository.checkPath()),
because you'll get an SVNException in case it
does not.

2. Or you may use even a faster approach: store somewhere the revision
of the exported directory. Then you
should use SVNRepository.status() to get modifications against the
needed revision in the repository.
You have to provide ISVNReporterBaton implementation where you describe
your local tree. Like this:


final long yourStoredRev = ...;

ISVNReporterBaton reporter = new ISVNReporterBaton() {
   public void report(ISVNReporter reporter) throws SVNException {
     reporter.setPath("", null, yourStoredRev, false);
     reporter.finishReport();
   }
};


You'll pass this to SVNRepository.status(), and the SVNRepository object
will invoke its report(..) method
at the local tree description stage. In response the Subversion server
sends you commands to "edit" the local tree
to get it to the state as it is in the target revision that you also
pass to the status() method.
To make this editing, SVNRepository translates server's commands to
calls to an ISVNEditor object that you also has to pass
to the status() method.

More on ISVNEditor and ISVNReporter you can read here
https://wiki.svnkit.com/Updating_From_A_Repository



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



Xiaoyu Du wrote:

> Now I hava another requirement.
>
> I got an svn project copy without any .svn files or other svn
> infomations(I use svn export command).
> but now the svn repository has update. I want replace my exported copy
> replaced by the newest repository. And I want to use my exported files
> checksum to determine which file has updated or deleted ?
> What should I do ?
>
>
>
>
> 在 2009-10-22四的 09:24 +0800,Xiaoyu Du写道:
>> Thanks for your reply, you are so kind.
>>
>> 在 2009-10-21三的 17:27 +0200,Alexander Kitaev写道:
>>> Hello Xiaoyu,
>>>
>>> I think you may do the following:
>>>
>>> 1. run diffClient.doDiffStatus (svn diff --summarize) to get list of
>>> changed file.
>>>
>>> 2. for each file, call SVNRepository.getFile(...) to get its checksum:
>>>
>>> DAVRepositoryFactory.setup();
>>>
>>> SVNRepository repos =
>>> SVNRepositoryFactory.create(SVNURL.parseURIEncoded("http://svn.svnkit.com/repos/svnkit/trunk"));
>>>
>>> SVNProperties properties = SVNProperties.wrap(new HashMap());
>>> repos.getFile("README.txt", -1, properties, null);
>>>       System.out.println(properties.getStringValue(SVNProperty.CHECKSUM));
>>>
>>> This will give you MD5 checksum.
>>>
>>> Alexander Kitaev,
>>> TMate Software,
>>> http://svnkit.com/ - Java [Sub]Versioning Library!
>>> http://sqljet.com/ - Java SQLite Library!
>>>
>>> Xiaoyu Du wrote:
>>>> Hi, guys.
>>>>
>>>> I have to tags in difference directory.
>>>> what I wanna do is :
>>>>
>>>> 1) get changes between tow revisions.
>>>> then determine the modified/add files
>>>> 2) download these changed file to an empty directory
>>>> and compute checksum for each file.
>>>>
>>>>
>>>> To approach this, I first use DiffClient object to
>>>> got the changes files and stored them. and then used
>>>> SVNRepository.getFile method to download all
>>>> these files.
>>>>
>>>> I know this is a stupid way and slow.
>>>>
>>>> could any tell me if there are any other
>>>> ways to approach this?
>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: svnkit-users-unsubscribe@...
>>>> For additional commands, e-mail: svnkit-users-help@...
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: svnkit-users-unsubscribe@...
>>> For additional commands, e-mail: svnkit-users-help@...
>>>
>>>

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