[PATCH] filemerge: wrap quotes around tool path

Steve Borho steve at borho.org
Mon Feb 4 15:03:44 CST 2008


On Mon, 2008-02-04 at 18:20 -0200, Alexis S. L. Carvalho wrote:
> Thus spake Steve Borho:
> > Slightly off-topic, but a feature that both hgmerge(.sh) and hgmerge.py
> > had but is currently not present in the new filemerge is that they
> > detected when a merge tool exits without changing the output file, but
> > still reports success.  This caught many of the messier failure cases.
> > 
> > I wrote this patch to catch the problem, but the file comparison doesn't
> > work and I don't know why.
> > 
> > diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
> > --- a/mercurial/filemerge.py
> > +++ b/mercurial/filemerge.py
> > @@ -193,6 +193,12 @@
> >      if _toolbool(ui, tool, "fixeol"):
> >          _matcheol(repo.wjoin(fd), back)
> >  
> > +    if not r and not fcm.cmp(wctx.filectx(fd).data()):
> > +        if ui.prompt(_(" output file %s appears unchanged\n"
> > +                       "was merge successful (yn)?") % fd,
> > +                     _("[yn]"), _("n")) != _("y"):
> > +            r = 1
> > +
> 
> fcm is a workingfilectx.  Its cmp method reads the file from the working
> dir and compares it with the string that you passed, which is the exact
> same thing.

That would explain it, thanks.

Is there an efficient way to tell whether the work copy file differs
from the first parent in this context?

-- 
Steve Borho (steve at borho.org)
http://www.borho.org/~steve/steve.asc
Key fingerprint = 2D08 E7CF B624 624C DE1F  E2E4 B0C2 5292 F2C6 2C8C



More information about the Mercurial-devel mailing list