| 223 | | ================================ |
| 224 | | Converting CVS Repository to SVN |
| 225 | | ================================ |
| 226 | | |
| 227 | | Jon can fill in the details |
| | 223 | =============================== |
| | 224 | Converting a CVS Project to SVN |
| | 225 | =============================== |
| | 226 | |
| | 227 | Obtain cvs2svn_ |
| | 228 | |
| | 229 | .. _cvs2svn: http://cvs2svn.tigris.org/ |
| | 230 | |
| | 231 | .. note:: |
| | 232 | |
| | 233 | `cvs2svn-1.3.0/www/faq.html` covers this, but if you follow its directions |
| | 234 | exactly, you will get the rather ridiculous:: |
| | 235 | |
| | 236 | REPOSITORY |
| | 237 | | |
| | 238 | |---> ${PROJECT} |
| | 239 | | | |
| | 240 | | |---> trunk |
| | 241 | | | | |
| | 242 | | | |---> ${PROJECT} |
| | 243 | | | |
| | 244 | | |---> branches |
| | 245 | | | | |
| | 246 | | | |---> BRANCH1 |
| | 247 | | | | | |
| | 248 | | | | |---> ${PROJECT} |
| | 249 | | | | |
| | 250 | | | |---> BRANCH2 |
| | 251 | | | | |
| | 252 | | | |---> ${PROJECT} |
| | 253 | | | |
| | 254 | | |---> tags |
| | 255 | | | |
| | 256 | | |---> TAG1 |
| | 257 | | | | |
| | 258 | | | |---> ${PROJECT} |
| | 259 | | | |
| | 260 | | |---> TAG2 |
| | 261 | | | |
| | 262 | | |---> ${PROJECT} |
| | 263 | | |
| | 264 | |---> SOME_OTHER_PROJECT1 |
| | 265 | | |
| | 266 | |---> SOME_OTHER_PROJECT2 |
| | 267 | |
| | 268 | instead of the more desirable:: |
| | 269 | |
| | 270 | REPOSITORY |
| | 271 | | |
| | 272 | |---> ${PROJECT} |
| | 273 | | | |
| | 274 | | |---> trunk |
| | 275 | | | |
| | 276 | | |---> branches |
| | 277 | | | | |
| | 278 | | | |---> BRANCH1 |
| | 279 | | | | |
| | 280 | | | |---> BRANCH2 |
| | 281 | | | |
| | 282 | | |---> tags |
| | 283 | | | |
| | 284 | | |---> TAG1 |
| | 285 | | | |
| | 286 | | |---> TAG2 |
| | 287 | | |
| | 288 | |---> SOME_OTHER_PROJECT1 |
| | 289 | | |
| | 290 | |---> SOME_OTHER_PROJECT2 |
| | 291 | |
| | 292 | |
| | 293 | Make a copy of the portion of the CVS repository governing the project in |
| | 294 | question |
| | 295 | |
| | 296 | $ PROJECT=MyProjectInCVS |
| | 297 | $ mkdir cvs2svnSandbox |
| | 298 | $ cd cvs2svnSandbox |
| | 299 | $ cp -r /path/to/cvs/repository/${PROJECT} ${PROJECT} |
| | 300 | |
| | 301 | Convert the CVS project repository copy into an SVN repository dump file |
| | 302 | |
| | 303 | $ mkdir ${PROJECT}/CVSROOT |
| | 304 | $ cvs2svn --dump-only ${PROJECT} |
| | 305 | |
| | 306 | You should now have a file `cvs2svn-dump` in your working directory. |
| | 307 | |
| | 308 | If necessary, create an SVN repository |
| | 309 | |
| | 310 | $ svnadmin create --fs-type fsfs /path/to/svn/repos |
| | 311 | |
| | 312 | .. note:: An FSFS repository has fewer permissions problems than a Berkeley-DB |
| | 313 | repository. |
| | 314 | |
| | 315 | Make sure that the new repository has appropriate group permissions (this is |
| | 316 | still a bit fuzzy for me) |
| | 317 | |
| | 318 | $ chgrp -R $GROUP /path/to/svn/repos |
| | 319 | $ chmod -R g+w /path/to/svn/repos |
| | 320 | |
| | 321 | Add a stub for the new project |
| | 322 | |
| | 323 | $ svn mkdir file:///path/to/svn/repos/${PROJECT} -m "added ${PROJECT} directory" |
| | 324 | |
| | 325 | Import the converted project repository into SVN |
| | 326 | |
| | 327 | $ svnadmin --parent-dir $PROJECT load /path/to/svn/repos < cvs2svn-dump |
| | 328 | |
| | 329 | You can now test a checkout |
| | 330 | |
| | 331 | $ svn checkout svn+ssh://MACHINE.IP.ADDR/path/to/svn/repos/${PROJECT}/trunk SVNTEST |
| | 332 | |
| | 333 | At this point, you can get rid of all of the conversion materials |
| | 334 | |
| | 335 | $ cd .. |
| | 336 | $ rm -rf cvs2svnSandbox |