From: Eric S. Raymond Date: Thu, 6 Nov 2014 22:48:19 +0000 (-0500) Subject: Checkpoint the code. X-Git-Tag: 0.1~20 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=d0c3fc590bae02f8aabe680ebb7fabbf7c89d1f2;p=src.git Checkpoint the code. --- diff --git a/src b/src old mode 100755 new mode 100644 index 8350814..644e432 --- a/src +++ b/src @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python # # src - simple revision control. # @@ -251,6 +251,7 @@ def log_method(*args): sys.stdout.write(("-" * (width - 1)) + "\n") def checkout_method(*args): + "Refresh the working copy from the history file." (revspec, args) = preamble("checkout", args) if len(revspec) > 1: croak("checkout needs an empty or singleton revision spec") @@ -262,10 +263,11 @@ def checkout_method(*args): revision = "-r" + revlist[revspec[0]-1].revision else: croak("checkout cannot take a range") - do_or_die("mv .src/{0},v . && rm {0} && co -l -r%s {0} && mv {0},v .src".format(arg, revision)) + do_or_die("mv .src/{0},v . && rm -f {0} && co -l -r{1} {0} && mv {0},v .src".format(arg, revision)) announce("%s <- %d" % (arg, len(revlist))) def cat_method(*args): + "Dump revision content to srandard output." (revspec, args) = preamble("cat", args) for arg in args: revlist = log_capture(arg)