From: Eric S. Raymond Date: Mon, 10 Nov 2014 18:42:59 +0000 (-0500) Subject: Clarify some terminology. And get closer to branching. X-Git-Tag: 0.4~10 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=9cbc3ba5e5ff029e3810f2e8aac5c2dc74d3b576;p=src.git Clarify some terminology. And get closer to branching. --- diff --git a/src b/src index 5b32d77..1d54bd3 100755 --- a/src +++ b/src @@ -245,12 +245,12 @@ src ls List all registered files. src move 'old' 'new' - Rename a file and its master. Refuses to step on existing files or masters. - 'mv' and 'rename' are synonyms. + Rename a workfile and its history. Refuses to step on existing + workfiles or histories. 'mv' and 'rename' are synonyms. src copy 'old' 'new' - Copy a file and its master. Refuses to step on existing files or masters. - 'cp' is a synonym. + Copy a workfile and its history. Refuses to step on existing files + or histories. 'cp' is a synonym. src fast-export ['revision-range'] ['file'...] Export one or more projects to standard output as a git fast-import stream. @@ -674,7 +674,8 @@ def tag_helper(args, legend, validation_hook, delete_method, set_method): set_method(name, revision, metadata, arg) if not quiet and len(args) > 1: # FIXME: Misleading message when creating a branch. - announce("%s %s = %s in " % (legend, name, revno, arg)) + #announce("%s %s = %s in " % (legend, name, revno, arg)) + pass def tag_method(*args): "Inspect, create, and delete tags." @@ -859,6 +860,8 @@ class RCS: def __enter__(self): do_or_die("mv {0}/{1},v .".format(repodir, self.name)) def __exit__(self, extype, value, traceback_unused): + if extype and debug > 0: + raise extype(value) do_or_die("mv {0},v {1}".format(self.name, repodir)) return True def lifter(self, name): @@ -916,15 +919,25 @@ class RCS: croak("branch deletion is not yet supported") def set_branch(self, name, revision, metadata, arg): "Set the specified branch to be default, creating it if required." - def branchfrom(c, p): - "Is c a branch child (not direct descendant) of parent p?" - c = c.split(".") - p = p.split(".") - return len(c) == len(p) + 2 and c[len(p):] == p - newsib = len(item for item in metatdata.revlist \ - if branchfrom(item.revision, baserev)) - croak("branch change is not yet supported") - #do_or_die("rcs -b%s %s" % (revision, name)) + if name in metadata.symbols: + base = metadata.symbols[name] + else: + def branchfrom(c, p): + "Is c a branch child (not direct descendant) of parent p?" + c = c.split(".") + p = p.split(".") + return len(c) == len(p) + 2 and c[len(p):] == p + baserev = metadata.current() + print "Beginning branch computation from", baserev + newsib = len([item for item in metadata.revlist \ + if branchfrom(item.revision, baserev)]) + print "Continuing branch computation" + # Use CVS sticky-tag format here? If so, we'd have to do + # some unscrambling just above in the non-new case + base = baserev + "." + str(newsib) + print "New branch", base + do_or_die("rcs -n{0}:{1} {2}".format(name, base, arg), loud=True) + do_or_die("rcs -b%s %s" % (base, arg), loud=True) def move(self, source, target): "Move a file and its history." do_or_die("mv {0} {1} && mv {2} {3}".format(source, target, diff --git a/src.asc b/src.asc index cbb322d..f8c6f1c 100644 --- a/src.asc +++ b/src.asc @@ -96,8 +96,8 @@ src ls:: List all registered files. src rename 'old' 'new':: - Rename a file and its master. Refuses to step on existing files or masters. - 'mv' and 'rename' are synonyms. + Rename a workfile and its history. Refuses to step on existing + workfiles or histories. 'mv' and 'rename' are synonyms. src copy 'old' 'new':: Copy a file and its master. Refuses to step on existing files or masters.