Re: gnome & subversion

On พ., 2005-11-09 at 21:53 +0100, Michael Haggerty wrote:
> Brian W. Fitzpatrick wrote:
> > 
> > On Nov 9, 2005, at 10:28 AM, Michael Sweet wrote:
> > 
> >> Peter S. Housel wrote:
> >>
> >>> On Wed, 2005-11-09 at 09:13 +0100, Michael Haggerty wrote:
> >>>
> >>>> I haven't been around that long, but I don't remember seeing an 
> >>>> analysis
> >>>> of how the "file exists both in and out of Attic" situation can  arise.
> >>>> (Long-timers, correct me if I've overlooked something.)
> >>>

> By the way, a cowardly (but probably relatively robust) way to deal with
> such situations would be to rename the file in the attic to something
> like repo/a/Attic/Attic-file-f.txt.  That would allow cvs2svn to run to
> completion and would at least leave some kind of evidence in the svn
> repository of the situation.

That's the conclusion I came to. So I hacked my copy of cvs2svn to do
something like this.

Anyway, it gets further, but then it stumbles trying to sort out the
branches from the tags. I'd like to assume that they should all be
branches (should be safer - the don't look like recent/useful tags or
branches), but as I can't possibly list all the conflicts for every CVS
module as '--force-branch' arguments, I hacked cvs2svn a little more to
force such conflicts to create branches. I guess these are all ancient
development snapshots/branches that either never went anywhere or never
got merged with HEAD or whatever. If they're ever needed they can be
resurrected from CVS history.

Now it seems to complete. The output can be found here :

I'll start another run on all the modules in CVS and see if there are
any other remaining issues to report.

I've attached the patch showing the changes I made to get past the two
main hurdles. BTW, I had to work roll back cvs2svn to r1633 (from around
the time I last did this and it worked) and work from that. The more
recent few versions seemed to throw me this exception:

Is this worth a bug report?


Index: cvs2svn
--- cvs2svn	(revision 1633)
+++ cvs2svn	(working copy)
@@ -34,6 +34,7 @@
 import errno
 import popen2
 import types
+import random
   # Try to get access to a bunch of encodings for use with --encoding.
   # See for details.
@@ -1714,11 +1715,11 @@
                   % (self.rel_name,
                      prev, time.ctime(t_p), delta)
             Log().write(LOG_VERBOSE, msg)
-            if (delta > COMMIT_THRESHOLD
-                or delta < (COMMIT_THRESHOLD * -1)):
-              str = "%s: Significant timestamp change for '%s' (%d seconds)"
-              Log().write(LOG_WARN, str % (warning_prefix, self.rel_name,
-                                           delta))
+#            if (delta > COMMIT_THRESHOLD
+#                or delta < (COMMIT_THRESHOLD * -1)):
+#              str = "%s: Significant timestamp change for '%s' (%d seconds)"
+#              Log().write(LOG_WARN, str % (warning_prefix, self.rel_name,
+#                                           delta))
             current = prev
             prev = self.prev_rev[current]
             if not prev:
@@ -4287,13 +4288,17 @@
         # drop the 'Attic' portion from the pathname for the canonical name.
         cd.set_fname(os.path.join(dirname[:-6], fname), pathname)
-        # If this file also exists in the attic, it's a fatal error
+        # If this file also exists in the attic, it's a problem. Report it and
+        # rename the Attic copy for safety
         attic_path = os.path.join(dirname, 'Attic', fname)
         if os.path.exists(attic_path):
-          err = "%s: A CVS repository cannot contain both %s and %s" \
-                % (error_prefix, pathname, attic_path)
-          sys.stderr.write(err + '\n')
-          cd.fatal_errors.append(err)
+          randomnum = int(random.random() * 99999)
+          adjustedfname = "%s-%s,v" % (fname[0:-2], randomnum)
+          adjustedpath = os.path.join(dirname, 'Attic', adjustedfname)
+	  os.rename(attic_path, adjustedpath)
+          Log().write(LOG_WARN,
+		"%s: A CVS repository cannot contain both %s and %s. Attic copy renamed %s." \
+                % (error_prefix, pathname, attic_path, adjustedpath))
         cd.set_fname(pathname, pathname)
       Log().write(LOG_NORMAL, pathname)
@@ -4377,7 +4382,12 @@
   def is_not_forced(mismatch):
     name = mismatch[0]
     return not (name in Ctx().forced_tags or name in Ctx().forced_branches)
+  def go_on_force_it_anyway(mismatch):
+    name = mismatch[0]
+    Ctx().forced_branches.append(name)
+    return 0
   mismatches = filter(is_not_forced, mismatches)
+  mismatches = filter(go_on_force_it_anyway, mismatches)
   if mismatches:
     sys.stderr.write(error_prefix + ": The following symbols are tags "
                      "in some files and branches in others.\nUse "

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]