Re: [PATCH] Make cvs2git a little more consitent

Michael Haggerty <[email protected]> Thu, 09 Dec 2010 21:33:26 +0100
Newsgroups gmane.comp.version-control.subversion.cvs2svn.devel
Message-ID <[email protected]>
On 12/09/2010 04:44 PM, Alex Bennee wrote:
> I've been experimenting with switching our incremental CVS repo
> conversion from the unmaintained parsecvs to cvs2git. However I found
> that subsequent imports would yield repos with different base commits.

Yes, that's not a surprise.

> This patch seems to improve the situation:
> 
> 15:42 buildbot@vnms/x86_64 [cvs2svn.svn] >svn diff
> Index: cvs2svn_lib/git_output_option.py
> ===================================================================
> --- cvs2svn_lib/git_output_option.py    (revision 5306)
> +++ cvs2svn_lib/git_output_option.py    (working copy)
> @@ -408,7 +408,7 @@
>                source_lod
>                ),
>            )
> -      for cvs_symbol in cvs_symbols:
> +      for cvs_symbol in sorted(cvs_symbols):
>          log_msg += "\n    %s" % (cvs_symbol.cvs_file.cvs_path,)
>      if is_initial_lod_creation:
>        if len(cvs_files_to_delete):
> 
> 

Thanks for the patch.  Indeed, you found one source of gratuitous
pseudo-randomness in the output, and you are right that the lines in the
log message should somehow be put in a deterministic order.

But instead of sorting by the CVSSymbol instances (which are ordered by
ID, which itself is not consistent from one run to the next), I just
committed a patch that sorts the log message lines by cvs_path, which
should be consistent across conversions (and will also make it easier to
find paths in the log messages).  I also added a similar sort of the
cvs_files_to_delete a few lines later.

I hope this helps the consistency.  Please let us know about your
experience with incremental conversion -- how reliably does it work for
you?  (It certainly cannot work 100% of the time, but I am very curious
what the actual percentage is.)  If you can find a recipe that works
most of the time, please report it, as I'm sure other people would be
interested.

Thanks,
Michael

-- 
Michael Haggerty
[email protected]
http://softwareswirl.blogspot.com/

------------------------------------------------------
http://cvs2svn.tigris.org/ds/viewMessage.do?dsForumId=1667&dsMessageId=2689293

To unsubscribe from this discussion, e-mail: [[email protected]].