Patch 1745 use AnchoredPath instead of FileName for... (and 8 more)

Title use AnchoredPath instead of FileName for... (and 8 more)
Superseder Nosy List bf
Related Issues
Status needs-review Assigned To

Created on 2018-10-14.00:20:11 by bf, last changed 2018-10-18.20:42:42 by bf.

File name Status Uploaded Type Edit Remove
fix-in-patch-index_-avoid-generating-repeated-move-patch-mods.dpatch bf, 2018-10-18.20:42:42 application/x-darcs-patch
patch-preview.txt bf, 2018-10-14.00:20:10 text/x-darcs-patch
patch-preview.txt bf, 2018-10-18.20:42:42 text/x-darcs-patch
unnamed bf, 2018-10-14.00:20:10 text/plain
unnamed bf, 2018-10-18.20:42:42 text/plain
use-anchoredpath-instead-of-filename-for-internal-path-representation.dpatch bf, 2018-10-14.00:20:10 application/x-darcs-patch
See mailing list archives for discussion on individual patches.
msg20403 (view) Author: bf Date: 2018-10-14.00:20:10
Note: it makes sense to review the first patch separately. Then pull/apply
the rest and run the tests. They all succeed for me. Some of the changes to
test scripts are not strictly needed for that but are included because they
make sense (IMO) and were motivated by earlier versions of the refactor that
made a few more changes to behavior. This latest incarnation, rebased more
often than is good for my sanity, tries very hard to preserve the existing

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

patch e03902aeb50727cb199584282ffd46f061b48793
Author: Ben Franksen <ben.franksen@online.de>
Date:   Thu Oct 11 23:18:34 CEST 2018
  * use AnchoredPath instead of FileName for internal path representation
  This is a large patch that touches many files. I have tried hard to make
  reviewing it as easy as possible by avoiding changes that aren't necessary
  to achieve the goal. For instance, in this patch, FileName is still used but
  is a synonym for AnchoredPath. I have resisted the temptation to include
  cleanup changes, except where it was necessary for me to make sense of
  existing code.
  AnchoredPath is now used throughout, from the UI down to the patches
  themselves, for all paths that potentially reference user content in a
  repository. This means paths under _darcs are /not/ included, and neither
  are paths /to/ a repository or a cache or other files not under darcs
  Arguments from the command line are sanitized and converted to AnchoredPath
  early on. This is now concentrated in two routines: pathsFromArgs, and
  pathSetFromArgs, see their documentation for details. We convert to FilePath
  only for IO operations or for display to the user.
  Parsing of prim V1 patches is a bit stricter now: it fails if paths are not
  explicitly relative i.e. start with "./". The standard constructor for the
  Name type (makeName) now checks that the invariants aren't violated, that
  is, a Name is never empty, ".", or "..". Unfortunately, the index code still
  needs to use unsafeMakeName because it violates these invariants, at least

patch cd6e1a2035f86da573f6d9eef21a2d6b2c0e715a
Author: Ben Franksen <ben.franksen@online.de>
Date:   Thu Oct 11 23:25:36 CEST 2018
  * rename FileName to AnchoredPath and remove the type synonym

patch 49ce550e44938c3ce8cc05f2158500df038c259b
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Oct 12 14:55:18 CEST 2018
  * make some test scripts more robust against change in wording of messages
  It shouldn't matter whether darcs says "We have conflicts..." or "There are
  conflicts..." etc.

patch 012ad33b2290e06df77dce3db94c1fd9aa559e9b
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Oct 12 22:04:08 CEST 2018
  * make test script independent from the order in which prim patches are offered
  The specific sorting order for prim patches in a record or amend is
  something we never specified (and I guess we don't want to do that), so our
  tests should not rely on it.

patch e8d4e47572b175ea769524d5e09b86464eba7a4e
Author: Ben Franksen <ben.franksen@online.de>
Date:   Thu Oct 11 02:04:40 CEST 2018
  * fix: fail if pending patch cannot be parsed
  The previous behavior was to silently ignore pending. This is bad because we
  want to know if the pending patch is corrupt. Note that parsing is now
  stricter and requires the leading "./". This invalidates some of the tests
  for darcs repair since we cannot record a pending patch with an invalid
  file path.

patch 9253d72801cb849f1474184b4baa0ba1173d3624
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Oct 14 00:57:23 CEST 2018
  * improve wording of warning message in maybeFixSubPaths

patch 92e94c8810ea48f5b848b537577ba41abf799166
Author: Ben Franksen <ben.franksen@online.de>
Date:   Tue Oct  9 13:01:01 CEST 2018
  * bugfix in whatsnew: must use chooseTouching, not choosePreTouching
  This bug was previously hidden because the old effectOnFilePaths did not
  always do the right thing. I trust the much simpler version that works with
  AnchoredPaths more that the old version that fiddles with the String
  representation. chooseTouching also makes more sense when you think about
  it: if we invert the patch that adds the new files then its effect on the
  paths is to remove them; thus choosePreTouching removes the interesting
  paths from its input before it calls chooseTouching, which gives us wrong
  results (now).

patch f867f1f5d3ffe8c466d1c9b219381ba649818bd3
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sat Oct 13 21:23:49 CEST 2018
  * bugfix in remove command: don't allow removal of root
  This will otherwise create an invalid pending patch causing subsequent darcs
  invocations to crash.

patch 441b08715437be817ef7cf0a63907ed6d5fcff7f
Author: Ben Franksen <ben.franksen@online.de>
Date:   Fri Oct 12 22:08:29 CEST 2018
  * adapt a test script: darcs no longer fails to detect this move 
  This was fixed by the FileName->AnchoredPath cleanup. I have no idea how or
  why in particular, except that we save a lot of tricky Char/String fiddling
  some of which may have been buggy.
msg20418 (view) Author: bf Date: 2018-10-18.20:42:42
a minor follow-up for the AnchoredPath refactor

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

patch 8fc258192b76374fd570e310f45496ff81a6e6d4
Author: Ben Franksen <ben.franksen@online.de>
Date:   Mon Oct 15 09:05:30 CEST 2018
  * fix in patch index: avoid generating repeated move patch mods
  This regression was due to a mistake in the AnchoredPatch refactor.
Date User Action Args
2018-10-14 00:20:11bfcreate
2018-10-18 20:39:32bfsetstatus: needs-screening -> needs-review
2018-10-18 20:42:42bfsetfiles: + patch-preview.txt, fix-in-patch-index_-avoid-generating-repeated-move-patch-mods.dpatch, unnamed
messages: + msg20418