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

Sune Foldager cryo at cyanite.org
Wed Oct 8 14:59:32 CDT 2008


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 :-).

Sincerly,
Sune.



More information about the Mercurial-devel mailing list