src help [command]
Displays help for commands.
-src add ['file'...]
- Initialize new project histories for specified files. Creates
- the repository directory if required.
-
src commit [- | -m 'string' | -f 'file' | -e] ['file'...]
Enters a commit for specified files. Separately to each one.
+ A history is created for the file if it does not aleady exist.
With '-', take comment text from stdin; with '-m' use the
following string as the comment; with '-f' take from a file.
With '-e', edit even after '-f' or '-m'. ci is a synonym for commit.
src status ['file'...]
A = added, . = unmodified, M = modified, ! = missing, ? = not tracked,
- I = ignored, L = locked (recover with src checkout). The L
+ I = ignored, L = locked (recover with src checkout). The A and L statuses
status should only occur if you have used RCS directly on a file.
src cat ['revision'] ['file'...]
if self.end > len(metadata):
croak("{0} has no {1} revision".format(metadata.name, self.end))
-def add_method(*args):
- "Register a file into src control."
- if not os.path.exists(repodir):
- try:
- os.mkdir(repodir)
- except OSError:
- croak(" %s creation failed, check directory permissions." % repodir)
- ctx = CommandContext("add", args, require_empty=True)
- for arg in ctx.args:
- if not os.path.exists(arg):
- croak("I see no '%s' here." % arg)
- elif os.path.exists(backend.master(arg)):
- croak("%s is already registered." % arg)
- else:
- backend.add(arg)
- if not quiet and len(ctx.args) > 1:
- announce("%s -> 0" % arg)
-
class CommentContext:
def __init__(self, legend, args):
"Attempt to collect a comment from command line args."
for arg in ctx.args:
if not os.path.exists(arg):
croak("I see no '%s' here." % arg)
- elif not os.path.exists(backend.master(arg)):
- croak("%s is not registered." % arg)
comment.edit()
for arg in ctx.args:
- with backend.lifter(arg):
- backend.checkin(arg, comment.content())
- if not quiet and len(args) > 1:
- announce("%s -> %d" % (arg, len(History(arg))))
+ if not os.path.exists(backend.master(arg)):
+ if not os.path.exists(repodir):
+ try:
+ os.mkdir(repodir)
+ except OSError:
+ croak(" %s creation failed, check directory permissions." % repodir)
+ backend.add(arg)
+ with backend.lifter(arg):
+ backend.checkin(arg, comment.content())
+ if not quiet and len(args) > 1:
+ announce("%s -> %d" % (arg, len(History(arg))))
def amend_method(*args):
"Amend comments in stored revisions."
pairs.append((fn, "."))
if not args:
for m in registered:
- if m not in candidates:
+ if backend.workfile(m) not in candidates:
pairs.append((m, "!"))
pairs.sort()
for (fn, status) in pairs:
dispatch = {
"help": help_method,
- "add": add_method,
"commit": commit_method,
"ci": commit_method,
"amend": amend_method,
src help [command]::
Displays help for commands.
-src add ['file'...]::
- Initialize new project histories for specified files. Creates
- the repository directory if required.
-
src commit [- | -m string | -f file | -e] ['file'...]::
Enters a commit for specified files. Separately to each one.
+ A history is created for the file if it does not aleady exist.
With '-', take comment text from stdin; with '-m' use the
following string as the comment; with '-f' take from a file.
With '-e', edit even after '-f' or '-m'. ci is a synonym for commit.
src status ['file'...]::
A = added, . = unmodified, M = modified, ! = missing, ? = not tracked,
- I = ignored, L = locked (recover with src checkout). The L
- status should only occur if you have used RCS directly on a file.
+ I = ignored, L = locked (recover with src checkout). The A and L
+ statuses should only occur if you have used RCS directly on a file.
src cat [revision-range] ['file'...]::
Send the specified revisions of the files to standard output.