darcs

Patch 831 make that no repository-related modules ... (and 2 more)

Title make that no repository-related modules ... (and 2 more)
Superseder Nosy List gh
Related Issues
Status accepted Assigned To
Milestone

Created on 2012-05-30.20:24:55 by gh, last changed 2012-06-01.00:09:34 by owst.

Files
File name Status Uploaded Type Edit Remove
make-that-no-repository_related-modules-depend-on-darcs_arguments.dpatch gh, 2012-05-30.20:24:55 application/x-darcs-patch
patch-preview.txt gh, 2012-05-30.20:24:55 text/x-darcs-patch
unnamed gh, 2012-05-30.20:24:55
See mailing list archives for discussion on individual patches.
Messages
msg15731 (view) Author: gh Date: 2012-05-30.20:24:55
Another round of patches that aim at isolating the module Darcs.Arguments
from low-level parts (patch- and repo-related code). 

The first patch moves a couple of simple flag-related functions
from Darcs.Arguments to Darcs.Flags, making a few modules in Repository.*
stopping to depend on Darcs.Arguments. They still depend on Darcs.Flags,
but at least the dependency is more focussed now since a lot of code in
Repository.* already depends on Darcs.Flags.

The next patch just does what it says. As a consequence Darcs.Arguments
almost import nothing from Darcs.Patch.* anymore, and Darcs.PrintPatch and
Darcs.SelectChanges no longer depend on Darcs.Arguments, but on Darcs.Flags.
Darcs.Commands and Darcs.Commands.Changes now depend on Darcs.PrintPatch
to have showFriendly.

Finally, "rm Darcs.Patch.MatchData" is about removing from Darcs.Arguments
any direct dependency to Darcs.Patch.*, by just using the type 'String'
inside the flags, instead of Darcs.Patch.MatchData.PatchMatch. Hence
Darcs.Arguments (and Darcs.Flags by the way) no longer depend on anything
inside Darcs.Patch.*.

The patch also deletes the module Darcs.Patch.MatchData, a change that is
not necessary if the idea is just to isolate Darcs.Arguments, but I
realised that MatchData was a pretty useless wrapper around String.

Its only feature is a Show instance that prefixes the pattern with the word
'pattern', and is only used when a range match fails. Anyway when such an
error happens, the patterns are already prefixed by
"Invalid index range match given to matchPatch:".
Hence I'm happy to throw away a piece of over-abstraction.

3 patches for repository http://darcs.net:

Mon May 28 16:07:06 ART 2012  Guillaume Hoffmann <guillaumh@gmail.com>
  * make that no repository-related modules depend on Darcs.Arguments

Mon May 28 16:56:55 ART 2012  Guillaume Hoffmann <guillaumh@gmail.com>
  * move function showFriendly from Darcs.Arguments to Darcs.PrintPatch

Mon May 28 18:52:44 ART 2012  Guillaume Hoffmann <guillaumh@gmail.com>
  * rm Darcs.Patch.MatchData making patterns simply String, style Arguments
Attachments
msg15785 (view) Author: owst Date: 2012-06-01.00:09:34
Perhaps a bit too much tidying mixed in here, but accepting anyway. Thanks!
History
Date User Action Args
2012-05-30 20:24:55ghcreate
2012-05-30 21:41:13ganeshsetstatus: needs-screening -> needs-review
2012-06-01 00:09:34owstsetstatus: needs-review -> accepted
messages: + msg15785