File: switching.tex

package info (click to toggle)
darcs 1.0.9~rc1-0.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 4,248 kB
  • ctags: 565
  • sloc: haskell: 19,148; perl: 4,320; sh: 1,626; ansic: 1,137; makefile: 55; xml: 14
file content (147 lines) | stat: -rw-r--r-- 5,873 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
\section{Switching from CVS}

Darcs is refreshingly different from CVS.

CVS keeps version controlled data in a central repository, and
requires that users check out a working directory whenever they wish
to access the version-controlled sources.  In order to modify the
central repository, a user needs to have write access to the central
repository; if he doesn't, CVS merely becomes a tool to get the latest
sources.

In darcs there is no distinction between working directories and
repositories.  In order to work on a project, a user makes a local
copy of the repository he wants to work in; he may then harness the
full power of version control locally.  In order to distribute his
changes, a user who has write access can \emph{push} them to the
remote repository; one who doesn't can simply send them by e-mail in a
format that makes them easy to apply on the remote system.

\paragraph{Darcs commands for CVS users}
Because of the different models used by cvs and darcs, it is
difficult to provide a complete equivalence between cvs and darcs.
A rough correspondence for the everyday commands follows:\\
% The \hspace commands force a line break in the postscript output,
% but they are effectively ignored in the html output.
\begin{description}\addtolength{\itemsep}{-0.5\baselineskip}
\item[{\tt cvs checkout}\hspace*{100em}]
   {\tt darcs get}
\item[{\tt cvs update}\hspace*{100em}]
   {\tt darcs pull}
\item[{\tt cvs -n update}\hspace*{100em}]
   {\tt darcs pull \verb!--dry-run!}
      (summarize remote changes)
\item[{\tt cvs -n update}\hspace*{100em}]
   {\tt darcs whatsnew \verb!--summary!}
      (summarize local changes)
\item[{\tt cvs -n update | grep '?'}\hspace*{100em}]
   {\tt darcs whatsnew -ls | grep \verb!^a! }
      (list potential files to add)
\item[{\tt rm foo.txt; cvs update foo.txt}\hspace*{100em}]
   {\tt darcs revert foo.txt}
      (revert to foo.txt from repo)
\item[{\tt cvs diff}\hspace*{100em}]
   {\tt darcs whatsnew}
      (if checking local changes)
\item[{\tt cvs diff}\hspace*{100em}]
   {\tt darcs diff}
      (if checking recorded changes)
\item[{\tt cvs commit}\hspace*{100em}]
   {\tt darcs record}
      (if committing locally)
\item[{\tt cvs commit}\hspace*{100em}]
   {\tt darcs tag}
      (if marking a version for later use)
\item[{\tt cvs commit}\hspace*{100em}]
   {\tt darcs push} or {\tt darcs send}
      (if committing remotely)
\item[{\tt cvs diff | mail}\hspace*{100em}]
   {\tt darcs send}
\item[{\tt cvs add}\hspace*{100em}]
   {\tt darcs add}
\item[{\tt cvs tag -b}\hspace*{100em}]
   {\tt darcs get}
\item[{\tt cvs tag}\hspace*{100em}]
   {\tt darcs tag}
\end{description}

\paragraph{Migrating CVS repositories to darcs}

Tools and instructions for migrating CVS repositories to darcs are provided
on the darcs community website: 
\htmladdnormallinkfoot{http://darcs.net/DarcsWiki/ConvertingFromCvs}{http://darcs.net/DarcsWiki/ConvertingFromCvs}


\section{Switching from arch}

Although arch, like darcs, is a distributed system, and the two systems
have many similarities (both require no special server, for example), their
essential organization is very different.

Like CVS, arch keeps data in two types of data structures:
repositories (called ``archives'') and working directories.  In order
to modify a repository, one must first check out a corresponding
working directory. This requires that users remember a number of
different ways of pushing data around --- \verb|tla| \verb|get|,
\verb|update|, \verb|commit|, \verb|archive-mirror| and so on.

In darcs, on the other hand, there is no distinction between working
directories and repositories, and just checking out your sources
creates a local copy of a repository.  This allows you to harness the
full power of version control in any scratch copy of your sources, and
also means that there are just two ways to push data around:
\verb|darcs| \verb|record|, which stores edits into your local
repository, and \verb|pull|, which moves data between repositories.
(\verb|darcs| \verb|push| is merely the opposite of \verb|pull|;
\verb|send| and \verb|apply| are just the two halves of \verb|push|).

\paragraph{Darcs commands for arch users}

Because of the different models used by arch and darcs, it is
difficult to provide a complete equivalence between arch and darcs.
A rough correspondence for the everyday commands follows:\\
\begin{description}\addtolength{\itemsep}{-0.5\baselineskip}
\item[{\tt tla init-tree}\hspace*{100em}]
   {\tt darcs initialize}
\item[{\tt tla get}\hspace*{100em}]
   {\tt darcs get}
\item[{\tt tla update}\hspace*{100em}]
   {\tt darcs pull}
\item[{\tt tla file-diffs f | patch -R }\hspace*{100em}]
   {\tt darcs revert}
\item[{\tt tla changes --diffs}\hspace*{100em}]
   {\tt darcs whatsnew}
\item[{\tt tla logs}\hspace*{100em}]
   {\tt darcs changes}
\item[{\tt tla file-diffs}\hspace*{100em}]
   {\tt darcs diff -u}
\item[{\tt tla add}\hspace*{100em}]
   {\tt darcs add}
\item[{\tt tla mv}\hspace*{100em}]
   {\tt darcs mv}
      (not {\tt tla move})
\item[{\tt tla commit}\hspace*{100em}]
   {\tt darcs record}
      (if committing locally)
\item[{\tt tla commit}\hspace*{100em}]
   {\tt darcs tag}
      (if marking a version for later use)
\item[{\tt tla commit}\hspace*{100em}]
   {\tt darcs push} or {\tt darcs send}
      (if committing remotely)
\item[{\tt tla archive-mirror}\hspace*{100em}]
   {\tt darcs pull} or {\tt darcs push}
\item[{\tt tla tag}\hspace*{100em}]
   {\tt darcs get}
      (if creating a branch)
\item[{\tt tla tag}\hspace*{100em}]
   {\tt darcs tag}
      (if creating a tag).
\end{description}

\paragraph{Migrating arch repositories to darcs}

Tools and instructions for migrating arch repositories to darcs are provided
on the darcs community website: 
\htmladdnormallinkfoot{http://darcs.net/DarcsWiki/ConvertingFromArch}{http://darcs.net/DarcsWiki/ConvertingFromArch}