Commit fbd56833 authored by Eric S. Raymond's avatar Eric S. Raymond

With no selection set and no name, make assign list all assignments.

parent ef94d82d
......@@ -19,7 +19,7 @@
<cmdsynopsis>
<command>repomapper</command>
<arg choice="opt">-i</a>
<arg choice="opt">-i</arg>
<arg choice="opt">-p <replaceable>passwordfile</replaceable></arg>
<arg choice="opt">-u <replaceable>updatefile</replaceable></arg>
<arg choice="opt">-h <replaceable>host</replaceable></arg>
......
......@@ -8031,7 +8031,12 @@ def do_assign(self, line):
complain(b"no repo has been chosen.")
return
if self.selection is None:
raise Recoverable(b"No selection")
if line:
raise Recoverable(b"No selection")
else:
print(repo.assignments)
for n, v in repo.assignments.items():
announce("%s = %s" % (n, v))
name = line.strip()
if name in repo.assignments:
raise Recoverable(b"%s has already been set" % name)
......
......@@ -2348,6 +2348,8 @@ any existing branch name. Assignments may be cleared by sequence
mutations (though not ordinary deletions); you will see a warning
when this occurs.</para>
<para>With no selection set and no name, list all assignments.</para>
<para>Use this to optimize out location and selection computations
that would otherwise be performed repeatedly, e.g. in macro calls.</para>
</listitem>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment