Editing Cvs2svn

From BRL-CAD

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
 
At the end of 2007, preparations to convert BRL-CAD's CVS repository to Subversion began.  The cvs2svn tool was used to perform the conversion, initially with version 1.5.1 but later using the latest available 2.0.1 version.  The page is provided for historic reference on how the repository was converted including the steps that were taken.
 
At the end of 2007, preparations to convert BRL-CAD's CVS repository to Subversion began.  The cvs2svn tool was used to perform the conversion, initially with version 1.5.1 but later using the latest available 2.0.1 version.  The page is provided for historic reference on how the repository was converted including the steps that were taken.
  
Using version 1.5.1, cvs2svn using all default options took over 7 hours of processing before it filled up available hard disk space (only 3GB was available at the time).  More space was made available and cvs2svn version 2.0.1 was installed, which provided a new more direct and faster method of extracting data from the CVS repository.  Using the same default options, version 2.0.1 took just under 3 hours.  The conversion was performed by Christopher Sean Morrison (aka brlcad).  The details of this conversion process are documented in following.
+
Using version 1.5.1, cvs2svn using all default options took over 7 hours of processing before it filled up available hard disk space (only 3GB was available at the time).  More space was made available and cvs2svn version 2.0.1 was installed, which provided a new more direct and faster method of extracting data from the CVS repository.  Using the same default options, version 2.0.1 took just under 3 hours.  The details of this conversion process are documented in following.
  
 
= CVS repository preparations =
 
= CVS repository preparations =
Line 21: Line 21:
  
 
Upon performing a full checkout of the entire newly imported Subversion repository, the checkout failed in a branch (rel-5-1-branch) on checkout of cup.g from html/manuals/mged/. Upon review of the CVS root files, it was not apparent what was unique about cup.g,v other than the fact that there also existed a Cup.g,v (both of which existed in the Attic).  As that file was entirely a triviality as a v4 binary BRL-CAD database file used in a documentation example, both the uppercase and lowercase files were removed.
 
Upon performing a full checkout of the entire newly imported Subversion repository, the checkout failed in a branch (rel-5-1-branch) on checkout of cup.g from html/manuals/mged/. Upon review of the CVS root files, it was not apparent what was unique about cup.g,v other than the fact that there also existed a Cup.g,v (both of which existed in the Attic).  As that file was entirely a triviality as a v4 binary BRL-CAD database file used in a documentation example, both the uppercase and lowercase files were removed.
 
