[darcs-devel] darcs patch: add test case for replacing tokens with ... (and 3 more)

Ian Lynagh igloo at earth.li
Mon May 30 12:53:15 PDT 2005


On Mon, May 30, 2005 at 09:00:55PM +0200, Tommy Pettersson wrote:
> On Sun, May 29, 2005 at 02:34:01PM +0100, Ian Lynagh wrote:
> > 
> > I'm a bit lost here. If the regexp is on a line of its own, what is the
> > parsing problem?
> 
> If the spaced regexp can look like the triple
> <nospaceregexp,oldtok,newtok>, and the spaced oldtok on
> the next line can look like the end of patch, and so on,
> the parsing gets unnecessarily complicated.

Ah, so this is a problem with supporting both syntaxes in the same
parser? Then the best solution is not to do that, IMO.

When you see the tokens "replace" "1.0" call the old parser.
When you see the tokens "replace" "1.1" (or "2.0", whichever is
appropriate) call the new parser.

I guess we want a patch-version-parser that gives a "1.0" version if
there is no version number and the version number otherwise. Although to
keep things simple we'll have to use "1.0 replace" or "replace:1.0" or
something. I think the latter gets my vote, despite being a single
token; it just means we need a slightly different lexing function for
the first stage. After a release or few we can always drop the old patch
types and add an ability to support space instead of colon if that's
desirable. Mergers are going to need to be handled specially anyway.

> > > Or shall this wait for the repo format file thing?
> > 
> > I think this is planned to be in the next darcs release, so we may as
> > well wait IMO.
> 
> I'll stay tuned to supply updated patches.

Cool, thanks!


Ian





More information about the darcs-devel mailing list