Storage RAStatus
Gw
This document is about the current status of the code in the RA branch.
https://svn.cs.uu.nl:12443/repos/gw/branches/ra/
Changes
Overview of the changes i have made since the end of the Swe GW project.
- added SVNRAStorageStatusMessage class
- added SVNRAStorageDirEntry class
- added SimpleCacheManager class (slow cache used by SVNRAStorage.getFile)
- added beginTransaction and endTransaction calls in different places in the wiki code (otherwise SVNRAStorage would fail).
- made a change to ServletOutputFormatter.formatStatuses: the old version did a isDirectory call for each entry in the dirlisting. This is not needed (overhead) because the dirlisting contains information about the entry kinds.
- added CommitItems and a CommitItemContainer and removed RAAction. RAAction represents a single RA action. CommitItem represents a single repository path with (multiple) actions on that path.
- moved directory traversing methods from java to c (cleaner java/c code)
- removed normalizePath method from java: svn includes functions to do this nicer/better.
- fixed the creation of getLog's changed_paths
- fixed svn date to java date conversion
- fixed blame (date problem)
- added c function to get dir entries
- making use of subpools in c
- added implementation for getStatus
- implemented revertFile
- added (wrong) implementation for getFileDiff
- added support for recursive use of setProperty
- implemented a new get_file function in c (shorter and more efficient)
- after a successful commit, all appropriate listeners are invoked.
- commitItem handles RA calls for commit (move/copy not yet implemented)
- changed build.sh and startup.sh so it also includes the build of the c code.
The next changes should be undone when the SVNRAStorage is finished completely (the code is documented in those places):
- made a change to Users.UserSubversionDataAdapter.store: currently there is no support to test if a directory exists in the commitItemContainer, so i have disabled the "if" that does this check.
- made a change to SaveFile.saveInput: currently there is no way to get properties of a not-yet-existing repos file, so i've made a workaround for this in order to be able to save new/modified files
Commit items
Added a notion of commit items. A commit item represents all actions on a (new) repository path. When doing a commit all items in the
CommitItemContainer are committed. We need commit items because the RA layer can access the same repository path only once during a svn RA transaction
(this transaction is different from the ones used by SVNRAStorage!). For example: when you add a new file and want to change properties of that file,
you have to do this in a single RA call, because svn is unable to set properties of an unexisting file/dir.
Overview SVNRAstorage status
Check if a file or directory exists
Implemented.
Check if a path is a directory
Implemented.
Create a directory
Implemented.
Retrieving a file
There are three places where we can get file content from:
- commit items: when you change a file during a transaction and you want to see the changes you have made at a later time (within the transaction), you want to see the changed contents. You can find these in the commit item of the file.
- cache: when you retrieve a file from the repository it is stored in the cache. The one currently implemented only caches files and is very slow. It is implemented in java and i think it is better to do this in c. Furthermore, the caching mechanism currently used is very easy and does not store file contents in memory.
- repository: get the contents from a subversion repository.
New/edit file
Implemented.
Delete repository entry
Implemented.
Move repository entry/file
Not implemented yet.
Copy repository entry/file
Not implemented yet.
Set a property
Implemented.
Getting properties
Implemented. Property changes that are in a commit item are currently ignored.
Commit
Implemented. Because copy/move is not implemented yet we have to adapt the commit handling in the future.
Get a list of conflicting files
Not implemented yet. See known issues for more information about this.
Resolve a conflicting file
Not implemented. This should be easy when get conflicts in implemented. See known issues for more information.
Getting a dirlisting
Implemented. It does not use new or deleted paths from the commit items. See known issues for more information.
Getting DirEntry information
Implemented. It does not use new or deleted paths from the commit items. See known issues for more information.
Blame
Implemented. It does not work correctly on all files in the test-wiki because some revisions don't include any date info. Reason? Probably caused by changes using older and incorrect implementations of storage functions.
It does not use new or deleted paths from the commit items.
The blame implementation only works on subversion servers with version 1.1 or higher.
Status
Implemented, but this can be optimized using the dirEntry information. In that case we only have to do a single RA call. At the moment the RA layer is called for every path you want the status of.
It does not use new or deleted paths from the commit items.
Revert a file
Implemented (just remove a commit item from the container).
Get the diff of a file
Not implemented yet. I have implemented a diff, but it does not give results the wiki would expect (i think).
Get log information
Implemented.
Known issues
- dirListing, blame, log, getProperties, isDirectory, fileExists don't use information about deleted and new paths that are in the commitItemContainer. Add support for this. The absence of this does not cause any problems in the wiki (although information you see in the wiki might not be complete).
- the wiki does not use the begin/end transaction methods correctly. I have fixed this in the SVNRAStorage (when you create a new storage, beginTransaction is called). I don't know if this can cause any problems.
- how do we call the closeSession function in c (this method destroys all objects)?? Currently the finalize method is used, but this gives no guarantees!
- i found out that some svn versions return the input path as a result when you call the ra->get_dir_listing. I have implemented a workaround for this problem, so it works on all servers (slow workaround).
- in order to implement getConflicts we need to know the base revision of the file you have changed. Currently, there is no way to remember this in the SVNRAStorage. The getStatus method needs this base revision too (java side). Currently the SVNRAStorageStatusMessage returns a -1 for the base revision.
- refactor c code (some things can be done much more efficient)
--
PatrickCloosterman - 22 Dec 2004