Re: cvs2git: redundant M-lines

Michael Haggerty <[email protected]> Thu, 03 Jul 2014 12:22:22 +0200
Newsgroups gmane.comp.version-control.subversion.cvs2svn.devel
Message-ID <[email protected]>
On 07/03/2014 08:31 AM, Matwey V. Kornilov wrote:
> I think something like the following. But I am not sure whether it
> breaks something else.
> 
> Index: git_output_option.py
> ===================================================================
> --- git_output_option.py        (revision 5458)
> +++ git_output_option.py        (working copy)
> @@ -64,7 +64,10 @@
> 
>    def branch_file(self, cvs_symbol):
>      MirrorUpdater.branch_file(self, cvs_symbol)
> -    self._modify_file(cvs_symbol, post_commit=False)
> +    blob1 = cvs_symbol.revision_reader_token
> +    blob2 = cvs_symbol.get_cvs_revision_source(Ctx()._cvs_items_db).revision_reader_token
> +    if blob1 != blob2:
> +      self._modify_file(cvs_symbol, post_commit=False)
> 
>    def finish(self):
>      MirrorUpdater.finish(self)

I'm afraid that's not always going to work.  The revision_reader_token
is an opaque object at the disposal of the revision reader.  It is just
a coincidence that in your configuration it is the SHA-1 of the blob.
For other configurations, it isn't even always used.  For example,
GitRevisionInlineWriter, later in the same file, doesn't work with a
revision reader and so when it is in use this token is not even set.

Michael

-- 
Michael Haggerty
[email protected]

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

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