[Tutor] Off Topic: Revision control system

Nick Lunt nick at javacat.f2s.com
Fri Apr 2 04:28:07 EST 2004


Many thanks for all your responses.

Magnus, I replied to this a couple of days ago but I did it through my
webmail so Im not sure if it went to you directly (and accidentally) or
got lost in cyberspace.

Anyway, I followed your instructions as detailed below and Im now using
RCS for all my python stuff, and I'll probably start using it for my
unix scripts soon too.

Thankyou for taking the time to post your RCS tutorial, it's covered all
I need to know to use RCS to my advantage.

Thanks again,
Nick.


On Tue, 2004-03-30 at 23:36, Magnus Lycka wrote:
> > Now my question is, do you folks use any sort of revision control system
> > on linux ? I've had a look at CVS and RCS but both seem a bit over the
> > top for my needs.
> 
> It's really a good habit to use a revision control system
> for all files we change, whether they are python files,
> html files or system configuration files. It's not a
> substitute for backups of course, but for most human
> mistakes with files it's a much better solution...
> 
> RCS is the simplest solution, and for a few files and a
> single user it's good enough. It's not difficult to use.
> 
> Just go to http://www.hmug.org/man/1/rcsintro.html
> and read about getting started.
> 
> First of all, make a subdirectory called RCS in the
> directory where you keep the files you want to version.
> If you are a Linux user I assume you aren't afraid of
> command lines. (It's hopeless how many Windows users
> shy away from command line prompts these days...)
> 
> $ mkdir RCS
> 
> The normal procedure will then be just to run
> 
> $ ci -l my_file.py
> 
> when you have a file version that you want to preserve. 
> This means: Check in my_file.py into the RCS repository,
> but keep it locked by me so I can continue editing it.
> 
> If you look inside the RCS subdirectory, you will see that
> there is a my_file.py,v which will contain the latest
> checked in version as well as all diffs needed to revert
> back to the first version you checked in.
> 
> If you see that you mess things up and want to revert to the
> last checked in version, you can overwrite it with the last
> checked in version (-f means force, by default RCS won't
> want to overwrite your working file): 
> 
> $ co -l -f  my_file.py
> 
> If it's an older revision you need to check out, just use
> the -r flag to co to specify which version you need.
> 
> You can use rlog to list what versions there are of a
> file...
> 
> $ rlog my_file.py
> 
> ...and rcsdiff to see how they differ:
> 
> $ rcsdiff my_file.py
> 
> That will compare the current file with the latest 
> version checked into RCS and show you the difference.
> 
> $ rcsdiff -r 1.2 my_file.py
> 
> will compare revision 1.2 of my_file.py with the current
> version.
> 
> $ rcsdiff -r 1.2 -r 1.4 my_file.py
> 
> will compare revisions 1.2 and 1.4 with each other.
> 
> If you want to look at an older revision without
> messing with the current version, just check out with
> the -p flag, to get it into a pipe. You can pipe that
> to a pager or redirect to another file name.
> 
> $ co -p -r 1.3 my_file.py | less
> 
> This might be all you ever need to know about RCS. Not
> too bad, is it?
> 
> If your ambition grows, and you eventually want a bigger
> system, I agree that you should have a look at Subversion.
> 
> Even little RCS has many more features, but you don't
> need to worry about them until you feel that you need 
> them. As long as you are a single developer and don't
> have to trace what versions of your software a number
> of different customers are running, you might get away
> with knowing no more about it than I wrote here.
> 
> Oh, one more thing. It might be useful to put a comment
> like this...
> 
> # $ID$
> 
> or
> 
> # $Log$
> 
> ...in the Python files you check in. Then you get revision 
> info in the copies of the files that you check out.
> 
> Have fun!




More information about the Tutor mailing list