# HG changeset patch # User Matt Mackall # Date 1316209195 18000 # Node ID 7ebf60dbfa46c185014a5f009ec2b09b17b68114 # Parent f7993be2c32f2f28bfd4bfe61708212d8e3375a8 diff: add help examples diff -r f7993be2c32f -r 7ebf60dbfa46 mercurial/commands.py --- a/mercurial/commands.py Fri Sep 16 15:31:21 2011 -0500 +++ b/mercurial/commands.py Fri Sep 16 16:39:55 2011 -0500 @@ -2186,6 +2186,32 @@ Use the -g/--git option to generate diffs in the git extended diff format. For more information, read :hg:`help diffs`. + .. container:: verbose + + Examples: + + - compare a file in the current working directory to its parent:: + + hg diff foo.c + + - compare two historical versions of a directory, with rename info:: + + hg diff --git -r 1.0:1.2 lib/ + + - get change stats relative to the last change on some date:: + + hg diff --stat -r "date('may 2')" + + - diff all newly-added files that contain a keyword:: + + hg diff "set:added() and grep(GNU)" + + - compare a revision and its parents:: + + hg diff -c 9353 # compare against first parent + hg diff -r 9353^:9353 # same using revset syntax + hg diff -r 9353^2:9353 # compare against the second parent + Returns 0 on success. """ diff -r f7993be2c32f -r 7ebf60dbfa46 tests/test-help.t --- a/tests/test-help.t Fri Sep 16 15:31:21 2011 -0500 +++ b/tests/test-help.t Fri Sep 16 16:39:55 2011 -0500 @@ -432,6 +432,8 @@ Returns 0 on success. + use "hg -v help diff" to show verbose help + options: -r --rev REV [+] revision