FET undo/version control HOWTO

Started by Massimo Mancini, September 26, 2009, 04:43:07 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Massimo Mancini

Hi all,
this is a little suggestion about  an undo mechanism for fet data file and for all files created by fet . Really it is much more of this: a real, effective version control system. I describe how to implement it  supposing you are linux users  ;) , if you are win users  :'( , don't worry,  the procedure is almost identical   :)

REQUIREMENTS: my solution is based on Mercurial, a magic, open source, cvs system written in python (but don't worry about that), you find it here: http://mercurial.selenic.com/wiki/Download (check the packages of your distribution first!, in this site you find also a complete solution for win users)

USE: suppose you have all your timetables in default dir fet-result (this is a convention, you can have your files anywhere you want); you have to do only few simple things to put your fet_directory and his content under the permanent control of Mercurial.

Open a terminal in your home directory and issue the following commands:

1. cd fet_results (enter your fet directory)
2. hg init (initialize a new mercurial repository, hg is the mercurial main command)
3. hg add * (add to repository ALL the file in fet_results, a this time you don't have any reason to not include some files)
4. hg commit (freeze the current status of your file). COMMIT is the key command!!! Commit take a snapshot of you current files.

5. now, you do what you want in fet.... (leave open the terminal)
6. save fet_file (save, generate timetables, export csv, etc.)

Go in the terminal and...

7. hg commit -m "put here some comment about your work"  (this freeze the current version of the existing files, those you have added yet to repository)

8. if you have new files in your work directory you can add them to repository before commit the current version, so...

9. hg add * ; hg commit -m "some new comment"

that's all!!! Now you can use mercurial to view the complete history of your work (hg log), to view the difference between two version of your work (hg diff ver1 ver2), to revert current status to an old one... and so on. In general you don't need to change file name, you can work with only one fet data file, Mercurial will never forget the changes you have made (IF YOU HAVE COMMITTED THEM, of course, any COMMIT is a checkpoint of all your work)

Of course with mercurial you can centralize your fet files on a server and have more timetablers working on them...

I hope this can help someone...

PS.
If Liviu add a new Advanced option to exec a shell command without leave FET...   ;)



Liviu Lalescu

#1
Quote
PS.
If Liviu add a new Advanced option to exec a shell command without leave FET...   ;)
Interesting, but adding a shell command into FET might be too much, and users might be puzzled about it. I am not sure. It should not be difficult to have a shell opened and typing from there.

Massimo Mancini

#2
Of course you are right... using hg command in a separate console window is pretty confortable for me (I like very much the command line and the free composition of different utilities that characterize Unix systems), in win, via hgturtle, mercurial is integrated with contextual menu (right click) on fet data dir (that where you have created the hg repository), so his use is straightforward.
The idea however remains, FET could be easily integrated with a cvs system, I use Mercurial because I love it, but it is not the only choise.  
I just experimenting with it and I think it is great (no too difficult to install and learn, really easy). Try to believe  8-)