]> thyrsus.com Git - rcs-fast-import.git/commitdiff
Support file restriction via arguments.
authorEric S. Raymond <esr@thyrsus.com>
Sun, 9 Nov 2014 22:50:54 +0000 (17:50 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Sun, 9 Nov 2014 22:50:54 +0000 (17:50 -0500)
rcs-fast-import
rcs-fast-import.xml

index 84e961013eb185660f11880a0fe6d0c353ebc873..d11413411f9092c975bcf584b23b70cdb7c4c233 100755 (executable)
@@ -7,7 +7,7 @@
 # Requires Python 2.5 or newer and RCS 5.7 or newer.
 #
 """
-Usage: rcs-fast-import [-v] [-p] [-u] [-l] [-V] [-?]
+Usage: rcs-fast-import [-v] [-p] [-u] [-l] [-V] [-?] files...
 
 Break the content of a git-fast-import stream on stdin into individual RCS
 master files in RCS subdirectories of the corresponding directory structure.
@@ -24,6 +24,9 @@ revisions; with the -u option, check out but do not lock.
 
 The -V option displays the program version number and exits. -? displays
 this help and exits.
+
+Normally all files are unpacked. You can restrict this by listing the
+paths you are interested in on the command line.
 """
 
 import sys, os, getopt, re, cStringIO, subprocess
@@ -831,20 +834,23 @@ if __name__ == '__main__':
                                 announce("%5s M %s" % (event.mark, op.path))
                             if op.mode == "160000":
                                 complain("cannot represent a submodule link in RCS")
-                            else:
+                            elif not arguments or op.path in arguments:
                                 vcs.modify(event, op.path, op.mode, op.copyname)
                         elif op.op in ("D", "deleteall"):
                             if verbose >= DEBUG_OPS:
                                 announce("%5s D %s" % (event.mark, op.path))
-                            vcs.delete(event, op.path)
+                            if not arguments or op.path in arguments:
+                                vcs.delete(event, op.path)
                         elif op.op == "R":
                             if verbose >= DEBUG_OPS:
                                 announce("%5s R '%s' '%s'" % (event.mark, op.source, op.target))
-                            vcs.rename(event, op.source, op.target)
+                            if not arguments:
+                                vcs.rename(event, op.source, op.target)
                         elif op.op == "C":
                             if verbose >= DEBUG_OPS:
                                 announce("%5s C '%s' '%s'" % (event.mark, op.source, op.target))
-                            vcs.copy(event, op.source, op.target)
+                            if not arguments:
+                                vcs.copy(event, op.source, op.target)
                         else:
                             raise FatalException("unknown op type %s" % op.op)
                     vcs.postcommit(event)
index 660f1c945b34260868b66aa20e021ffe5ae4593a..721c491a291d5d1ce0375042091b5e820c77464c 100644 (file)
@@ -25,6 +25,7 @@
   <arg choice='opt'>-p</arg>
   <arg choice='opt'>-V</arg>
   <arg choice='opt'>-?</arg>
+  <arg choice='plain' rep='repeat'><replaceable>file</replaceable></arg>
 </cmdsynopsis>
 </refsynopsisdiv>
 
@@ -63,6 +64,9 @@ initialize a new file.</para>
 <para>Import-stream branches are mapped to RCS revision branch structure.
 Each RCS master produced will include a list of branch tags, each of which
 has the value of the corresponding RCS branch identifier for that file.</para>
+
+<para>Normally all files are unpacked. You can restrict this by listing the
+paths you are interested in on the command line.</para>
 </refsect1>
 
 <refsect1 id='bugs'><title>BUGS</title>