-1

Jenkins job is monitoring a location in SVN where our project resides in different folders. The Size of our project in SVN is 200GB our job checks out the whole project(200GB) every time even for a small modification(50MB). Is there any way to checkout only the folders which are modified with respect to a specific revision so that the load(SVN Checkout) on the Jenkins job is reduced from 200GB to few hundred MB only. By preserving the working copy in Jenkins work space we only need to run SVN update but it is not possible for some internal reasons.

I know there is no provision for checking out a revision range from SVN repository

I will be very thankful for any kind of suggestions and solutions

Zoe
  • 27,060
  • 21
  • 118
  • 148
Hameed Basha
  • 13
  • 1
  • 7

1 Answers1

1

I think you should use log -v:

svn log -l1 -v

It produces output which contains the list of changed files (in last commit). You can use grep to filter the unneeded content: grep '^ M' or sed to clear the unneeded M: sed -n '/^ M/ s@^ M @@p':

svn log -l1 -v | sed -n '/^   M/ s@^   M @@p'

So you need checkout these files (svn checkout $(svn log -l1 -v | sed...)).

Maybe you want expand this solution to new files (A sign instead of M).

uzsolt
  • 5,832
  • 2
  • 20
  • 32
  • Thanks uzsolt for your valuable suggestion. What if I have two or more commits in the space of running your command twice can this be achieved with post commit hooks so that I can be notified with only the modified content in last commit. – Hameed Basha Jan 20 '18 at 11:07
  • svn log -v -r1234:HEAD can rescue me. can this be accomplished using post commit hooks? please give your suggestions I am a beginner in svn – Hameed Basha Jan 20 '18 at 11:14
  • I think yes. But be carefully: the commit hooks run on server-side! – uzsolt Jan 20 '18 at 14:39