]> thyrsus.com Git - src.git/commitdiff
Improvements to src fast-import.
authorEric S. Raymond <esr@thyrsus.com>
Mon, 10 Nov 2014 01:06:26 +0000 (20:06 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Mon, 10 Nov 2014 01:06:26 +0000 (20:06 -0500)
NEWS
src
src.asc

diff --git a/NEWS b/NEWS
index 031fc725005041d0f640041f6eff4a27be19a21b..e6f82a974bc22214f45317b143ae1c96b634e586 100644 (file)
--- 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 1be6ae8719739fa75308a7cf0f2d9aa32f84f26f..e4f7bedf3c05d7a583fd8d1b9b16796630a22da1 100755 (executable)
--- 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 83a1dc7c637982c70d2ef6b76257448b98a59d68..1126767debb9762cf32525a37578238aaecab689 100644 (file)
--- 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 ==