Hello Experts,
I am working on a project right now and it requires a 'cvs-like revision control' to be integrated into it.
PROJECT OVERVIEW:
1. Client: ColdFusion.
2. Server: Oracle.
2.1. Sample Columns/Fields
2.1.1. ModuleName
2.2.1. SourceProgram
2.2. Sample Implementation/Data
--------------------------
----------
----------
----------
----------
--
|ModuleName | SourceProgram |
|-------------------------
----------
----------
----------
----------
--|
|SomeImportantModule | Imports System.IO |
| | Public MyClass |
| | { |
| | return a+b |
| | } |
|-------------------------
---------|
----------
----------
----------
---|
|AnotherImportantModule | #!/usr/lib/perl |
| | ... |
--------------------------
----------
----------
----------
----------
---
3. Data: Text.
SCENARIO:
1. Programmer A will change Update SourceProgram for the SomeImportantModule
1.1. Change "return a+b" to "return a*b"
1.1.1. Rev 1.0 will have return a+b
1.1.2. Rev 1.1 will have return a*b
2. Programmer A will save changes.
--------------------
3. System will somehow be able to save the revisions made.
3.1. It is not advisable to save the whole module for every revision made.
3.1.1. Some are in thousands of lines of codes
3.1.2. Number of modules are in thousands and growing
3.2. I was thinking of storing the module in a CVS-like file where the header has all the changes made in every revision (saves disk space)
--------------------
4. Programmer B wants to use Rev 1.0. He must be able to pull out Rev 1.0 from the current Rev 2.0 (like CVS)
5. No 2 people will be editing the same source code so concurrency is not a problem.
What I was thinking of is to have CF compare its current code against the database code, and create (or run a program) a CVS file based on the changes made and the output is saved back to the database. If a user wants to view a code, it will somehow be able to parse it back (or run a program to do it) and display the latest revision. If the user wants an older revision, then the system must be able to parse it. When the user saves changes, CF will run the CVS file maker to create the CVS file and this is what is saved in the database.
Is there a better way to do this?
For this to work, I need information on CVS file parsers (something that could spit out a revision if specified) and CVS file maker (something that would require the *old* and *new* files as arguments and outputs the CVS file)
So the table should look like this:
--------------------------
----------
----------
----------
----------
----
|ModuleName | SourceProgram |
|-------------------------
----------
----------
----------
----------
----|
|SomeImportantModule | @d5 (cvs remarks here!) |
| | |
| | Imports System.IO |
| | Public MyClass |
| | { |
| | return a+b |
| | } |
|-------------------------
---------|
----------
----------
----------
----|
|AnotherImportantModule | @a (cvs remarks here!) |
| | |
| | #!/usr/lib/perl |
| | ... |
--------------------------
----------
----------
----------
----------
---
Running the cvs program is not advisable since it creates a lot of different problems.
Thank you in advance!
hec",)