darcs

Patch 1154 Tidy up checkNewAndOldFilenames in the M... (and 17 more)

Title Tidy up checkNewAndOldFilenames in the M... (and 17 more)
Superseder Nosy List jlneder, owst
Related Issues
Status accepted Assigned To
Milestone

Created on 2014-05-11.15:10:13 by owst, last changed 2014-10-31.21:15:32 by ganesh.

Files
File name Status Uploaded Type Edit Remove
patch-preview.txt owst, 2014-05-11.15:10:13 text/x-darcs-patch
tidy-up-checknewandoldfilenames-in-the-move-command.dpatch owst, 2014-05-11.15:10:13 application/x-darcs-patch
unnamed owst, 2014-05-11.15:10:13
See mailing list archives for discussion on individual patches.
Messages
msg17445 (view) Author: owst Date: 2014-05-11.15:10:13
This patch set makes the move command work "properly", that is, it now acts
more intuitively. 

18 patches for repository http://www.darcs.net/screened:

Wed Apr 23 00:58:35 BST 2014  Owen Stephens <darcs@owenstephens.co.uk>
  * Tidy up checkNewAndOldFilenames in the Move command

Thu Apr 24 22:19:40 BST 2014  Owen Stephens <darcs@owenstephens.co.uk>
  * Resolve issue2380: allow darcs mv into known, but deleted in working, file

Wed Apr 30 03:35:25 BST 2014  Owen Stephens <darcs@owenstephens.co.uk>
  * renameHelper should not record all changes
  We were accidentally recording patches that removed files that we wanted to
  appear as shadow files (recorded as present, but missing in working)

Wed Apr 30 03:35:25 BST 2014  Owen Stephens <darcs@owenstephens.co.uk>
  * Allow post-hoc moves to known paths
  The new behaviour is to record patches that first delete the original contents,
  before adding the move patch 

Sun May 11 12:51:59 BST 2014  Owen Stephens <darcs@owenstephens.co.uk>
  * Tidy up of Move - refactor out some common code

Sun May 11 12:53:22 BST 2014  Owen Stephens <darcs@owenstephens.co.uk>
  * renameHelper now tests all combos of path status and path type
  (missing/unknown/known/shadow) for status and file/dir for type

Sun May 11 12:53:23 BST 2014  Owen Stephens <darcs@owenstephens.co.uk>
  * Accept issue2382: darcs is confused if a dir is moved inplace of a file

Sun May 11 12:53:23 BST 2014  Owen Stephens <darcs@owenstephens.co.uk>
  * Prevent updateIndex failing if a file is moved to a dir or vice-versa
  Now, if a file becomes a dir, trying to readFile (to update the index) treats
  the file as missing.
  

Sun May 11 12:53:23 BST 2014  Owen Stephens <darcs@owenstephens.co.uk>
  * Allow diff to handle a file changing to a dir or vice-versa
  It'll return a removal hunk ; rmfile ; adddir for the file dir case

Sun May 11 16:06:15 BST 2014  Owen Stephens <darcs@owenstephens.co.uk>
  * Give user more feedback when doing a move

Sun May 11 16:06:25 BST 2014  Owen Stephens <darcs@owenstephens.co.uk>
  * Make renameHelper much more efficient
  Add/record all initial state up front, rather than one file/dir at a time.
  Avoid extra system calls by using && to join multiple commands

Sun May 11 16:06:25 BST 2014  Owen Stephens <darcs@owenstephens.co.uk>
  * Fix a rename testcase marked as ok when it shouldn't be

Sun May 11 16:06:25 BST 2014  Owen Stephens <darcs@owenstephens.co.uk>
  * Implement moveToDir and simpleMove with common function
  Ensuring that move patches are not applied if the move is post-hoc

Sun May 11 16:06:25 BST 2014  Owen Stephens <darcs@owenstephens.co.uk>
  * Add addPendingDiffToPending function and comment addToPending
  The new function allows us to add a patch to pending that is based on the
  pending state of the repo, not working (as per addToPending). 

