From 3aa7233bc6ebf34a5a629e831d4be7f31213d026 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sun, 9 Nov 2014 17:50:54 -0500 Subject: [PATCH] Support file restriction via arguments. --- rcs-fast-import | 16 +++++++++++----- rcs-fast-import.xml | 4 ++++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/rcs-fast-import b/rcs-fast-import index 84e9610..d114134 100755 --- a/rcs-fast-import +++ b/rcs-fast-import @@ -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) diff --git a/rcs-fast-import.xml b/rcs-fast-import.xml index 660f1c9..721c491 100644 --- a/rcs-fast-import.xml +++ b/rcs-fast-import.xml @@ -25,6 +25,7 @@ -p -V -? + file @@ -63,6 +64,9 @@ initialize a new file. 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. + +Normally all files are unpacked. You can restrict this by listing the +paths you are interested in on the command line. BUGS -- 2.43.0