Patch 2268 optimize reorder: add --deep/--shallow o... (and 3 more)

Title optimize reorder: add --deep/--shallow o... (and 3 more)
Superseder Nosy List bf
Related Issues
Status needs-review Assigned To

Created on 2022-11-25.22:16:33 by bf, last changed 2022-11-27.20:30:43 by bf.

File name Status Uploaded Type Edit Remove
clean-up-getrecordeduptomatch-and-the-commands-that-use-it.dpatch bf, 2022-11-27.20:30:39 application/x-darcs-patch
optimize-reorder_-add-__deep___shallow-option.dpatch bf, 2022-11-25.22:16:27 application/x-darcs-patch
patch-preview.txt bf, 2022-11-25.22:16:27 text/x-darcs-patch
patch-preview.txt bf, 2022-11-27.20:30:39 text/x-darcs-patch
See mailing list archives for discussion on individual patches.
msg23046 (view) Author: bf Date: 2022-11-25.22:16:27
Three patches for optimize subcommands plus one cleanup dependency.

4 patches for repository http://darcs.net/screened:

patch 83f6afeba5d5f9da1320d34aeec61f86f766e857
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Jun 25 19:36:00 CEST 2021
  * optimize reorder: add --deep/--shallow option

  With --shallow (the default) the behavior is as before: we make the latest
  tag clean and create a Tagged section for it (which will become an inventory
  when saved to disk). Note that this may make the latest clean tag dirty. It
  may also increase the size of the head inventory and therefore fail to be an
  optimization, since the latest tag may cover less patches than an earlier
  clean tag.

  With --deep, we traverse all patches in order, trying to make every tag
  clean as long as that doesn't make any previous clean tag dirty, and create
  Tagged sections (and thus inventories) for all of them. Since this never
  makes a clean tag dirty, the size of the head inventory is guaranteed to be
  smaller or equal to the original one. This operation is idempotent.

patch 5d6bdbf9a695247173d9bbc6ff9afa66a1cc73d7
Author: Ben Franksen <ben.franksen@online.de>
Date:   Thu Nov 24 23:54:43 CET 2022
  * optimize (un)compress: also handle pristine

patch 4afe38f0a53cc3551436be01a4ebae3be1c02e22
Author: Ben Franksen <ben.franksen@online.de>
Date:   Mon Jun 27 19:18:05 CEST 2022
  * use System.Directory.withCurrentDirectory instead of Darcs.Util.File.<same>

  This does not catch exceptions and has no special treatment of "". Catching
  expceptions such as "does not exist" in such a generic way is bad, so this
  is not just simpler but also more informative to the end user. The special
  treatment of "" seems to be no longer needed.

patch fcf29158c008dcf67ad115e69078c508f25dd48d
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Nov 25 22:43:56 CET 2022
  * optimize cache: remove traversal of darcs repos and clean the cache properly

  Previously you could pass repositories as arguments (and if you didn't, it
  would search your whole HOME for darcs repos) and then it would do the
  equivalent of `darcs clean` on them, too. This functionality is is out of
  scope for darcs and can be emulated with a simple shell command e.g.

  > find -type d -name _darcs -execdir darcs optimize clean \;

  What remains is to clean the global cache. There is a much better solution
  for this and it is already implemented in Darcs.Util.Cache.cleanCaches:
  simply remove all files in the cache that have a hard-link count < 2. This
  is what the command now does (for all three types of hashed dirs).
msg23047 (view) Author: bf Date: 2022-11-27.20:30:39
One more semantic dependency (a cleanup patch) that I failed to explicitly
depend on; without this building fails.

1 patch for repository http://darcs.net/screened:

patch 931e3c8a6342487b4e05ffd1e9ac8e141d8f2542
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Mar  6 13:01:04 CET 2021
  * clean up getRecordedUpToMatch and the commands that use it

  The procedure now returns a tree and has been renamed to
  getPristineUpToMatch. The commands that use it (dist, show files, show
  contents) now work directly with the resulting tree, rather than a freshly
  created temporary working directory. This is a lot simpler and more
  efficient. Incidentally, it allows to easily support match options for

  However, the predist command expects to be run inside a working tree. So we
  write out the tree to a temporary directory before the predist and read it
  back in afterwards. The extra cost of this is payed only if a predist
  command has been set (using setpref predist).
Date User Action Args
2022-11-25 22:16:33bfcreate
2022-11-25 22:19:36bfsetstatus: needs-screening -> needs-review
2022-11-27 20:30:43bfsetfiles: + patch-preview.txt, clean-up-getrecordeduptomatch-and-the-commands-that-use-it.dpatch
messages: + msg23047