"Either execute a command or raise a fatal exception."
if legend:
legend = " " + legend
+ if debug == 0:
+ mute = " >/dev/null 2>&1"
+ else:
+ mute = ""
if debug >= DEBUG_COMMANDS:
announce(b"executing '%s'%s" % (dcmd, legend))
try:
- retcode = subprocess.call(dcmd, shell=True)
+ retcode = subprocess.call(dcmd + mute, shell=True)
if retcode < 0:
complain(b"child was terminated by signal %d." % -retcode)
elif retcode != 0:
elif not os.path.exists(".src/%s,v" % arg):
complain("%s is not registered." % arg)
else:
- do_or_die("mv .src/{0},v . && ci -l {0} && mv {0},v .src".format(arg))
- announce("%s %d" % (arg, revcount(arg)))
+ editor = os.getenv("EDITOR") or "emacsclient"
+ scratchfile = "/tmp/src%dtmp" % os.getpid()
+ do_or_die(editor + " " + scratchfile)
+ logcomment = open(scratchfile).read()
+ do_or_die("mv .src/{0},v . && ci -l -m'{1}' {0} && mv {0},v .src".format(arg, logcomment))
+ revlist = log_capture(arg)
+ announce("%s -> %d" % (arg, len(revlist)))
class RCSRevisionItem:
"Capture the state of an RCS revision item in the log."