]> thyrsus.com Git - src.git/commitdiff
Checkpoint the code.
authorEric S. Raymond <esr@thyrsus.com>
Thu, 6 Nov 2014 22:48:19 +0000 (17:48 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Thu, 6 Nov 2014 22:48:19 +0000 (17:48 -0500)
src [changed mode: 0755->0644]

diff --git a/src b/src
old mode 100755 (executable)
new mode 100644 (file)
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)