Darcs
Een tijdje geleden probeerde ik het in mijn /etc/httpd uit. Dit is een map waarin apache onder unix haar configuratie files bewaard. Het was heel eenvoudig:
[rtam@serenity:~](1): cd /etc/httpd
[rtam@serenity:/etc/httpd](2): ls -al
total 384
drwxr-xr-x 12 root wheel 408 28 Dec 16:12 .
drwxr-xr-x 97 root wheel 3298 7 Jan 10:56 ..
drwxr-xr-x 3 root wheel 102 13 Dec 12:30 Attic
-rw-r--r-- 1 root wheel 23783 28 Dec 16:12 httpd.conf
-rw-r--r-- 1 root wheel 23301 15 Dec 19:41 httpd.conf.applesaved
-rw-r--r-- 1 root wheel 37419 30 Nov 02:59 httpd.conf.bak
-rw-r--r-- 1 root wheel 38372 30 Nov 02:59 httpd.conf.default
-rw-r--r-- 1 root wheel 12965 13 Sep 2003 magic
-rw-r--r-- 1 root wheel 12965 13 Sep 2003 magic.default
-rw-r--r-- 1 root wheel 15150 13 Sep 2003 mime.types
-rw-r--r-- 1 root wheel 15191 29 Nov 23:13 mime.types.default
drwxr-xr-x 4 root wheel 136 13 Dec 00:35 users
[rtam@serenity:/etc/httpd](2): ls -al
total 384
drwxr-xr-x 12 root wheel 408 28 Dec 16:12 .
drwxr-xr-x 97 root wheel 3298 7 Jan 10:56 ..
drwxr-xr-x 3 root wheel 102 13 Dec 12:30 Attic
-rw-r--r-- 1 root wheel 23783 28 Dec 16:12 httpd.conf
-rw-r--r-- 1 root wheel 23301 15 Dec 19:41 httpd.conf.applesaved
-rw-r--r-- 1 root wheel 37419 30 Nov 02:59 httpd.conf.bak
-rw-r--r-- 1 root wheel 38372 30 Nov 02:59 httpd.conf.default
-rw-r--r-- 1 root wheel 12965 13 Sep 2003 magic
-rw-r--r-- 1 root wheel 12965 13 Sep 2003 magic.default
-rw-r--r-- 1 root wheel 15150 13 Sep 2003 mime.types
-rw-r--r-- 1 root wheel 15191 29 Nov 23:13 mime.types.default
drwxr-xr-x 4 root wheel 136 13 Dec 00:35 users
Dus alles staat er... nu zetten we versiebeheer aan...
[rtam@serenity:/etc/httpd](3): sudo darcs init
Password:
Password:
Ik moest hier sudo gebruiken omdat ze van root zijn, natuurlijk is dit niet nodig als je dit in een eigen map
doet.
[rtam@serenity:/etc/httpd](4): sudo darcs add -r httpd.conf magic mime.types users
Ik vertel darcs hiermee dat het deze files en map in de gaten moet houden.
[rtam@serenity:/etc/httpd](5): sudo darcs whatsnew
{
adddir ./users
addfile ./httpd.conf
hunk .httpd.conf 1
{
adddir ./users
addfile ./httpd.conf
hunk .httpd.conf 1
Ik kap het hier maar af het was namelijk nog al lang en veel. Nu wil ik dat het deze toestand onthoud en bewaard als begin toestand. Daarvoor gebruik je "record".
[rtam@serenity:/etc/httpd](6): sudo darcs record -am "Initial import."
Darcs needs to know what name (conventionally an email address) to use as the
patch author, e.g. 'Fred Bloggs '. If you provide one
now it will be stored in the file '_darcs/prefs/author' and used as a default
in the future. To change your preferred author address, simply delete or edit
this file.
Darcs needs to know what name (conventionally an email address) to use as the
patch author, e.g. 'Fred Bloggs '. If you provide one
now it will be stored in the file '_darcs/prefs/author' and used as a default
in the future. To change your preferred author address, simply delete or edit
this file.
What is your email address? rtam@serenity.local
Finished recording patch 'Initial import.'
Finished recording patch 'Initial import.'
Laten we eens kijken wat we hebben:
[rtam@serenity:/etc/httpd](7): sudo darcs changes
Thu Jan 13 14:43:09 CET 2005 rtam@serenity.local
* Initial import.
Thu Jan 13 14:43:09 CET 2005 rtam@serenity.local
* Initial import.
Darcs heeft deze status dus bewaard. Nu ga ik even iets aanpassen...
[rtam@serenity:/etc/httpd](8): sudo vim httpd.conf
Password:
Password:
Ik heb dus een regel toegevoegd en darcs weet dit:
[rtam@serenity:/etc/httpd](9): sudo darcs whatsnew
{
hunk ./httpd.conf 364
+ AliasMatch ^/repos/(.*) /repos/$1
}
{
hunk ./httpd.conf 364
+ AliasMatch ^/repos/(.*) /repos/$1
}
Nu ga ik dit ook bewaren:
[rtam@serenity:/etc/httpd](10): sudo darcs record -am "added /repos to serenity."
Finished recording patch 'added /repos to serenity.'
Finished recording patch 'added /repos to serenity.'
En wat hebben we nu allemaal gedaan al?
[rtam@serenity:/etc/httpd](11): sudo darcs changes
Thu Jan 13 14:59:54 CET 2005 rtam@serenity.local
* added /repos to serenity.
Thu Jan 13 14:59:54 CET 2005 rtam@serenity.local
* added /repos to serenity.
Thu Jan 13 14:43:09 CET 2005 rtam@serenity.local
* Initial import.
* Initial import.
Natuurlijk kun je darcs vragen om terug te gaan naar een vorige versie met "rollback" en je kunt een copy hier van maken met "get" en nog veel meer.
Alternatieven
Git Mercurial
Discussie
DarcsPraatPagina's die naar hier verwijzen
CollaborativeDistributedTextEditing | Darcs | OnlineSamenwerkenToolsReacties
Er zijn nog geen reacties bij deze pagina. [Reactie toevoegen]

Trackbacks (URL)
Er zijn geen trackbacks voor deze pagina.