From: Eric S. Raymond Date: Thu, 11 Nov 2010 17:51:46 +0000 (-0500) Subject: Better handling of copies. X-Git-Tag: 0.1~51 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=e5d7eb695942c844fb617d61f613c965eda7bbed;p=rcs-fast-import.git Better handling of copies. --- diff --git a/rcs-fast-import b/rcs-fast-import index 288e560..679d923 100755 --- a/rcs-fast-import +++ b/rcs-fast-import @@ -614,12 +614,13 @@ class RCS: # than doing nothing. os.rename(RCS.master(op.source), RCS.master(op.target)) def copy(self, source, target): - "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 - # a new master. - shutil.copy(RCS.master(source), RCS.master(target)) + "Perform RCS copies. Start the copy with no history" + uphere = os.path.basename(target) + do_or_die("co %s" % RCS.master(source), "copy checkout") + os.rename(source, here) + do_or_die("ci -i -m'Copy of %s' -l %s %s" + % (source, uphere, RCS.master(target))) + os.remove(uphere) def checkout(self, switch): "Post-conversion actions." if switch != '-l':