DEBUG_COMMANDS = 1 # Show commands as they are executed
DEBUG_PARSE = 2 # Debug logfile parse
-# If true (option -T) use an artificial clock for regression testing
-pseudotime = False
+quiet = False # option -q: run more quietly
+pseudotime = False # option -T: artificial clock for regression testing
+
+
# Repo directory
repodir = ".src"
elif os.path.exists(master(arg)):
croak("%s is already registered." % arg)
else:
- do_or_die("rcs -q -kb -i {0} </dev/null && mv {0},v {1}".format(arg, repodir))
- announce("%s: 0" % arg)
+ do_or_die("rcs -q -kb -i {0} </dev/null && mv {0},v {1}".format(arg, repodir))
+ if not quiet and len(args) > 1:
+ announce("%s -> 0" % arg)
class lifted:
"Temporatily lift a master to the working directory."
comment = comment.replace("'", r"\'")
with lifted(arg):
do_or_die("ci -l -m'{1}' {0}".format(arg, comment))
- announce("%s -> %d" % (arg, len(RCSLog(arg))))
+ if not quiet and len(args) > 1:
+ announce("%s -> %d" % (arg, len(RCSLog(arg))))
def list_method(*args):
"Generate a summary listing of commits, one line per commit."
revision = master[len(master) - revspec[0]].revision
with lifted(arg):
do_or_die("rm -f {0} && rcs -q -u {0},v && co -q -l{1} {0}".format(arg, revision))
- announce("%s <- %d" % (arg, revspec[0]))
+ if not quiet and len(args) > 1:
+ announce("%s <- %d" % (arg, revspec[0]))
def cat_method(*args):
"Dump revision content to standard output."
else:
with lifted(arg):
do_or_die("rcs -n{0} {1}".format(tagname, arg))
+ if not quiet and len(args) > 1:
+ announce("tag %s removed from %s" % (tagname, arg))
def set_tags(args):
if not args:
revspec = master.resolve(revspec)
if revspec is None:
revision = master.tip().revision
+ revno = master.tip().revno
elif len(revspec) == 1:
revision = master.revno_to_rcs(revspec[0])
+ revno = revspec[0]
else:
croak("can't accept a range when setting tags.")
with lifted(arg):
do_or_die("rcs -N{0}:{1} {2}".format(tagname, revision, arg))
+ if not quiet and len(args) > 1:
+ announce("tag %s = %s in " % (tagname, revno, arg))
+
def tag_method(*args):
"Inspect, create, and delete tags."
while command and command[0].startswith("-"):
if command[0] == '-d':
debug += 1
+ elif command[0] == '-q':
+ quiet = True
elif command[0] == '-T':
pseudotime = True
elif command[0] == '-S':
If no files are specified, all eligible files are operated on in sequence.
+== NOISE CONTROL ==
+
+Silence is golden. When you have selected only one file to operate
+on, and the command is not a report generator (cat, log, list,
+fast-export, the listing modes of tag and branch) you will see a reply
+only if the operation failed.
+
+Other commands (add, commit, checkout, tag creation and deletion) give
+you a success message per file when operating on multiple files, so
+you will not be in doubt about which operation succeeded. This
+behavior can be suppressed with the -q option, placed 'before' the
+subcommand word.
+
== DEBUGGING OPTIONS ==
These will be of interet mainly to developers"
#
# Regression tester for SRC.
#
-trap "rm -f testfile* .sandbox/testfile*" 0 1 2 15
+
+# Needs to not be a subdirectory of here, or git gets confused
+SANDBOX=/tmp/src-sandbox
+
+trap "rm -f testfile* $SANDBOX/testfile*" 0 1 2 15
check() {
case $? in
esac
}
-TESTOPTS="-T -S .sandbox $*"
+TESTOPTS="-T -S $SANDBOX $*"
-rm -fr .sandbox
+rm -fr $SANDBOX
# Catches dumb and obvious case of code having a Python syntax error
src $TESTOPTS init
diff testfile12 testfile13
check "tag list check after deletion"
-# to do: fast-export
+exit 0
+mkdir $SANDBOX/foo
+src $TESTOPTS fast-export testfile1 >testfile14
+cat testfile14
+cat testfile14 | (cd $SANDBOX/foo >/dev/null; git init; git fast-import --quiet)
+(cd $SANDBOX/foo; git log)
+
+#(cd $SANDBOX/foo; git fast-export --all) >testfile15
+#diff testfile14 testfile15
+
# end