From: Eric S. Raymond Date: Sun, 9 Nov 2014 20:28:53 +0000 (-0500) Subject: src release (documented but untested. X-Git-Tag: 0.4~38 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=f187d650780191718a1d0ec3ffe45156148ae2e1;p=src.git src release (documented but untested. --- diff --git a/src b/src index f5d51c5..ef822c1 100755 --- a/src +++ b/src @@ -356,6 +356,12 @@ src fast-import [-p] in RFC-822-style headers on log comments unless the -p (plain) option is given, in which case this metadata is discarded. +src release ['file'...] + Release locks on files. This is never necessary in a normal workflow, + which will be repeated edit-commit cycles, but it may be handy if you + have to interoperate with other tools that expect RCS masters to be + in their normal (unlocked) stare. + The omission of 'src remove' is a deliberate speed bump. """ @@ -720,7 +726,7 @@ def filecmd(legend, hook, args): if not os.path.exists(source): croak("I see no '%s' here." % source) elif not os.path.exists(backend.master(source)): - croak("%s is not registered, skipping." % source) + croak("%s is not registered, skipping" % source) elif os.path.exists(backend.master(target)): croak("%s is registered, I won't step on it" % source) elif os.path.exists(target): @@ -736,6 +742,19 @@ def copy_method(*args): "Copy a file and its history." filecmd("copy", backend.copy, args) +def release_method(*args): + "Release locks." + (revspec, args) = preamble(legend, args) + if revspec is not None: + croak("release doesn't take a revision spec") + for arg in 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, skipping" % arg) + else: + backend.release(arg) + def ls_method(*args): "List registered files." if args: @@ -841,6 +860,7 @@ dispatch = { "cp": copy_method, "fast-export": fast_export_method, "fast-import": fast_import_method, + "release": release_method, } class RCS: @@ -918,7 +938,7 @@ class RCS: do_or_die("cp {0} {1} && cp {2} {3}".format(source, target, self.master(source), self.master(target))) - def diff(diffspec1, diffspec2, diffopts, arg): + def diff(self, diffspec1, diffspec2, diffopts, arg): "Report a diff." # The || : suppresses the error return from diff(1) if diffspec1: @@ -926,6 +946,9 @@ class RCS: if diffspec2: diffspec2 = "-r" + diffspec1 do_or_die("rcsdiff -q {0} {1} {2} || :".format(diffspec, diffopts, arg),loud=True) + def release(self, arg): + "Release locks." + do_or_die("rcs -q -u {0},v".format(arg)) if __name__ == "__main__": command = list(sys.argv[1:]) diff --git a/src.asc b/src.asc index 66cf44a..e6af113 100644 --- a/src.asc +++ b/src.asc @@ -109,6 +109,12 @@ src fast-import [-p]:: in RFC-822-style headers on log comments unless the -p (plain) option is given, in which case this metadata is discarded. +src release ['file'...]:: + Release locks on files. This is never necessary in a normal workflow, + which will be repeated edit-commit cycles, but it may be handy if you + have to interoperate with other tools that expect RCS masters to be + in their normal (unlocked) stare. + The omission of 'src remove' is a deliberate speed bump. If no files are specified, all eligible files are operated on in sequence.