= The executable bit =
 
 
Although not a critical issue as the svn:executable property can easily be set on files after they're imported into Subversion, there were problems with files that were properly set as executable in CVS not getting properly set in Subversion.  Some scripts got the setting while others did not, other files that CVS did not make executable upon checkout (like C source files) were getting marked as executable.  It seemed to be a mix of problems, some caused by inconsistent permissions set on the CVS root files and by unexpected cvs2svn behavior that is inconsistent with the behavior of CVS.
 
 
There were indeed inconsistent permissions on the CVS root files that needed adjusting to make sure everything that should or should not be mode ugo+x had the appropriate bit setting.  With the repository repaired, attention was directed at the making sure the auto-props file also has the svn:executable property set on corresponding files.  Even with the auto-props carefully customized to list svn:executable for the files that should be executable, they still came across without the exec bit set.  In fact, it seemed the care and attention more categorically made all scripts files, for example, not have the executable properly set.  As the executable property is not critical, the files had the property set manually once the SVN repository went on-line.
 
 
UPDATE: Shortly after first posting this article, one of the cvs2svn developers (Michael Haggerty via IRC, thanks mhagger) contacted Sean regarding this write-up and the issues encountered with the BRL-CAD cvs2svn conversion.  He reviewed the config and input file settings and noted that the executable bit problems were directly the result of the auto-props file settings being used.  Contrary to SVN's behavior, cvs2svn interprets svn:executable as meaning '''''unset''' that property'' instead of setting it.  So, the file needed to have something like svn:executable=1 instead of just svn:executable to ensure the property was set.  This was at least the behavior as of version 2.0.1 of cvs2svn.  It was subsequently suggested that cvs2svn not diverge from SVN's behavior and instead allow a '''!'''svn:executable indicate the explicit ''unsetting'' of properties.
 
 
= Mime types =
 
 
The repository conversion went through yet another full conversion when it was discovered that several files in the repository had been marked as binary.  While Subversion does have improved binary diff management than CVS, it still will not show you the diff or history of a file that is marked as binary.  This was particularly detrimental in our repository as I originally used a standard Apache mime.types file in addition to a custom auto-props file.  The Apache mime type for a .tcl file is application/x-tcl which Subversion only understands as "binary", making it difficult to view the history.  The fix, of course, was to re-run the conversion without the Apache mime.types file but instead be much more more comprehensive about setting types in the auto-props file.
 
  
 
= Single project vs multiproject =
 
= Single project vs multiproject =
Line 150: Line 138:
 
         ignore_case=True,
 
         ignore_case=True,
 
         ),
 
         ),
 +
 +
    MimeMapper(r'/path/to/mime.types'),
  
 
     CVSBinaryFileEOLStyleSetter(),
 
     CVSBinaryFileEOLStyleSetter(),
Line 225: Line 215:
 
= Automatic properties =
 
= Automatic properties =
  
UPDATE:  As noted above regarding the svn:executable property settings, the auto-props file shown below was found to be not what we wanted with respect to how cvs2svn handles property settings that don't list a value.  As of version 2.0.1, cvs2svn treats valueless auto-props property settings as an indicator that cvs2svn should explicitly '''unset''' the property instead of setting it.  As this behavior may be changed in future versions, consult the cvs2svn documentation.
+
The following auto-props file was used:
 
 
Regardless, the following auto-props file that was ultimately used for the BRL-CAD conversion is as follows:
 
  
 
<pre>
 
<pre>
 
[auto-props]
 
[auto-props]
 
*.[0-9] = svn:mime-type=text/plain;svn:eol-style=native
 
*.[0-9] = svn:mime-type=text/plain;svn:eol-style=native
*.a = svn:mime-type=application/octet-stream
 
 
*.ac = svn:eol-style=native;svn:mime-type=text/plain
 
*.ac = svn:eol-style=native;svn:mime-type=text/plain
 
*.ai = svn:mime-type=application/illustrator
 
*.ai = svn:mime-type=application/illustrator
Line 238: Line 225:
 
*.asc = svn:eol-style=native;svn:mime-type=text/plain
 
*.asc = svn:eol-style=native;svn:mime-type=text/plain
 
*.avi = svn:mime-type=video/x-msvideo
 
*.avi = svn:mime-type=video/x-msvideo
*.awk = svn:eol-style=native;svn:mime-type=text/plain
 
*.bat = svn:eol-style=CRLF;svn:mime-type=text/plain;svn:executable
 
 
*.bmp = svn:mime-type=image/bmp
 
*.bmp = svn:mime-type=image/bmp
*.c = svn:eol-style=native;svn:mime-type=text/plain
+
*.c = svn:eol-style=native
*.cc = svn:eol-style=native;svn:mime-type=text/plain
+
*.cpp = svn:eol-style=native
*.chm = svn:mime-type=application/octet-stream
+
*.cxx = svn:eol-style=native
*.com = svn:eol-style=native;svn:mime-type=text/plain
 
*.cpp = svn:eol-style=native;svn:mime-type=text/plain
 
*.cs = svn:eol-style=native;svn:mime-type=text/plain
 
 
*.css = svn:mime-type=text/css;svn:eol-style=native
 
*.css = svn:mime-type=text/css;svn:eol-style=native
*.csv = svn:eol-style=native;svn:mime-type=text/plain
+
*.doc = svn:mime-type=application/msword
*.cur = svn:mime-type=application/octet-stream
+
*.dsp = svn:eol-style=CRLF
*.cxx = svn:eol-style=native;svn:mime-type=text/plain
+
*.dsw = svn:eol-style=CRLF
*.decls = svn:eol-style=native;svn:mime-type=text/plain
 
*.def = svn:eol-style=native;svn:mime-type=text/plain
 
*.doc = svn:mime-type=text/plain
 
*.dsp = svn:eol-style=CRLF;svn:mime-type=text/plain
 
*.dsw = svn:eol-style=CRLF;svn:mime-type=text/plain
 
*.dylib = svn:mime-type=application/octet-stream
 
*.enc = svn:eol-style=native;svn:mime-type=text/plain
 
 
*.eps = svn:mime-type=application/postscript
 
*.eps = svn:mime-type=application/postscript
*.f = svn:eol-style=native;svn:mime-type=text/plain
 
 
*.g = svn:mime-type=application/octet-stream
 
*.g = svn:mime-type=application/octet-stream
 
*.gif = svn:mime-type=image/gif
 
*.gif = svn:mime-type=image/gif
Line 265: Line 239:
 
*.gtar = svn:mime-type=application/x-gtar
 
*.gtar = svn:mime-type=application/x-gtar
 
*.gz = svn:mime-type=application/x-gtar
 
*.gz = svn:mime-type=application/x-gtar
*.h = svn:eol-style=native;svn:mime-type=text/plain
+
*.h = svn:eol-style=native
*.hpp = svn:eol-style=native;svn:mime-type=text/plain
+
*.hpp = svn:eol-style=native
*.hqx = svn:mime-type=application/mac-binhex40
+
*.hxx = svn:eol-style=native
 
*.htm = svn:mime-type=text/html;svn:eol-style=native
 
*.htm = svn:mime-type=text/html;svn:eol-style=native
 
*.html = svn:mime-type=text/html;svn:eol-style=native
 
*.html = svn:mime-type=text/html;svn:eol-style=native
*.hxx = svn:eol-style=native;svn:mime-type=text/plain
+
*.igs = svn:mime-type=model/iges
 
*.ico = svn:mime-type=image/x-icon
 
*.ico = svn:mime-type=image/x-icon
*.igs = svn:mime-type=model/iges
 
 
*.in = svn:eol-style=native;svn:mime-type=text/plain
 
*.in = svn:eol-style=native;svn:mime-type=text/plain
*.itcl = svn:eol-style=native;svn:mime-type=text/plain
+
*.itcl = svn:eol-style=native
*.itk = svn:eol-style=native;svn:mime-type=text/plain
+
*.itk = svn:eol-style=native
*.jar = svn:mime-type=application/java-archive
+
*.java = svn:eol-style=native
*.java = svn:eol-style=native;svn:mime-type=text/plain
 
 
*.jpeg = svn:mime-type=image/jpeg
 
*.jpeg = svn:mime-type=image/jpeg
 
*.jpg = svn:mime-type=image/jpeg
 
*.jpg = svn:mime-type=image/jpeg
*.l = svn:eol-style=native;svn:mime-type=text/plain
 
*.log = svn:eol-style=native;svn:mime-type=text/plain
 
 
*.m4 = svn:eol-style=native;svn:mime-type=text/plain
 
*.m4 = svn:eol-style=native;svn:mime-type=text/plain
*.man* = svn:mime-type=text/plain;svn:eol-style=native
 
 
*.mov = svn:mime-type=video/quicktime
 
*.mov = svn:mime-type=video/quicktime
 
*.mp3 = svn:mime-type=audio/mpeg
 
*.mp3 = svn:mime-type=audio/mpeg
 
*.mpg = svn:mime-type=video/mpeg
 
*.mpg = svn:mime-type=video/mpeg
*.ms = svn:eol-style=native;svn:mime-type=text/plain
 
*.msg = svn:eol-style=native;svn:mime-type=text/plain
 
*.n = svn:eol-style=native;svn:mime-type=text/plain
 
 
*.nsi = svn:mime-type=text/plain;svn:eol-style=native
 
*.nsi = svn:mime-type=text/plain;svn:eol-style=native
*.pbxproj = svn:mime-type=text/plain;svn:eol-style=native
 
 
*.pdf = svn:mime-type=application/pdf
 
*.pdf = svn:mime-type=application/pdf
 
*.php = svn:mime-type=text/plain;svn:eol-style=native
 
*.php = svn:mime-type=text/plain;svn:eol-style=native
 
*.pix = svn:mime-type=image/x-rgb
 
*.pix = svn:mime-type=image/x-rgb
*.pl = svn:eol-style=native;svn:executable;svn:mime-type=text/plain
+
*.pl = svn:eol-style=native;svn:executable
*.perl = svn:eol-style=native;svn:executable;svn:mime-type=text/plain
 
 
*.plist = svn:mime-type=text/plain
 
*.plist = svn:mime-type=text/plain
 
*.png = svn:mime-type=image/png
 
*.png = svn:mime-type=image/png
*.ppm = svn:mime-type=image/x-portable-pixmap
 
 
*.ppt = svn:mime-type=application/vnd.ms-powerpoint
 
*.ppt = svn:mime-type=application/vnd.ms-powerpoint
 
*.ps = svn:mime-type=application/postscript
 
*.ps = svn:mime-type=application/postscript
 
*.psd = svn:mime-type=application/photoshop
 
*.psd = svn:mime-type=application/photoshop
*.py = svn:eol-style=native;svn:executable;svn:mime-type=text/plain
 
*.qpg = svn:mime-type=text/xml;svn:eol-style=native
 
*.r = svn:eol-style=native;svn:mime-type=text/plain
 
*.rc = svn:eol-style=CRLF;svn:mime-type=text/plain
 
*.res = svn:eol-style=native;svn:mime-type=text/plain
 
*.rgb = svn:mime-type=image/x-rgb
 
 
*.rt = svn:eol-style=native;svn:executable;svn:mime-type=text/x-sh
 
*.rt = svn:eol-style=native;svn:executable;svn:mime-type=text/x-sh
 
*.rtf = svn:mime-type=text/rtf
 
*.rtf = svn:mime-type=text/rtf
*.s = svn:eol-style=native;svn:mime-type=text/plain
 
 
*.sh = svn:eol-style=native;svn:executable;svn:mime-type=text/x-sh
 
*.sh = svn:eol-style=native;svn:executable;svn:mime-type=text/x-sh
 
*.sln = svn:eol-style=CRLF
 
*.sln = svn:eol-style=CRLF
 
*.smil = svn:mime-type=application/smil
 
*.smil = svn:mime-type=application/smil
*.so = svn:mime-type=application/octet-stream
 
*.spec = svn:eol-style=native;svn:mime-type=text/plain
 
 
*.svg  = svn:mime-type=image/svg+xml
 
*.svg  = svn:mime-type=image/svg+xml
 
*.svgz = svn:mime-type=image/svg+xml
 
*.svgz = svn:mime-type=image/svg+xml
 
*.swf = svn:mime-type=application/x-shockwave-flash
 
*.swf = svn:mime-type=application/x-shockwave-flash
*.tcl = svn:eol-style=native;svn:mime-type=text/plain
+
*.tcl = svn:eol-style=native
*.tk = svn:eol-style=native;svn:mime-type=text/plain
 
*.terms = svn:eol-style=native;svn:mime-type=text/plain
 
*.test = svn:eol-style=native;svn:mime-type=text/plain
 
 
*.tex = svn:mime-type=text/x-tex
 
*.tex = svn:mime-type=text/x-tex
 
*.tgz = svn:mime-type=application/x-gtar
 
*.tgz = svn:mime-type=application/x-gtar
 
*.tif = svn:mime-type=image/tiff
 
*.tif = svn:mime-type=image/tiff
 
*.tiff = svn:mime-type=image/tiff
 
*.tiff = svn:mime-type=image/tiff
*.tr = svn:eol-style=native;svn:mime-type=text/plain
 
 
*.txt = svn:mime-type=text/plain;svn:eol-style=native
 
*.txt = svn:mime-type=text/plain;svn:eol-style=native
*.vbs = svn:eol-style=native;svn:mime-type=text/plain;svn:executable
+
*.vbs = svn:eol-style=CRLF;svn:executable
 
*.vcf = svn:mime-type=text/x-vcard
 
*.vcf = svn:mime-type=text/x-vcard
*.vcproj = svn:eol-style=CRLF;svn:mime-type=text/plain
+
*.vcproj = svn:eol-style=CRLF
 
*.xbm = svn:mime-type=image/x-xbitmap
 
*.xbm = svn:mime-type=image/x-xbitmap
 
*.xls = svn:mime-type=application/vnd.ms-excel
 
*.xls = svn:mime-type=application/vnd.ms-excel
 
*.xml = svn:mime-type=text/xml;svn:eol-style=native
 
*.xml = svn:mime-type=text/xml;svn:eol-style=native
*.y = svn:mime-type=text/plain;svn:eol-style=native
 
 
*.zip = svn:mime-type=application/zip
 
*.zip = svn:mime-type=application/zip
.cvsignore = svn:mime-type=text/plain;svn:eol-style=native
+
AUTHORS = svn:eol-style=native;svn:mime-type=text/plain
AUTHORS* = svn:eol-style=native;svn:mime-type=text/plain
+
BUGS = svn:eol-style=native;svn:mime-type=text/plain
BUGS* = svn:eol-style=native;svn:mime-type=text/plain
+
COPYING = svn:eol-style=native;svn:mime-type=text/plain
COPYING* = svn:eol-style=native;svn:mime-type=text/plain
+
ChangeLog = svn:eol-style=native;svn:mime-type=text/plain
ChangeLog* = svn:eol-style=native;svn:mime-type=text/plain
+
HACKING = svn:eol-style=native;svn:mime-type=text/plain
HACKING* = svn:eol-style=native;svn:mime-type=text/plain
+
INSTALL = svn:eol-style=native;svn:mime-type=text/plain
INSTALL* = svn:eol-style=native;svn:mime-type=text/plain
+
Makefile = svn:eol-style=native
Makefile* = svn:eol-style=native;svn:mime-type=text/plain
+
NEWS = svn:eol-style=native;svn:mime-type=text/plain
NEWS* = svn:eol-style=native;svn:mime-type=text/plain
+
README = svn:eol-style=native;svn:mime-type=text/plain
README* = svn:eol-style=native;svn:mime-type=text/plain
+
README.* = svn:eol-style=native;svn:mime-type=text/plain
TODO* = svn:eol-style=native;svn:mime-type=text/plain
+
TODO = svn:eol-style=native;svn:mime-type=text/plain
### catch-all for files starting and ending in all caps with optional (e.g. READ.ME)
+
### catch-all for files starting and ending in all caps
[A-Z._][A-Z._]*[A-Z._] = svn:eol-style=native;svn:mime-type=text/plain
+
[A-Z]*[A-Z] = svn:eol-style=native;svn:mime-type=text/plain
 
</pre>
 
</pre>
 
UPDATE: The auto-props shown above is shown for historic purposes only.  If you're looking for an up-to-date auto-props file to work with, you may want to try using [http://brlcad.org/~sean/subversion.config this one] from Sean instead.
 
  
 
= Results and statistics =
 
= Results and statistics =
  
The final cvs2svn processing was performed on:
+
The final cvs2svn processing resulted in a 2.8GB dumpfile and provided the following statistics:
FreeBSD bz.bzflag.bz 5.2.1-RELEASE FreeBSD 5.2.1-RELEASE #0: Mon Feb 23 20:45:55 GMT 2004    root@wv1u.btc.adaptec.com:/usr/obj/usr/src/sys/GENERIC  i386
 
Intel(R) Celeron(R) CPU 2.40GHz w/ 1GB mem
 
 
 
The conversion resulted in a 2.8GB dumpfile and provided the following summary statistics:
 
  
 
  cvs2svn Statistics:
 
  cvs2svn Statistics:
Line 376: Line 319:
 
  Last Revision Date:    Mon Dec 31 15:25:14 2007
 
  Last Revision Date:    Mon Dec 31 15:25:14 2007
 
  ------------------
 
  ------------------
  Timings (seconds):
+
  Timings (seconds) :
 
  ------------------
 
  ------------------
  1647   pass1    CollectRevsPass
+
  1731   pass1    CollectRevsPass
 
     0  pass2    CollateSymbolsPass
 
     0  pass2    CollateSymbolsPass
   483   pass3    FilterSymbolsPass
+
   567   pass3    FilterSymbolsPass
     1   pass4    SortRevisionSummaryPass
+
     2   pass4    SortRevisionSummaryPass
     2   pass5    SortSymbolSummaryPass
+
     4   pass5    SortSymbolSummaryPass
   459   pass6    InitializeChangesetsPass
+
   702   pass6    InitializeChangesetsPass
   342   pass7    BreakRevisionChangesetCyclesPass
+
   452   pass7    BreakRevisionChangesetCyclesPass
   568   pass8    RevisionTopologicalSortPass
+
   785   pass8    RevisionTopologicalSortPass
   155   pass9    BreakSymbolChangesetCyclesPass
+
   276   pass9    BreakSymbolChangesetCyclesPass
   341   pass10  BreakAllChangesetCyclesPass
+
   513   pass10  BreakAllChangesetCyclesPass
   376   pass11  TopologicalSortPass
+
   486   pass11  TopologicalSortPass
   330   pass12  CreateRevsPass
+
   342   pass12  CreateRevsPass
  15   pass13  SortSymbolsPass
+
    9   pass13  SortSymbolsPass
  14   pass14  IndexSymbolsPass
+
    8   pass14  IndexSymbolsPass
  3112   pass15  OutputPass
+
  3696   pass15  OutputPass
  7844   total
+
  9573   total
(initial pass with mime.types was 9573 total)
 
  
 
The result is a contiguous history of BRL-CAD development that has gone from RCS to CVS and now to SVN preserving more than 25 years of revision history.  The conversion was completed on January 10th, 2008.
 
The result is a contiguous history of BRL-CAD development that has gone from RCS to CVS and now to SVN preserving more than 25 years of revision history.  The conversion was completed on January 10th, 2008.
 
[[category:Historical documentation]]
 

Please note that all contributions to BRL-CAD may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see BRL-CAD:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)