From: Eric S. Raymond Date: Wed, 10 Nov 2010 20:05:44 +0000 (-0500) Subject: Checkpoint before changing API. X-Git-Tag: 0.1~75 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=ec1d23fef56b9c57c37a02c3b53f5bc2fc313e00;p=rcs-fast-import.git Checkpoint before changing API. --- diff --git a/rcs-fast-import b/rcs-fast-import index 1143a4a..25d8f2a 100755 --- a/rcs-fast-import +++ b/rcs-fast-import @@ -541,23 +541,32 @@ class RCS: @staticmethod def master(filename): "Return the master file corresponding to a specified filename." - return "RCS/%s,v" % filename - def modify(self, path, mode, copy): + parts = os.path.split(filename) + parts.insert(-1, "RCS") + return os.path.join(parts) + def modify(self, event, path, mode, copyfile): "Perform RCS file checkins and modifications," rcsdir = os.path.join(os.path.dirname(path), "RCS") if not os.path.exists(rcsdir): try: - os.mkdir(rcsdir) + os.makdirs(rcsdir) except OSError: raise FatalException("can't create %s." % rcsdir) + workdir = os.path.dirname(filename) + masterfile = RCS.master(filename) + exists = os.path.exists(path) + shutil.copy(copyfile, workdir) + exists = os.path.exists(path) + if exists: + fp = do_or_die("ci -m '%s'" % (event.comment)) def rename(self, source, target): - "Preform RCS renames." + "Perform RCS renames." # Dodgy, but since user is more likely to be # interested in later versions this is better # than doing nothing. os.rename(RCS.master(op.source), RCS.master(op.target)) def copy(self, source, target): - "Preform RCS copies." + "Perform RCS copies." # The copy will get the original's history. # There's a case that what we ought to do instead # is check out the tip rev and use it to initialize @@ -608,7 +617,8 @@ if __name__ == '__main__': if verbose: announce("%5d M %s" % (i+1, op.path)) if not dryrun: - vcs.modify_file(op.path, op.mode, op.copyname) + vcs.modify_file(event, + op.path, op.mode, op.copyname) elif op.op in ("D", "deleteall"): # If we delete masters, we lose ability to # retrieve old versions.