]> thyrsus.com Git - rcs-fast-import.git/commitdiff
Slightly improved logic, but still buggy.
authorEric S. Raymond <esr@thyrsus.com>
Wed, 10 Nov 2010 23:27:44 +0000 (18:27 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Wed, 10 Nov 2010 23:27:44 +0000 (18:27 -0500)
rcs-fast-import

index 69bfdc0ea4be727710b891d9238930f4e8e6284e..eedac30e8ce8b064b292dc5cd75ba963e1860cb2 100755 (executable)
@@ -595,7 +595,7 @@ class RCS:
                     except OSError:
                         raise FatalException("can't create %s." % rcsdir)
                 if verbose >= DEBUG_SHUFFLE:
-                    announce("copying %s to %s" % (copyfile, path))
+                    announce("copying %s to %s" % (os.path.relpath(copyfile), path))
                 if not dryrun:
                     shutil.copy(copyfile, path)
             responsible = event.authors[0] or event.committer
@@ -652,7 +652,7 @@ if __name__ == '__main__':
     vcs = RCS()
 
     try:
-        for (i, event) in enumerate(repo.events):
+        for event in repo.events:
             if isinstance(event, Blob) or isinstance(event, Reset) or isinstance(event, Passthrough):
                 continue
             elif isinstance(event, Tag):
@@ -664,31 +664,31 @@ if __name__ == '__main__':
                 for op in event.fileops:
                     if op.op == "M":
                         if verbose:
-                            announce("%5d M %s" % (i+1, op.path))
+                            announce("%5s M %s" % (event.mark, op.path))
                         committables.append((op.path, op.mode, op.copyname))
                     elif op.op in ("D", "deleteall"):
                         # If we delete masters, we lose ability to
                         # retrieve old versions.
                         if do_deletes:
                             if verbose:
-                                announce("%5d D %s" % (i+1, op.path))
+                                announce("%5s D %s" % (event.mark, op.path))
                             if not dryrun:
                                 vcs.remove(op.path)
                         elif verbose:
-                            announce("%5d D %s ignored" % (i+1, op.path))
+                            announce("%5s D %s ignored" % (event.mark, op.path))
                     elif op.op == "R":
                         if verbose:
-                            announce("%5d R '%s' '%s'" % (i+1, op.source, op.target))
+                            announce("%5s R '%s' '%s'" % (event.mark, op.source, op.target))
                         if not dryrun:
                             vcs.rename(op.source, op.target)
                     elif op.op == "C":
                         if verbose:
-                            announce("%d C '%s' '%s'" % (i+1, op.source, op.target))
+                            announce("%5s C '%s' '%s'" % (event.mark, op.source, op.target))
                         if not dryrun:
                             vcs.copy(ops.source, op.target)
                     else:
                         raise FatalException("unknown op type %s" % op.op)
-                    vcs.commit(event, committables)
+                vcs.commit(event, committables)
         vcs.checkout(checkout_mode)
         raise SystemExit, 0
     except FatalException, e: