Fwd: CVSNT repository conversion supported?

2 views
Skip to first unread message

Jiang Xin

unread,
May 25, 2006, 6:39:17 AM5/25/06
to whod...@googlegroups.com
---------- Forwarded message ----------
From: Jiang Xin <worldhe...@gmail.com>
Date: 2006-5-25 下午6:24
Subject: Re: CVSNT repository conversion supported?
To: d...@cvs2svn.tigris.org

>Michael Haggerty wrote:
>> Max Bowsher wrote:
>>> Michael Haggerty wrote:
>>>>> To what extent is cvs2svn advertised to be able to convert CVSNT
>>>>> repositories?  There seem to be an awful lot of support questions coming
>>>> >from CVSNT users.
>>> Advertised and official support: None.
>>
>> Do you know of a way that we could detect that a CVS file came from
>> CVSNT?  Then we could at least spit out a warning/disclaimer and a
>> pointer to the FAQ entry that I have promised to write.
>
> Diffing gives me:
>
> - --- CVS
> +++ CVSNT
> @@ -1,14 +1,17 @@
>  head     1.1;
>  access   ;
> - -symbols  ;
> +symbols ;
>  locks    ; strict;
>  comment  @# @;
>
>
>  1.1
>  date     2006.04.27.17.00.51;  author max;  state Exp;
>  branches;
>  next     ;
> +kopt   kv;
> +deltatype   text;
> +permissions    666;
>
>  desc
>  @@
>
>
> So it looks like we should look for any 'kopt', 'deltatype', or
> 'permissions' newphrases.

Recently, I merge all my CVSNT project into Subversion. At first it looks fine,
but latter I found it is a diaster.

cvs2svn can not find the keyword flag in RCS files, so all binary files imported
into subversion have attribute "svn:eol-style native".

I search this mailling list, and find this thread.
But there is no answer, so I decide to do it myself.

Following is the bugfix:

1. bugfix: apply default-eol only when mime_type is not set
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Index: cvs2svn
===================================================================
--- cvs2svn (.../cvs2svn-1.3.0) (revision 1487)
+++ cvs2svn (.../ossxp-cvs2svn-1.3.0) (revision 1487)
@@ -3484,7 +3484,7 @@
       mime_type = self.mime_mapper.get_type_from_filename(c_rev.cvs_path)
 
     if not c_rev.mode == 'b':
-      if not self.no_default_eol:
+      if not self.no_default_eol and mime_type is None:
         eol_style = 'native'
       elif mime_type and self.eol_from_mime_type:
         if mime_type.startswith("text/"):

2. bugfix: cvs2svn works with CVSNT RCS extension
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Index: cvs2svn_rcsparse/common.py
===================================================================
--- cvs2svn_rcsparse/common.py (.../cvs2svn-1.3.0) (revision 1487)
+++ cvs2svn_rcsparse/common.py (.../ossxp-cvs2svn-1.3.0) (revision 1487)
@@ -244,10 +244,18 @@
         if token == 'desc' or token[0] in string.digits :
           self.ts.unget(token)
           break
-        # consume everything up to the semicolon
-        while self.ts.get() != ';':
-          pass
 
+        # CVSNT store file expend_mod as revision flag
+        if token == "kopt":
+          semi, expand_mode = self.ts.mget(2)
+          self.sink.set_expansion(expand_mode)
+          if semi != ';':
+            raise RCSExpected(semi, ';')
+        else:
+          # consume everything up to the semicolon
+          while self.ts.get() != ';':
+            pass
+
       self.sink.define_revision(revision, timestamp, author, state, branches,
                                 next)
 
Wish it is help for people running cvs2svn on Windows.


Jiang Xin
--------------------
http://www.worldhello.net

 

Reply all
Reply to author
Forward
0 new messages