Commit 7d19bc8f authored by Eric S. Raymond's avatar Eric S. Raymond

Strip blobs can take a selection set.

parent 2277785e
......@@ -2,6 +2,7 @@
Repository head:
Output redirect with '>>' appends to the output file.
The strip blob command can take a selection set.
3.25: 2015-06-03
Reading hg is now supported through an extractor class, no plugin required.
......
......@@ -8594,7 +8594,7 @@ def do_write(self, line):
# interprets an empty argument list as '.'
if parse.redirected or not parse.line:
for option in parse.options:
if option.startswith(b"--format=b"):
if option.startswith(b"--format="):
vcs = option.split(b"=")[1]
try:
outfilter = file_filters[vcs][1]
......@@ -8643,6 +8643,9 @@ def help_strip(self):
and/or strip out topologically uninteresting commits. The modifiers for
this are 'blobs' and 'reduce' respectively; the default is 'blobs'.
A selection set is effective only with the 'blobs' option, defaulting to all
blobs. The 'reduce' mode always acts on the entire repository.
This is intended for producing reduced test cases from large repositories.
""")
def do_strip(self, line):
......@@ -8651,14 +8654,15 @@ def do_strip(self, line):
if repo is None:
complain(b"no repo has been chosen.")
return
if self.selection is None:
self.selection = self.chosen().all()
if not line:
striptypes = [b"blobs"]
else:
striptypes = line.split()
if "blobs" in striptypes:
for event in repo.events:
if isinstance(event, Blob):
event.set_content(b"Blob at %s\n" % event.mark)
for (_, event) in self.selected(Blob):
event.set_content(b"Blob at %s\n" % event.mark)
if "reduce" in striptypes:
interesting = set([])
for event in repo.events:
......
......@@ -1796,6 +1796,10 @@ with a small, self-identifying stub, leaving all metadata and DAG
topology intact. This is useful when you are reporting a bug, for
reducing large repositories to test cases of manageable size.</para>
<para>A selection set is effective only with the 'blobs' option,
defaulting to all blobs. The 'reduce' mode always acts on the entire
repository.</para>
<para>With the modifier 'reduce', perform a topological reduction that
throws out uninteresting commits. If a commit has all file
modifications (no deletions or copies or renames) and has exactly one
......
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