[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] cvs2svn.py - new test release

From: Shun-ichi GOTO <gotoh_at_taiyo.co.jp>
Date: 2002-11-08 10:51:31 CET

Hi, Mark,

Thanks for you great patch!
I'm happy for supporting vendor branch.

>>>>> at Thu, 07 Nov 2002 22:02:59 +0100,
>>>>> Marko Macek <Marko.Macek@gmx.net> said,
>
> This is my newest test patch for cvs2svn with tags and branches support.

I'm having two minor problem with cvs2svn importing existing big
repository.

  1. If revision 1.1 (of RCS file) is 'dead' state (by cvs admin -o1.1 ?),
     cvs2svn fails.

  2. I met strange CVS repository. A RCS file exists in directory and
     Attic. I don't know how to make this situation (Maybe differernce
     of cvs program revisions?), and I don't know how we treat them.
     At least, currret cvs2svn handles both and deletion and changing
     might be occure in one transaction.

I have sample RCS files to reproduce these two, attached.

## and also attached very ad-hoc patch I used.

--- Regards,
 Shun-ichi Goto <gotoh@taiyo.co.jp>
   R&D Group, TAIYO Corp., Tokyo, JAPAN

--- cvs2svn-marko-p2-r3685.py Fri Nov 8 10:51:19 2002
+++ cvs2svn-gotoh.py Fri Nov 8 11:49:17 2002
@@ -49,6 +49,8 @@
 copy_from = { None: [ None, 0 ] }
 first_branch = None
 
+deleted_files = {}
+
 class CollectData(rcsparse.Sink):
   def __init__(self, cvsroot, log_fname_base):
     self.cvsroot = cvsroot
@@ -120,6 +122,9 @@
     else:
       op = OP_CHANGE
 
+ if op == OP_DELETE and revision == '1.1':
+ op = OP_CHANGE
+
     # store the rev_data as a list in case we have to jigger the timestamp
     self.rev_data[revision] = [int(timestamp), author, op, None]
 
@@ -357,10 +362,14 @@
 
     if op == OP_CHANGE:
       self.changes.append((file, rev, branch_name, tags, branches))
+ deleted_files[file] = 0
+ self.files[file] = 1
     else:
- # OP_DELETE
- self.deletes.append((file, rev, branch_name, tags, branches))
- self.files[file] = 1
+ if deleted_files[file] != 1:
+ # OP_DELETE
+ self.deletes.append((file, rev, branch_name, tags, branches))
+ deleted_files[file] = 1
+ self.files[file] = 1
 
   def get_metadata(self, pool):
     # by definition, the author and log message must be the same for all
@@ -497,6 +506,8 @@
       # wipe the pool, in case the delete loads it up
       util.svn_pool_clear(f_pool)
 
+ if self.changes == [] and self.deletes == []:
+ return # do nothing
     # get the metadata for this commit
     author, log, date = self.get_metadata(c_pool)
     fs.change_txn_prop(txn, 'svn:author', author, c_pool)
@@ -728,7 +739,7 @@
       print "CONVERTING BRANCH:", br
 
       if br != first_branch:
- if not branches_done.has_key(copy_from[br][0]):
+ if copy_from.has_key(br) and not branches_done.has_key(copy_from[br][0]):
           print "COPY FROM", copy_from
           print "COPIES DONE", copies_done
           print "SKIPPING:", br, "NEED:", copy_from[br][0]
@@ -758,7 +769,7 @@
   for tag in do_copies.keys():
     if copies_done.has_key(tag):
       continue
- if not branches_done.has_key(copy_from[tag][0]):
+ if copy_from.has_key(tag) and not branches_done.has_key(copy_from[tag][0]):
       continue
 
     rev = fs.youngest_rev(t_fs, c_pool)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Fri Nov 8 10:52:31 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.