[darcs-devel] darcs patch: add test for replace that messes with
un... (and 3 more)
David Roundy
droundy at darcs.net
Sun Jan 28 15:31:14 PST 2007
On Mon, Jan 29, 2007 at 12:02:59AM +0100, Eric Y. Kow wrote:
> > > 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?
Ah, I misread your example. You're right, that this different from what
I was talking about. On the other hand, this case looks like someone has
just done a manual --force, which is perfectly reasonable. So I'm still in
favor of this code, although your objection now makes more sense.
--
David Roundy
http://www.darcs.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.osuosl.org/pipermail/darcs-devel/attachments/20070128/34d57c70/attachment.pgp
More information about the darcs-devel
mailing list