]> thyrsus.com Git - src.git/commitdiff
Revert "src ls removed, it's redundant with src status -a."
authorEric S. Raymond <esr@thyrsus.com>
Sun, 16 Nov 2014 13:32:27 +0000 (08:32 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Sun, 16 Nov 2014 13:32:27 +0000 (08:32 -0500)
src
src.asc

diff --git a/src b/src
index 28812d26378d91490867c986bb6853c382d00b0b..3cb6b119dbef187d72bacd8f453592edf5fd4237 100755 (executable)
--- a/src
+++ b/src
@@ -394,6 +394,9 @@ src diff ['revision-range'] ['file'...]
    diffs the working copy against that stored revision; with a range,
    diff between the beginning and end of the range.
 
+src ls
+   List all registered files.
+
 src move 'old' 'new'
    Rename a workfile and its history. Refuses to step on existing
    workfiles or histories.  'mv' and 'rename' are synonyms.
@@ -1257,6 +1260,18 @@ def release_method(*args):
             with backend.lifter(arg):
                 backend.release(arg)
 
+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")
+
 def fast_export_method(*args):
     "Dump revision content to standard output."
     ctx = CommandContext("fast-export", args)
@@ -1357,6 +1372,7 @@ dispatch = {
     "di":          diff_method,
     "tag":         tag_method,
     "branch":      branch_method,
+    "ls":          ls_method,
     "move":        move_method,
     "mv":          move_method,
     "rename":      move_method,
diff --git a/src.asc b/src.asc
index 6f2f0c6ba4bdc0be9fd7a85941d1017df0e132ad..6d2d6e831dad58ace2c59fe341408bd1bc70e69f 100644 (file)
--- a/src.asc
+++ b/src.asc
@@ -103,7 +103,10 @@ src diff ['revision-range'] ['file'...]::
    diff between the beginning and end of the range. "di" is a synonym
    for "diff".
 
-src move 'old' 'new'::
+src ls::
+   List all registered files.
+
+src rename 'old' 'new'::
    Rename a workfile and its history. Refuses to step on existing
    workfiles or histories. 'mv' and 'rename' are synonyms.