[darcs-devel] [patch831] make that no repository-related modules ... (and 2 more)

Guillaume Hoffmann bugs at darcs.net
Wed May 30 20:24:55 UTC 2012


New submission from Guillaume Hoffmann <guillaumh at gmail.com>:

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 at gmail.com>
  * make that no repository-related modules depend on Darcs.Arguments

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

Mon May 28 18:52:44 ART 2012  Guillaume Hoffmann <guillaumh at gmail.com>
  * rm Darcs.Patch.MatchData making patterns simply String, style Arguments

----------
files: make-that-no-repository_related-modules-depend-on-darcs_arguments.dpatch, patch-preview.txt, unnamed
messages: 15731
nosy: gh
status: needs-screening
title: make that no repository-related modules ... (and 2 more)

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/patch831>
__________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-preview.txt
Type: text/x-darcs-patch
Size: 30029 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-devel/attachments/20120530/9603a58d/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: make-that-no-repository_related-modules-depend-on-darcs_arguments.dpatch
Type: application/x-darcs-patch
Size: 34866 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-devel/attachments/20120530/9603a58d/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unnamed
Type: application/octet-stream
Size: 5 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-devel/attachments/20120530/9603a58d/attachment-0001.obj>


More information about the darcs-devel mailing list