[PATCH 0 of 2] Better support for diffing individual changesets.

Matt Mackall mpm at selenic.com
Wed Oct 8 15:33:45 CDT 2008


On Wed, 2008-10-08 at 21:59 +0200, Sune Foldager wrote:
> Hi Matt,
> 
> On 08/10/2008, at 20.13, Matt Mackall wrote:
> 
> > On Wed, 2008-10-08 at 16:03 +0200, Sune Foldager wrote:
> >> These patches add a -c (--changeset) option to diff and extdiff.
> >> [...]
> >>
> > If I understand correctly, this is almost the same as hg export, no?
> > The difference being that it works with external diff?
> 
> 
> Yes... when used like hg diff -cr ..., it's about the same as hg  
> export ..., but I think it's a good addition for two reasons:
> 
> 1. People probably don't think about looking for the export command  
> when they want to see what differences a changeset contains, and
> 2. No such thing could be done with external diff, and I think it's a  
> good thing to keep the features somewhat in sync, so people can have  
> stronger expectations about the options of related commands.
> 
> Also, it provides a convenient way to diff the working dir against a  
> second parent (when used like hg diff --switch-parent, same with  
> extdiff). For what it's worth, I had no idea export could already do  
> something similar before I skimmed the code for it, because it was  
> right next to diff in commands.py ;-). But also log can do something  
> similar: hg log -pr .., but again without the --switch-parent feature  
> (-p apparently just picks the first parent).
> 
> Also, I guess this would work with individual files (I didn't touch  
> that part of the diff code at all), so that's another feature :-).

Ok, you've convinced me it's an interesting feature, I'm just not sure I
like having even more options for diff. It would be nice if we had some
standard way of referring to "the first parent of changeset x", "the
ancestor of x and y", etc. and then we'd have more general capability
everywhere without new options.

As for extdiff, it's also a bit unfortunate that we can't simply use an
external diff tool everywhere we provide diffs.

-- 
Mathematics is the supreme nostalgia of our time.



More information about the Mercurial-devel mailing list