How do I check what files in SVN are new against some revision?

I have a web interface to SVN storage. It allows users to view folders, download, add and delete files. I need to implement feature which will show user the list of new files to him. This should be list of files, which were added to svn from the moment of users last login. SVN contains more than 2000 files and folders so it takes more than 30s to check all files details and compile the list on login. How do I implement this in more fast way? Maybe SVN have some tool which will help?
Successful solution shoud be simple with minimum operations. It should take minimum efforts to implement and test. It also should concern that SVN contents may be changed by 3rd party interfaces like SVN client. It is not preferred to cashe because cashed data will be different from actual SVN contents.
technoparkcorpAsked:
Who is Participating?
 
sunnycoderConnect With a Mentor Commented:
Extract all lines beginning with M as well.
If you want all changes, get all entries reported by log and then do a unique on them
0
 
sunnycoderCommented:
svn status

The first column tells you the status of files - 'A' refers to addition

something like the following (adjust for whitespace) would get you the required list.
svn status | grep "^A"

It will have to browse the entire repository to get the list - there is no easy way to shorten this process. The hard way is to fiddle with svn server code to do periodic pre-calculations.

Note that this status is since last svn update command and not login. Getting files added since last login would be trickier. Typically we never log off svn and there might be checkins while we are logged in that we are not necessarily aware of. Even from usability point of view, additions since last update make lot more sense as compared to additions since last login. Also repository might have been checked out at different locations and user is likely to be interested in getting the list of files added to current repository rather than updates to another repository that was used at the time of last login.
0
 
technoparkcorpAuthor Commented:
svn status deals with local copy but not with the entire repository, this will not help
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

 
sunnycoderCommented:
> I need to implement feature which will show user the list of new files to him.
This will require some client specific info - Infact your solution will integrate with client and not the server.

>This should be list of files, which were added to svn from the moment of users last login.
Can you be more specific. What happens if a user logs in and does not log off - will he never see an update? Or what happens if a user is logged in from multiple machines - what would be the behavior on each of them?
0
 
technoparkcorpAuthor Commented:
seems that you have not got the point. my fault. let me explain:
- SVN repository on the remote server contains some data. It is used just as data storage.
- Im inplementing  a web-interface (lets call it System) which allows users to manage this repository by  "Create folder", "Download file", "Delete file" ,"Upload file" etc... tools

what I want to b implemented:
1. User A has been logged to System 10-Oct and then logged off
2. 11-Oct users B and C were logged in and added files b.txt and c.txt to SVN repository. Then they logged off.
3. 12-Oct user A logs to the System and see shortcuts ti b.txt and c.txt files in "New files" zone.

for now, I need to scan all repository on user login and check if there is files added later then 10-Oct. it takes 30 sec, so I have great troubles here. so Im looking for some tool which will return new files list in few secs maximum.
0
 
sunnycoderCommented:
Okay - I get it ...  

save the revision number when the user last visited.
Run the command
svn log -v -r LAST_VISIT:HEAD

Where LAST_VISIT is your svn revision number since last visit.

filter out all lines beginning with A - these are the added file.

This will be lot faster than svn status.
0
 
technoparkcorpAuthor Commented:
tried this... but it returns added files only however I need edited files as well.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.