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

[PATCH] cvs2svn.py (2/2): prevent combining revisions

From: Marko Macek <Marko.Macek_at_gmx.net>
Date: 2002-10-24 20:54:37 CEST

Hi!

ChangeLog:
   - prevent combining commits for files changed within a short time
period with the same id (author, log message)

Greg, you may want to add your comment about less-than-ideal behavior.

Regards,
Mark

--- ../patch-1/cvs2svn.py 2002-10-24 20:21:41.000000000 +0200
+++ cvs2svn.py 2002-10-24 20:38:49.000000000 +0200
@@ -272,11 +272,15 @@
 
 class Commit:
   def __init__(self):
+ self.files = { }
     self.changes = [ ]
     self.deletes = [ ]
     self.t_min = 1<<30
     self.t_max = 0
 
+ def has_file(self, fname):
+ return self.files.has_key(fname)
+
   def add(self, t, op, file, rev):
     # record the time range of this commit
     if t < self.t_min:
@@ -289,6 +293,7 @@
     else:
       # OP_DELETE
       self.deletes.append((file, rev))
+ self.files[file] = 1
 
   def get_metadata(self, pool):
     # by definition, the author and log message must be the same for all
@@ -579,7 +584,8 @@
     # scan for commits to process
     process = [ ]
     for scan_id, scan_c in commits.items():
- if scan_c.t_max + COMMIT_THRESHOLD < timestamp:
+ if scan_c.t_max + COMMIT_THRESHOLD < timestamp or \
+ scan_c.has_file(fname):
         process.append((scan_c.t_max, scan_c))
         del commits[scan_id]
 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Oct 24 20:55:18 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.