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

Re: Since there's a resurgence of interest in cvs2svn...

From: Marko Macek <Marko.Macek_at_gmx.net>
Date: 2002-10-22 22:20:27 CEST

Eric Gillespie wrote:
> I figured i would remind anyone wanting to hack on cvs2svn that
> the bug described in Issue 875
> (http://subversion.tigris.org/issues/show_bug.cgi?id=875),
> "cvs2svn combines separate commits", still exists. The patch in
> that issue makes the test case work, but doesn't always work.
> I'm trying to create a test case to make that patch fail.

My current patch is this:

--- /usr/bin/cvs2svn 2002-10-15 23:32:02.000000000 +0200
+++ cvs2svn 2002-10-22 22:13:28.000000000 +0200
@@ -271,6 +271,15 @@
      self.t_min = 1<<30
      self.t_max = 0

+ def has_file(self, fname):
+ for f, r in self.changes:
+ if f == fname:
+ return 1
+ for f, r in self.deletes:
+ if f == fname:
+ return 1
+ return 0
+
    def add(self, t, op, file, rev):
      # record the time range of this commit
      if t < self.t_min:
@@ -569,10 +578,12 @@

      # scan for commits to process
      process = [ ]
- for id, c in commits.items():
- if c.t_max + COMMIT_THRESHOLD < timestamp:
+ for xid, c in commits.items():
+ if c.t_max + COMMIT_THRESHOLD < timestamp or \
+ c.has_file(fname) or \
+ xid != id:
          process.append((c.t_max, c))
- del commits[id]
+ del commits[xid]

      # sort the commits into time-order, then commit 'em
      process.sort()

It handles two things:
   - different log message/author (id)
   - the same file must not be twice in the same commit

This should also fix the problem reported by Shun-ichi Goto.

Mark

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