RCS (Revision Control System)
# yum install -y rcs
ci - checkin (зарегистрировать)
co - checkout (проконстроллировать)
-l - lock
-u - unlock
# echo "123" > 123.txt
// Инициализировать файл
# ci -i 123.txt
123.txt,v <-- 123.txt
enter description, terminated with single '.' or end of file:
NOTE: This is NOT the log message!
>> .
initial revision: 1.1
done
// После инициализации файл пропадает, чтобы он появился, нужно выполнить следующую команду:
# co 123.txt
123.txt,v --> 123.txt
revision 1.1
done
# ls
123.txt 123.txt,v
# cat 123.txt
123
=======================================================================
// Внесем изменения в файл.
// Предварительно его лочим
# co -l 123.txt
123.txt,v --> 123.txt
revision 1.1 (locked)
done
// Вносим изменения
# echo "456" > 123.txt
// Регистрируем и снимаем лок.
# ci -u 123.txt
123.txt,v <-- 123.txt
new revision: 1.2; previous revision: 1.1
enter log message, terminated with single '.' or end of file:
>> .
done
=======================================================================
// Сравниваем ревизии
# rcsdiff -r1.1 -r1.2 123.txt
===================================================================
RCS file: 123.txt,v
retrieving revision 1.1
retrieving revision 1.2
diff -r1.1 -r1.2
1c1
< 123
---
> 456
==================================================
// Вернемся к копии 1.1 (как-то не с первого раза срабатывает)
# co -l -r1.1 123.txt
123.txt,v --> 123.txt
revision 1.1 (locked)
done
# cat 123.txt
123
# ci -u 123.txt
==================================================
// Вернемся к ревизии 1.2 (как-то не с первого раза срабатывает)
# co -l -r1.2 123.txt
123.txt,v --> 123.txt
revision 1.1 (locked)
done
# cat 123.txt
456
# ci -u 123.txt
==========================================================
# co -l 123.txt
123.txt,v --> 123.txt
revision 1.1 (locked)
done
# echo "789" > 123.txt
# ci -u 123.txt
123.txt,v <-- 123.txt
new revision: 1.3; previous revision: 1.2
enter log message, terminated with single '.' or end of file:
>> .
done
=======================================================================
# rcsdiff -r1.1 -r1.3 123.txt
===================================================================
RCS file: 123.txt,v
retrieving revision 1.1
retrieving revision 1.3
diff -r1.1 -r1.3
1c1
< 123
---
> 789
=========================================================================
# rlog 123.txt
RCS file: 123.txt,v
Working file: 123.txt
head: 1.3
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 3; selected revisions: 3
description:
----------------------------
revision 1.3
date: 2014/01/07 21:05:40; author: root; state: Exp; lines: +1 -1
*** empty log message ***
----------------------------
revision 1.2
date: 2014/01/07 20:47:15; author: root; state: Exp; lines: +1 -1
*** empty log message ***
----------------------------
revision 1.1
date: 2014/01/07 20:41:51; author: root; state: Exp;
Initial revision
=============================================================================
=========================================================================
=========================================================================
// Вернемся к ревизии 1.2 (как-то не с первого раза срабатывает)
# co -l -r1.2 123.txt
# cat 123.txt
456
# ci -u 123.txt
# cat 123.txt
456
=========================================================================
=========================================================================
// Сделаем ревизию 1.4 а потом вернемся к ревизии 1.1
# co -l 123.txt
123.txt,v --> 123.txt
revision 1.1 (locked)
done
# echo "1000" > 123.txt
# ci -u 123.txt
done
# cat 123.txt
1000
===========
// Вернемся к ревизии 1.1
# co -l -r1.1 123.txt
# ci -u 123.txt
# cat 123.txt
123
=================================================
// Сравниваем, что было и что стало:
# rcsdiff -r1.1 -r1.4 123.txt
===================================================================
RCS file: 123.txt,v
retrieving revision 1.1
retrieving revision 1.4
diff -r1.1 -r1.4
1c1
< 123
---
> 1000
Посмотреть видео:
http://val.bmstu.ru/openvideo/rcs.html
Почитать:
http://www.gnu.org/software/rcs/manual/rcs.html
http://books.google.ru/books?id=mKgomQz5KH0C&printsec=frontcover&hl=ru#v=onepage&q&f=false
(купить эл. книгу 2003 года 200 стр за 650 руб. Да они там совсем укурились в своей Америке).