From: Eric S. Raymond Date: Sun, 14 Nov 2010 06:02:19 +0000 (-0500) Subject: Removed the dryrun option. X-Git-Tag: 0.1~11 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=017bbddf00cb219a6123ff00bceb5b9d51406e6e;p=rcs-fast-import.git Removed the dryrun option. --- diff --git a/rcs-fast-import b/rcs-fast-import index 988b08d..0cc66e1 100755 --- a/rcs-fast-import +++ b/rcs-fast-import @@ -47,8 +47,6 @@ DEBUG_SHUFFLE = 3 # Debug directory handling DEBUG_COMMANDS = 3 # Show commands as they are executed DEBUG_DELETE = 4 # Debug canonicalization after deletes -dryrun = False - class Baton: "Ship progress indications to stdout." def __init__(self, prompt, endmsg='done', enable=False): @@ -561,8 +559,6 @@ def do_or_die(cmd, legend=""): announce("executing '%s'%s" % (cmd, legend)) if not verbose >= DEBUG_UNQUIET: cmd += ">/dev/null 2>&1" - if dryrun: - return try: retcode = subprocess.call(cmd, shell=True) if retcode < 0: @@ -575,14 +571,12 @@ def do_or_die(cmd, legend=""): def loud_remove(path): if verbose >= DEBUG_SHUFFLE: announce("removing %s" % (path,)) - if not dryrun: - os.remove(path) + os.remove(path) def loud_rename(source, target): if verbose >= DEBUG_SHUFFLE: announce("renaming %s to %s" % (source, target)) - if not dryrun: - os.rename(source, target) + os.rename(source, target) # # All VCS-specific code is beyond this point. At the moment there's # just one VCS class, for RCS, but it would be easy to write another @@ -679,11 +673,10 @@ class Generic: if copyfile: if verbose >= DEBUG_SHUFFLE: announce("linking %s to %s" % (os.path.relpath(copyfile), path)) - if not dryrun: - try: - os.link(copyfile, path) - except OSError, e: - raise FatalException("refusing to step on %s: %s." % (path, `e`)) + try: + os.link(copyfile, path) + except OSError, e: + raise FatalException("refusing to step on %s: %s." % (path,`e`)) return rcsdir def masterfiles(self): "List all masters." @@ -772,7 +765,7 @@ class RCS(Generic): do_or_die("co -u %s" % (" ".join(self.masterfiles()),)) if __name__ == '__main__': - (options, arguments) = getopt.getopt(sys.argv[1:], "lnpuvV?") + (options, arguments) = getopt.getopt(sys.argv[1:], "lpuvV?") do_unlocked_checkouts = False checkout_mode = None roundtrip = True @@ -784,8 +777,6 @@ if __name__ == '__main__': roundtrip = False elif switch in ('-l', '-u'): checkout_mode = switch - elif (switch == '-n'): - dryrun = True elif (switch == '-v'): verbose += 1 elif (switch == '-V'): diff --git a/rcs-fast-import.xml b/rcs-fast-import.xml index 19f5376..75a2cc9 100644 --- a/rcs-fast-import.xml +++ b/rcs-fast-import.xml @@ -23,7 +23,6 @@ -u -l -p - -n -V @@ -49,10 +48,6 @@ copies checked out. The -V option displays the program version number and exits. -? displays this help and exits. -The -n option sets dry-run mode; parse the import stream, then go through -all logic other than actually creating files. Useful for debugging in -combination with -v. - In order to preserve history, D file operations do not delete previously-created master files; instead, an empty file is checked in as the content and the file's RCS state tag is set to "Deleted". R