Follow upstream changes -- rest
[git-darcs-import.git] / src / switching.tex
blobf68d178225fc80da9dae3c135dd453061f1e1436
1 \section{Switching from CVS}
3 Darcs is refreshingly different from CVS.
5 CVS keeps version controlled data in a central repository, and
6 requires that users check out a working directory whenever they wish
7 to access the version-controlled sources. In order to modify the
8 central repository, a user needs to have write access to the central
9 repository; if he doesn't, CVS merely becomes a tool to get the latest
10 sources.
12 In darcs there is no distinction between working directories and
13 repositories. In order to work on a project, a user makes a local
14 copy of the repository he wants to work in; he may then harness the
15 full power of version control locally. In order to distribute his
16 changes, a user who has write access can \emph{push} them to the
17 remote repository; one who doesn't can simply send them by e-mail in a
18 format that makes them easy to apply on the remote system.
20 \paragraph{Darcs commands for CVS users}
21 Because of the different models used by cvs and darcs, it is
22 difficult to provide a complete equivalence between cvs and darcs.
23 A rough correspondence for the everyday commands follows:\\
24 % The \hspace commands force a line break in the postscript output,
25 % but they are effectively ignored in the html output.
26 \begin{description}\addtolength{\itemsep}{-0.5\baselineskip}
27 \item[{\tt cvs checkout}\hspace*{100em}]
28 {\tt darcs get}
29 \item[{\tt cvs update}\hspace*{100em}]
30 {\tt darcs pull}
31 \item[{\tt cvs -n update}\hspace*{100em}]
32 {\tt darcs pull \verb!--dry-run!}
33 (summarize remote changes)
34 \item[{\tt cvs -n update}\hspace*{100em}]
35 {\tt darcs whatsnew \verb!--summary!}
36 (summarize local changes)
37 \item[{\tt cvs -n update | grep '?'}\hspace*{100em}]
38 {\tt darcs whatsnew -ls | grep \verb!^a! }
39 (list potential files to add)
40 \item[{\tt rm foo.txt; cvs update foo.txt}\hspace*{100em}]
41 {\tt darcs revert foo.txt}
42 (revert to foo.txt from repo)
43 \item[{\tt cvs diff}\hspace*{100em}]
44 {\tt darcs whatsnew}
45 (if checking local changes)
46 \item[{\tt cvs diff}\hspace*{100em}]
47 {\tt darcs diff}
48 (if checking recorded changes)
49 \item[{\tt cvs commit}\hspace*{100em}]
50 {\tt darcs record}
51 (if committing locally)
52 \item[{\tt cvs commit}\hspace*{100em}]
53 {\tt darcs tag}
54 (if marking a version for later use)
55 \item[{\tt cvs commit}\hspace*{100em}]
56 {\tt darcs push} or {\tt darcs send}
57 (if committing remotely)
58 \item[{\tt cvs diff | mail}\hspace*{100em}]
59 {\tt darcs send}
60 \item[{\tt cvs add}\hspace*{100em}]
61 {\tt darcs add}
62 \item[{\tt cvs tag -b}\hspace*{100em}]
63 {\tt darcs get}
64 \item[{\tt cvs tag}\hspace*{100em}]
65 {\tt darcs tag}
66 \end{description}
68 \paragraph{Migrating CVS repositories to darcs}
70 Tools and instructions for migrating CVS repositories to darcs are provided
71 on the darcs community website:
72 \htmladdnormallinkfoot{http://darcs.net/DarcsWiki/ConvertingFromCvs}{http://darcs.net/DarcsWiki/ConvertingFromCvs}
75 \section{Switching from arch}
77 Although arch, like darcs, is a distributed system, and the two systems
78 have many similarities (both require no special server, for example), their
79 essential organization is very different.
81 Like CVS, arch keeps data in two types of data structures:
82 repositories (called ``archives'') and working directories. In order
83 to modify a repository, one must first check out a corresponding
84 working directory. This requires that users remember a number of
85 different ways of pushing data around --- \verb|tla| \verb|get|,
86 \verb|update|, \verb|commit|, \verb|archive-mirror| and so on.
88 In darcs, on the other hand, there is no distinction between working
89 directories and repositories, and just checking out your sources
90 creates a local copy of a repository. This allows you to harness the
91 full power of version control in any scratch copy of your sources, and
92 also means that there are just two ways to push data around:
93 \verb|darcs| \verb|record|, which stores edits into your local
94 repository, and \verb|pull|, which moves data between repositories.
95 (\verb|darcs| \verb|push| is merely the opposite of \verb|pull|;
96 \verb|send| and \verb|apply| are just the two halves of \verb|push|).
98 \paragraph{Darcs commands for arch users}
100 Because of the different models used by arch and darcs, it is
101 difficult to provide a complete equivalence between arch and darcs.
102 A rough correspondence for the everyday commands follows:\\
103 \begin{description}\addtolength{\itemsep}{-0.5\baselineskip}
104 \item[{\tt tla init-tree}\hspace*{100em}]
105 {\tt darcs initialize}
106 \item[{\tt tla get}\hspace*{100em}]
107 {\tt darcs get}
108 \item[{\tt tla update}\hspace*{100em}]
109 {\tt darcs pull}
110 \item[{\tt tla file-diffs f | patch -R }\hspace*{100em}]
111 {\tt darcs revert}
112 \item[{\tt tla changes --diffs}\hspace*{100em}]
113 {\tt darcs whatsnew}
114 \item[{\tt tla logs}\hspace*{100em}]
115 {\tt darcs changes}
116 \item[{\tt tla file-diffs}\hspace*{100em}]
117 {\tt darcs diff -u}
118 \item[{\tt tla add}\hspace*{100em}]
119 {\tt darcs add}
120 \item[{\tt tla mv}\hspace*{100em}]
121 {\tt darcs mv}
122 (not {\tt tla move})
123 \item[{\tt tla commit}\hspace*{100em}]
124 {\tt darcs record}
125 (if committing locally)
126 \item[{\tt tla commit}\hspace*{100em}]
127 {\tt darcs tag}
128 (if marking a version for later use)
129 \item[{\tt tla commit}\hspace*{100em}]
130 {\tt darcs push} or {\tt darcs send}
131 (if committing remotely)
132 \item[{\tt tla archive-mirror}\hspace*{100em}]
133 {\tt darcs pull} or {\tt darcs push}
134 \item[{\tt tla tag}\hspace*{100em}]
135 {\tt darcs get}
136 (if creating a branch)
137 \item[{\tt tla tag}\hspace*{100em}]
138 {\tt darcs tag}
139 (if creating a tag).
140 \end{description}
142 \paragraph{Migrating arch repositories to darcs}
144 Tools and instructions for migrating arch repositories to darcs are provided
145 on the darcs community website:
146 \htmladdnormallinkfoot{http://darcs.net/DarcsWiki/ConvertingFromArch}{http://darcs.net/DarcsWiki/ConvertingFromArch}