?
Solved

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

Posted on 2008-10-12
7
Medium Priority
?
378 Views
Last Modified: 2013-11-25
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.
0
Comment
Question by:technoparkcorp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 45

Expert Comment

by:sunnycoder
ID: 22697445
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
 

Author Comment

by:technoparkcorp
ID: 22700759
svn status deals with local copy but not with the entire repository, this will not help
0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 22710853
> 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
WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

 

Author Comment

by:technoparkcorp
ID: 22711110
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
 
LVL 45

Expert Comment

by:sunnycoder
ID: 22711260
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
 

Author Comment

by:technoparkcorp
ID: 22720031
tried this... but it returns added files only however I need edited files as well.
0
 
LVL 45

Accepted Solution

by:
sunnycoder earned 1500 total points
ID: 22728033
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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question