logtext += msg + "\n"
print msg
-def get_output(command):
+def do_it(command):
global logtext
logtext += "$ " + command + "\n"
(st, out) = commands.getstatusoutput(command)
record("error recovery begins")
for master in os.listdir("SCCS"):
if is_sccsmaster(master):
- get_output("unget " + master)
+ do_it("unget " + master)
print >>sys.stderr, """\
Danger! Danger!
Incomplete history in ./RCS -- remove it.
logtext += msg + "\n"
print >>sys.stderr, msg
-def get_output_or_die(command):
+def do_it_or_die(command):
global logtext
logtext += "$ " + command + "\n"
(st, out) = commands.getstatusoutput(command)
record("%s revisions: %s" % (stem, ", ".join(revisions)))
for rev in revisions:
cmd = 'prs -d":Dd: :Dm: :Dy: :T: :P:" -r%s SCCS/s.%s' % (rev, stem)
- date = get_output_or_die(cmd).strip()
+ date = do_it_or_die(cmd).strip()
try:
(day, month, year, tod, author) = date.split()
except ValueError:
rcsdate = day + " " + months[int(month)-1] + " " + year + " " + tod
progress("==> file %s, rev=%s, date=%s, author=%s" \
% (stem, rev, rcsdate, author))
- get_output_or_die("get -e -r%s %s" % (rev, sccsmaster(stem)))
+ do_it_or_die("get -e -r%s %s" % (rev, sccsmaster(stem)))
record("checked out of SCCS")
# replace SCCS keywords with RCS keywords
cmd = 'ci -f -r%s -d"%s" -w%s -t/dev/null %s' \
% (rev, rcsdate, author, stem)
cmd = "echo 'Initial revision.' | " + cmd
- get_output_or_die(cmd)
+ do_it_or_die(cmd)
record("initial checkin successful")
else:
# get RCS lock
# Above comment was from Brian Berliner's csh version,
# but it's not at all clear why this lock can be allowed
# to fail while the trunk one must succeed.
- get_output("rcs -l%s %s" % (lckrev, stem))
+ do_it("rcs -l%s %s" % (lckrev, stem))
record("got branch lock")
else:
# need to lock the trunk -- must succeed
- get_output_or_die("rcs -l %s" % (stem,))
+ do_it_or_die("rcs -l %s" % (stem,))
record("got trunk lock")
# Extract the delta message for this revision
- deltamsg = get_output_or_die("prs -r$rev SCCS/s.%s" % stem)
+ deltamsg = do_it_or_die("prs -r$rev SCCS/s.%s" % stem)
deltalines = deltamsg.split("\n")
while deltalines:
line = deltalines[0]
except OSError:
die("RCS checkin of delta failed")
# We're done with this master, unlock it.
- get_output_or_die("unget -r%s %s" % (rev, sccsmaster(stem)))
+ do_it_or_die("unget -r%s %s" % (rev, sccsmaster(stem)))
+
+ # Generate tags from snapshots created by Emacs VC mode
+ tagnames = os.path.join("SCCS", "VC-names")
+ if os.path.exists(tagnames):
+ for line in open(tagnames):
+ try:
+ (tag, dummy, filename, rev) = line.split()
+ except ValueError:
+ die("tags table in bad format.")
+ do_it_or_die("rcs -n%s:%s %s" % (tag, rev, os.path.basename(filename)))
# Replace all files for which there exist SCCS masters,
progress("replacing workfiles...")
for filename in os.listdir("SCCS"):
if is_sccsmaster(master):
- get_output("co " + rcsfile(workfile(master)))
+ do_it("co " + rcsfile(workfile(master)))
progress("done.")
# sccs2rcs ends here