]> thyrsus.com Git - rcs-fast-import.git/commitdiff
Safety measure.
authorEric S. Raymond <esr@thyrsus.com>
Thu, 11 Nov 2010 15:57:34 +0000 (10:57 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Thu, 11 Nov 2010 15:57:34 +0000 (10:57 -0500)
rcs-fast-import
rcs-fast-import.xml

index 408d119c5a0fa893344af7929eab7b7187f5cd23..74154fbff414f96c352076d5ba5fbed880b16a03 100755 (executable)
@@ -578,9 +578,12 @@ class RCS:
                     except OSError:
                         raise FatalException("can't create %s." % rcsdir)
                 if verbose >= DEBUG_SHUFFLE:
-                    announce("copying %s to %s" % (os.path.relpath(copyfile), path))
+                    announce("linking %s to %s" % (os.path.relpath(copyfile), path))
                 if not dryrun:
-                    shutil.copy(copyfile, path)
+                    try:
+                        os.link(copyfile, path)
+                    except OSError:
+                        raise FatalException("refusing to step on %s." % path)
                 responsible = event.authors[0] or event.committer
                 command = "ci -q -l"
                 # If we were going to try to match committer or author
index d41777c88f3eceb432bf8d061425839a83412670..9bd47297349cac9d968b261fa2199f74ff3419d7 100644 (file)
 stdin into individual RCS master files in RCS subdirectories of the
 corresponding directory structure.</para>
 
+<para>It is recommended that you run this in an empty directory, as it
+will terminate with error rather than stepping on files that already
+exist in the current directory.</para>
+
 <para>With the -v option, emit a twirling-baton prompt during stream read, and
 more progress messages during RCS writes.</para>