commands: mention diff -c

Martin Geisler mg at lazybytes.net
Sun Feb 21 10:16:09 CST 2010


Benoit Boissinot <benoit.boissinot at ens-lyon.org> writes:

> On Sun, Feb 21, 2010 at 01:52:14PM +0100, Christian Ebert wrote:
>> * timeless on Sunday, February 21, 2010 at 01:22:30 +0200
>> > This patch is more for discussion than committing.
>> > 
>> > Most options take no arguments, -c is like -r, and it's in fact
>> > mutually exclusive with it, but entirely undocumented.
>> > 
>> > # HG changeset patch
>> > # User timeless <timeless at mozdev.org>
>> > # Date 1266708077 -7200
>> > # Node ID 01e33e2fd61eb1f1a0da8ac54278ba80f3638251
>> > # Parent  261cc6b0f15c7e83dcff7dd7d5f3607c098c29bd
>> > commands: mention diff -c
>> > 
>> > diff --git a/mercurial/commands.py b/mercurial/commands.py
>> > --- a/mercurial/commands.py
>> > +++ b/mercurial/commands.py
>> > @@ -1114,6 +1114,9 @@ def diff(ui, repo, *pats, **opts):
>> >     revisions are specified, the working directory files are compared
>> >     to its parent.
>> > 
>> > +    Alternatively you can specify -c with a revision to use as a
>> > +    baseline.
>> > +
>> 
>> A wording that implicitly informs about the difference between
>> "hg diff -c <rev>" and "hg log -p -r <rev>" would be nice ;-)
>> 
>> Well, at least for me as I don't quite grasp the concept. Is the
>> only difference that "hg diff -c" omits the patch header?
>
> Yes, that. And you can pass many options to diff to tweak the output,
> that you can't easily pass to log.

Funny, I've always just thought of 'hg diff -c X' as a short way to
specify 'hg diff -r X-1 -r X', without having to compute the parent of X
manually.

-- 
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20100221/8578b61c/attachment.pgp>


More information about the Mercurial-devel mailing list