[darcs-devel] darcs patch: add test for replace that messes with un... (and 3 more)

Eric Y. Kow eric.kow at gmail.com
Sun Jan 28 15:02:59 PST 2007


> > echo hej > a
> > darcs record -am hej
> > # uh-oh 
> > sed -e s/hej/xxx/ a > a.tmp; mv -f a.tmp a
> > darcs replace --ignore-times xxx hej a
> 
> No, it only needs to check against pristine.

Ok, but unless I'm misunderstanding things, isn't it actually skipping
the pristine check when the working check succeeds?

The code says something like this...
                  isJust (apply_to_slurpy (tokreplace f toks old new) work) ||
                  isJust (apply_to_slurpy (tokreplace f toks old new) cur)

It seems the test will succeed if applying to working regardless of what
happens to pristine, but shouldn't it say that I probably don't want to
change to 'hej' because the recorded version of the file already has it?

I'm certainly not disputing the idea of 'overwriting' a hunk with a
replace.  That seems handy enough, and so if a test succeeds in
pristine, we probably don't care what happens in working (uh... right?).

-- 
Eric Kow                     http://www.loria.fr/~kow
PGP Key ID: 08AC04F9         Merci de corriger mon français.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://lists.osuosl.org/pipermail/darcs-devel/attachments/20070129/325966c9/attachment.pgp


More information about the darcs-devel mailing list