src help [command]
Displays help for commands.
-src commit [-a] [- | -m 'string' | -f 'file' | -e] ['file'...]
+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 already 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.
- Find out more under 'help commit'.
src amend [- | -m string | -f file | -e] ['revision'] ['file'...]
Amends the stored comment for a specified revision, defaulting to the
latest revision on the current branch. Flags are as for commit.
+src add ['file'...]
+ Initialize new project histories for specified files. Creates
+ the repository directory if required. This command is not intended
+ for human use - commit adds files when necessary. It's a helper
+ for Emacs VC mode.
+
src checkout ['revision'] ['file'...]
Refresh the working copies of the file(s) from their history files.
'co' is a synonym for checkout.
You can usually recover of file from A, L, and ! status with src
checkout. A and L statuses should only occur if you have used RCS
-directly on a file.
+directly on a file, or if you have called 'src add' manually.
If you give 'src status' no filename arguments, it surveys all files
in the current directory but untracked and ignored files
which are usually designed to create changesets common to multiple
files.
-The -a option is not for human use, but provided to fit Emacs
-VC-mode's model of the editing/version-control cycle. With -a, the
-file is registered but no first commit is performed.
-
'ci' is a synonym for commit.
""",
"amend" : """
except OSError:
croak(" %s creation failed, check directory permissions." % repodir)
args = list(args)
- addflag = False
- if args:
- if args[0] == '--':
- args.pop(0)
- elif args[0] == '-a':
- addflag = True
- args.pop(0)
comment = CommentContext("commit", args)
ctx = CommandContext("commit", args, require_empty=True)
for arg in ctx.args:
else:
if not registered(arg):
backend.add(arg)
- if not addflag:
- with backend.lifter(arg):
- backend.checkin(arg, comment.content())
+ with backend.lifter(arg):
+ backend.checkin(arg, comment.content())
if not quiet and len(args) > 1:
announce("%s -> %d" % (arg, revcount))
if not quiet and len(args) > 1:
announce("%s : %d" % (arg, ctx.start))
+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)
+
def list_method(*args):
"Generate a summary listing of commits, one line per commit."
args = list(args)
os.rename(fn, corresponding)
shutil.rmtree("RCS")
+
def version_method(*args):
"Report SRC's version"
sys.stdout.write("%s\n" % version)
"ci": commit_method,
"amend": amend_method,
"am": amend_method,
+ "add": add_method,
"list": list_method,
"li": list_method,
"log": log_method,