src fast-export ['file'...]
Export one or more projects to standard output as a git fast-import stream.
The committer identification is copied from your Git configuration.
+
+src ls
+ List all registered files.
"""
def init_method(*args):
except OSError:
croak("repo directory %s does not exist" % repodir)
if len(masters) == 1:
- args += [master[:-2] for master in masters]
+ args += [backend.workfile(master) for master in masters]
else:
croak("%s requires at least one file argument" % cmd)
return(revspec, args)
def copyto_method(*args):
"Copy a file and its history to another directory."
- (revspec, args) = preamble("moveto", args)
+ (revspec, args) = preamble("copyto", args)
if revspec is not None:
croak("moveto doesn't take a revision spec")
if args:
if not quiet and len(args) > 1:
announce("%s -> %s" % target)
+def ls_method(*args):
+ "List registered files."
+ if args:
+ croak("ls cannot accept arguments")
+ try:
+ masters = os.listdir(repodir)
+ except OSError:
+ croak("repo directory %s does not exist" % repodir)
+ masters.sort()
+ for master in masters:
+ sys.stdout.write(backend.workfile(master) + "\n")
+
dispatch = {
"help": help_method,
"init": init_method,
"fast-export": fast_export_method,
"moveto": moveto_method,
"copyto": copyto_method,
+ "ls": ls_method,
}
class RCS:
return RCS.RCSLifter(name)
def master(self, arg):
return os.path.join(repodir, arg + ",v")
+ def workfile(self, arg):
+ return arg[:-2]
def add(self, arg):
"Register a file"
do_or_die("rcs -q -kb -i {0} </dev/null && mv {0},v {1}".format(arg, repodir))
Export one or more projects as a git fast-import stream.
The committer identification is copied from your Git configuration.
+src ls
+ List all registered files.
+
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
+fast-export, the listing modes of tag and branch, ls) you will see a reply
only if the operation failed.
Other commands (add, commit, checkout, tag creation and deletion,