[RFC/bzr-cvsps-import] Support for "bzr cvsps-import --fuzz=SECONDS"

John Arbash Meinel john at arbash-meinel.com
Mon Oct 22 16:07:49 BST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Harald Meland wrote:
> Hi,
> 
> while doing imports of some CVS archives, I discovered that the
> cvsps-import plugin doesn't expose the "-z <fuzz>" option of cvsps.
> One can of course generate the cvsps dump file by hand before running
> "bzr cvsps-import --cvsps-dum=PATH", but then you'd have to learn how
> to use cvsps all by itself, too.
> 
> Hence, the attached merge directive adds a "--fuzz=SECONDS" option to
> the cvsps-import command.
> 
> I've tested with bzr 0.91, which works[1], and also with bzr.dev,
> which breaks due to recent API changes; I'll leave fixing those API
> breaks to someone more familiar with bzr internals.
> 
> [1] Although I had to delete the cache generated using the default
>     fuzz factor from ~/.cvsps/ first.  It would be nice if cvsps
>     detected that its cache was generated using different settings, so
>     I haven't tried to work around this in the cvsps-import plugin...
> 

Thanks for the patch.

I'm not sure about this part:
- -        cmd = ['cvsps', '--cvs-direct', '-A', '-u', '-q',
- -               '--root', self.cvs_root,
- -               module,
- -              ]
+        cvsps_args = ['--cvs-direct', '-A', '-u', '-q',
+                      '--root', self.cvs_root,
+                      ]
+        if fuzz is not None:
+            cvsps_args.extend(['-z', str(fuzz)])
+        cmd = ['cvsps'] + cvsps_args + [module]

I personally would prefer:
       cmd = ['cvsps', '--cvs-direct', '-A', '-u', '-q',
              '--root', self.cvs_root,
             ]
       if fuzz is not None:
           cmd.extend(['-z', str(fuzz)])
       cmd.append(module)

Do you have a reason for preferring the other way?

We *could* always nuke the files in ~/.cvsps, but then you lose any caching
that cvsps does. I suppose you could store some settings in the conversion
files, and then see if things have changed. But that doesn't help if you try to
start the conversion 2 completely separate times.

I know I didn't focus too much on cvsps, because the --root option was breaking
on any sort of complex repository. It may have gotten better, but at least at
the time I had to go back and do manual rlog, etc, to get it to work.

Anyway, I'm happy to merge a patch like this if people find it useful.

Also, make sure you've updated to the tip of my trunk branch. I recently pushed
up some changes which should make it work with bzr.dev. I also pushed up some
older code I had which improved the parsing speed and memory consumption, as
well as making sure that file ids are static across branches.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHHLzEJdeBCYSNAAMRAj9ZAJ4x1r/bL8xGKO+Sjp5IIsEAtG8TzQCgsFv7
6M+O/8whfhsKyzRgfzHKbM0=
=0bpo
-----END PGP SIGNATURE-----



More information about the bazaar mailing list