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):
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:
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
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."
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
roundtrip = False
elif switch in ('-l', '-u'):
checkout_mode = switch
- elif (switch == '-n'):
- dryrun = True
elif (switch == '-v'):
verbose += 1
elif (switch == '-V'):
<arg choice='opt'>-u</arg>
<arg choice='opt'>-l</arg>
<arg choice='opt'>-p</arg>
- <arg choice='opt'>-n</arg>
<arg choice='opt'>-V</arg>
</cmdsynopsis>
</refsynopsisdiv>
<para>The -V option displays the program version number and exits. -? displays
this help and exits.</para>
-<para>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.</para>
-
<para>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