Sun May 11 16:06:25 BST 2014  Owen Stephens <darcs@owenstephens.co.uk>
  * Use addPendingDiffToPending to add move patch and deps to pending
  We used to add an explicit addfile/adddir patch that was a hacky way to get
  around the implementation of addToPending (the diff to working would notice the
  rmfile, which would be cancelled-out by the addfile). Now we can just add the
  move patch and its dependencies (e.g. removing an existing target) by creating
  a patch that starts at pending

Sun May 11 16:06:25 BST 2014  Owen Stephens <darcs@owenstephens.co.uk>
  * Always use MyersDiff when removing a file - the diff will be identical

Sun May 11 16:06:25 BST 2014  Owen Stephens <darcs@owenstephens.co.uk>
  * Tweak renameHelper - add trailing EOL in files and remove unnecessary $

Sun May 11 16:06:25 BST 2014  Owen Stephens <darcs@owenstephens.co.uk>
  * Move previously failing issue2382 test
Attachments
msg17448 (view) Author: ganesh Date: 2014-05-12.06:13:07
Any reason not to put this into screened?
msg17449 (view) Author: owst Date: 2014-05-12.08:22:09
None other than it's quite a large bunch of changes, and I think I just
wanted someone else to glance over it before I pushed it
msg17569 (view) Author: gh Date: 2014-06-24.23:51:53
Been involuntarily using this bundle since a month.. I'm screening it.
msg17681 (view) Author: gh Date: 2014-10-08.14:19:43
Note that one of these patches ("Prevent updateIndex failing") modifies
hashed-storage.

There seems to be a breakage of the look_for_moves.sh shell test, in the
part where we check that directory name swapping is detected by the
--look-for-moves flag.
msg17685 (view) Author: owst Date: 2014-10-08.18:23:23
> Note that one of these patches ("Prevent updateIndex failing") modifies
> hashed-storage.

Yes, indeed it does - if we modify a file to a dir or vice-versa, the
updateIndex notices that the path has changed, but assumes it's changed
to the
same "type".

> There seems to be a breakage of the look_for_moves.sh shell test, in the
> part where we check that directory name swapping is detected by the
> --look-for-moves flag.

I'm confused, do you mean now there is breakage? I'm pretty sure all the
tests
ran ok when I wrote this patch, so is it something that's changed since?
msg17702 (view) Author: gh Date: 2014-10-19.20:36:43
Sorry, I cannot reproduce the failure, and anyway it occured in a case
of --look-for-moves that was very peculiar (moving directory A to B and
B to A simultaneously), that I'm not sure we want to keep.
msg17728 (view) Author: ganesh Date: 2014-10-31.07:41:46
This has been sitting around for a while and should definitely get 
into  darcs 2.10. I've read through it, though not in great detail, 
and it all seems like a significant improvement and also clarifies 
the tests.

I *think* there might be occasional and intermittent breakage in one 
of the moves tests - perhaps the one Guillaume already mentioned - 
but I think it would be best to address that separately rather than 
holding up this patch.
History
Date User Action Args
2014-05-11 15:10:13owstcreate
2014-05-12 06:13:07ganeshsetmessages: + msg17448
2014-05-12 08:22:10owstsetmessages: + msg17449
2014-06-24 23:51:53ghsetstatus: needs-screening -> needs-review
messages: + msg17569
2014-10-08 14:19:44ghsetnosy: + jlneder
messages: + msg17681
2014-10-08 18:23:23owstsetmessages: + msg17685
2014-10-19 20:36:43ghsetmessages: + msg17702
2014-10-31 07:41:46ganeshsetstatus: needs-review -> accepted-pending-tests
messages: + msg17728
2014-10-31 21:15:32ganeshsetstatus: accepted-pending-tests -> accepted