From: Eric S. Raymond Date: Mon, 10 Nov 2014 01:06:26 +0000 (-0500) Subject: Improvements to src fast-import. X-Git-Tag: 0.4~34 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=4b3ef8659db324be050c6cabceca02e0423c2b50;p=src.git Improvements to src fast-import. --- diff --git a/NEWS b/NEWS index 031fc72..e6f82a9 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ ` src project news +Repository head: + Improvements to src fast-import. 0.3: 2014-11-09 There is now a "src status" command, and .srcignore affects it. diff --git a/src b/src index 1be6ae8..e4f7bed 100755 --- a/src +++ b/src @@ -350,12 +350,13 @@ src fast-export ['revision-range'] ['file'...] Export one or more projects to standard output as a git fast-import stream. The committer identification is copied from your Git configuration. -src fast-import [-p] +src fast-import [-p] ['file'...] Parse a git-fast-import stream from standard input. The modifications for each individual file become a SRC history. Mark, committer and author data, and mark cross-references to parent commits, are preserved in RFC-822-style headers on log comments unless the -p (plain) option - is given, in which case this metadata is discarded. + is given, in which case this metadata is discarded. Give arguments to + restrict the files imported. src release ['file'...] Release locks on files. This is never necessary in a normal workflow, @@ -839,8 +840,16 @@ def fast_export_method(*args): def fast_import_method(*args): "Accept a git fast-import stream on stdin, turn it into file histories." + if os.path.exists("RCS"): + croak("refusing to unpack into existing RCS directory!") # Force -l to fit SRC's lockless interface. do_or_die(r"rcs-fast-import -l " +" ".join(args)) + for fn in os.listdir("RCS"): + corresponding = os.path.join("RCS", os.path.basename(fn)) + if os.path.exists(fn): + croak("%s exists, aborting leaving RCS in place!" % corresponding) + os.rename(fn, corresponding) + shutil.rmtree("RCS") dispatch = { "help": help_method, diff --git a/src.asc b/src.asc index 83a1dc7..1126767 100644 --- a/src.asc +++ b/src.asc @@ -103,12 +103,13 @@ src fast-export ['revision-range'] ['file'...]:: Export one or more projects as a git fast-import stream. The committer identification is copied from your Git configuration. -src fast-import [-p]:: +src fast-import [-p] ['files'...]:: Parse a git-fast-import stream from standard input. The modifications for each individual file become a SRC history. Mark, committer and author data, and mark cross-references to parent commits, are preserved in RFC-822-style headers on log comments unless the -p (plain) option - is given, in which case this metadata is discarded. + is given, in which case this metadata is discarded. Give arguments + to restrict the files imported. src release ['file'...]:: Release locks on files. This is never necessary in a normal workflow, @@ -174,8 +175,8 @@ constant screen witch of 79. It's for regression testing. == REQUIREMENTS == The RCS tools at version 4 or later must be installed and accessible -on your path; rcs-fast-import(1) is required to support the src -fast-import command. +on your path; rcs-fast-import(1) at version 1.0 or later is required +to support the src fast-import command. == LIMITATIONS ==