locked
Store different versions of the same file RRS feed

  • Question

  • User-820447932 posted

    Hi, I'm implementing version control system using WCF service and client application. I can not figure out, how to store files on the server side to easily access different versions. Can you please provide any suggestions?

    Monday, May 31, 2010 7:30 AM

Answers

  • User1509556905 posted

    You could do one thing.. Maintain an XML file (or you can use database) on server.. Which will store record of each file present in repository.

    e.g.

    <root>

    <file ID="1" Name="Test.txt"/>

    <file ID="2" Name="Test.txt"/>

    </root> 

    Now in repository u just store those files as Test_1.txt and Test_2.txt (appending their resp IDs form xml). And you can search those files by just name of file and appended ID. 

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, May 31, 2010 3:40 PM
  • User-2004844803 posted

    No, I want to make my own repository. It is my study work. Smile

    ok, I see. Incrementing your files with a revision number each time you commit a new file shouldnt be a big problem. If you store them on disk just name them like "filename_rev_001.cs".


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 1, 2010 1:56 AM

All replies

  • User197322208 posted

    simplest way : store each file separately with a time stamp near to differentiate

    hard way : store only differences between version 2 and 1, 3 and 2, 4 and 3 and so on...

    Monday, May 31, 2010 10:00 AM
  • User-2004844803 posted

    Hi

    One solution that popped up in my head is to build your WCF service against a SubVersion repository on your server (or some other server). There are some C# APIs that allow you to talk to subversion, one off them is SharpSVN, I have not tried this myself but it sounds like it should be doable. 

    If you'r not yet familar with subversion take a look at SubVersion. It's a really good version control system!

    Monday, May 31, 2010 2:10 PM
  • User-820447932 posted

    No, I want to make my own repository. It is my study work. Smile

    Monday, May 31, 2010 3:27 PM
  • User1509556905 posted

    You could do one thing.. Maintain an XML file (or you can use database) on server.. Which will store record of each file present in repository.

    e.g.

    <root>

    <file ID="1" Name="Test.txt"/>

    <file ID="2" Name="Test.txt"/>

    </root> 

    Now in repository u just store those files as Test_1.txt and Test_2.txt (appending their resp IDs form xml). And you can search those files by just name of file and appended ID. 

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, May 31, 2010 3:40 PM
  • User-2004844803 posted

    No, I want to make my own repository. It is my study work. Smile

    ok, I see. Incrementing your files with a revision number each time you commit a new file shouldnt be a big problem. If you store them on disk just name them like "filename_rev_001.cs".


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 1, 2010 1:56 AM
  • User-820447932 posted

    Thanks) I was thinking about the same thing.

    Tuesday, June 1, 2010 3:27 AM