converting CVS repo to bzr

Alexander Belchenko bialix at ukr.net
Sun Oct 25 12:09:52 GMT 2009


Alexander Belchenko пишет:
> Alexander Belchenko пишет:
>> Hi Ian,
>>
>> I'm trying to convert CVS repo of FTE project to bzr with your 
>> fast-import plugin.
>>
>> I'm working on Windows with standalone bzr.exe v.2.0.1 so my setup is 
>> interesting corner case. And BTW this is most default setup so far.
>>
>> What I found so far.
> [...]
>> (To be continued).
> 
> 3. If I understand correctly what your plugin trying to do inside 
> export-from-cvs is to run command:
> 
> cvs2bzr --dumpfile XXX.fi SOURCE
> 
> So I've run it this way manually:
>   File "C:\work\OSS\cvs2svn\trunk\cvs2svn_lib\git_run_options.py", line 
> 156, in process_extraction_options
>     if not (options.blobfile and options.dumpfile):
> AttributeError: Values instance has no attribute 'blobfile'
> 
> OK, it's not your fault, error comes from cvs2svn, but I want you notice 
> about this. This command simply does not work with latest cvs2svn trunk.

4. So I've managed to run cvs2bzr only with options file. In their 
example I've modified path to sort utility, plus specified valid paths 
to CVS repo and output dump fi file. Here is the diff:

C:\work\OSS\FTE\fte.sf.net\FTE>diff -u cvs2bzr-example.options fte.options
--- cvs2bzr-example.options     2009-10-21 14:24:47.328125000 +0300
+++ fte.options 2009-10-25 13:52:10.875000000 +0200
@@ -141,7 +142,7 @@

  # Set the name (and optionally the path) of some other executables
  # required by cvs2svn:
-ctx.sort_executable = r'sort'
+ctx.sort_executable = r"C:\Program Files\GnuWin32\bin\sort.exe"

  # Change the following line to True if the conversion should only
  # include the trunk of the repository (i.e., all branches and tags
@@ -472,7 +473,7 @@
  # "fastimport"-format dumpfile rather than to Subversion:
  ctx.output_option = BzrOutputOption(
      # The file in which to write the "fastimport" stream:
-    'cvs2svn-tmp/dumpfile.fi',
+    'fte.fi',

      # Write the file contents inline in the "fastimport" stream,
      # rather than using a separate blobs file (which "bzr fastimport"
@@ -521,7 +522,7 @@
      # The filesystem path to the part of the CVS repository (*not* a
      # CVS working copy) that should be converted.  This may be a
      # subdirectory (i.e., a module) within a larger CVS repository.
-    r'test-data/main-cvsrepos',
+    r'fte',

      # A list of symbol transformations that can be used to rename
      # symbols in this project.

I've ran conversion with command:

cvs2bzr.bat --options=fte.options

It seems conversion was successful because now I have fte.fi 178KiB in 
size. The tail of console session of cvs2bzr is below:

Creating Subversion r518 (commit)
Creating Subversion r519 (commit)
Creating Subversion r520 (commit)
Creating Subversion r521 (commit)
Creating Subversion r522 (commit)
Creating Subversion r523 (commit)
Creating Subversion r524 (commit)
Creating Subversion r525 (commit)
Creating Subversion r526 (commit)
Creating Subversion r527 (commit)
Creating Subversion r528 (commit)
Creating Subversion r529 (commit)
Done
Time for pass13 (CreateRevsPass): 2.609 seconds.
----- pass 14 (SortSymbolsPass) -----
Sorting symbolic name source revisions...
Done
Time for pass14 (SortSymbolsPass): 0.141 seconds.
----- pass 15 (IndexSymbolsPass) -----
Determining offsets for all symbolic names...
Done.
Time for pass15 (IndexSymbolsPass): 0.078 seconds
----- pass 16 (OutputPass) -----
Time for pass16 (OutputPass): 503.0 seconds.

cvs2svn Statistics:
------------------
Total CVS Files:               396
Total CVS Revisions:          1661
Total CVS Branches:            369
Total CVS Tags:                664
Total Unique Tags:               2
Total Unique Branches:           1
CVS Repos Size in KB:         3637
Total SVN Commits:             529
First Revision Date:    Sun Jan 30 19:11:36 2000
Last Revision Date:     Wed Sep 02 22:45:19 2009
------------------
Timings (seconds):
------------------
   4.4   pass1    CollectRevsPass
   0.2   pass2    CleanMetadataPass
   0.1   pass3    CollateSymbolsPass
   1.2   pass4    FilterSymbolsPass
   0.2   pass5    SortRevisionSummaryPass
   0.1   pass6    SortSymbolSummaryPass
   1.0   pass7    InitializeChangesetsPass
   0.9   pass8    BreakRevisionChangesetCyclesPass
   0.9   pass9    RevisionTopologicalSortPass
   0.5   pass10   BreakSymbolChangesetCyclesPass
   1.1   pass11   BreakAllChangesetCyclesPass
   0.8   pass12   TopologicalSortPass
   2.6   pass13   CreateRevsPass
   0.1   pass14   SortSymbolsPass
   0.1   pass15   IndexSymbolsPass
503.0   pass16   OutputPass
517.1   total

C:\work\OSS\FTE\fte.sf.net\FTE>bzr fast-import-info fte.fi
14:06:26 Collecting statistics ...
Command counts:
         0       blob
         0       checkpoint
         527     commit
         0       feature
         0       progress
         3       reset
         0       tag
File command counts:
         2368    filemodify
         16      filedelete
         0       filecopy
         0       filerename
         0       filedeleteall
Parent counts:
         1       parents-0
         524     parents-1
         2       parents-2
         4       total revisions merged
Commit analysis:
         no      executables
         no      separate authors found
         no      symlinks
         no      blobs referenced by SHA
Head analysis:
         [':1000000397'] refs/heads/fte-utf8
         [':1000000334'] refs/heads/tag-fixup.before-cvs-support
         [':1000000526'] refs/heads/master
Merges:
         1       :1000000356
         1       :1000000332
         1       :1000000333
         1       :1000000200
Reset analysis:
         2       lightweight tags

Now running import...

C:\work\OSS\FTE\fte.sf.net\FTE>bzr fast-import fte.fi fte.bzr
Creating destination repository ...
Shared repository with trees (format: 2a)
Location:
   shared repository: fte.bzr
14:08:01 Collecting statistics ...
14:08:02 Starting import of 527 commits ...
14:08:23 Updating branch information ...
          branch trunk now has 507 revisions and 1 tag
          branch fte-utf8 now has 352 revisions and 1 tag
          branch tag-fixup.before-cvs-support now has 335 revisions and 
2 tags
14:08:28 Updating the working tree for 
C:/work/OSS/FTE/fte.sf.net/FTE/fte.bzr/trunk ...
All changes applied successfully.
14:08:31 Packing repository ...
14:08:33 Removing obsolete packs ...
14:08:33 Imported 527 revisions, updating 3 branches and 1 tree in 0:00:31
To refresh the working tree for other branches, use 'bzr update' inside 
that branch.


So it seems conversion was successful in the end.




More information about the bazaar mailing list