2507 |
2507 |
2508 hg diff foo.c |
2508 hg diff foo.c |
2509 |
2509 |
2510 - compare two historical versions of a directory, with rename info:: |
2510 - compare two historical versions of a directory, with rename info:: |
2511 |
2511 |
2512 hg diff --git -r 1.0:1.2 lib/ |
2512 hg diff --git --from 1.0 --to 1.2 lib/ |
2513 |
2513 |
2514 - get change stats relative to the last change on some date:: |
2514 - get change stats relative to the last change on some date:: |
2515 |
2515 |
2516 hg diff --stat -r "date('may 2')" |
2516 hg diff --stat --from "date('may 2')" |
2517 |
2517 |
2518 - diff all newly-added files that contain a keyword:: |
2518 - diff all newly-added files that contain a keyword:: |
2519 |
2519 |
2520 hg diff "set:added() and grep(GNU)" |
2520 hg diff "set:added() and grep(GNU)" |
2521 |
2521 |
2522 - compare a revision and its parents:: |
2522 - compare a revision and its parents:: |
2523 |
2523 |
2524 hg diff -c 9353 # compare against first parent |
2524 hg diff -c 9353 # compare against first parent |
2525 hg diff -r 9353^:9353 # same using revset syntax |
2525 hg diff --from 9353^ --to 9353 # same using revset syntax |
2526 hg diff -r 9353^2:9353 # compare against the second parent |
2526 hg diff --from 9353^2 --to 9353 # compare against the second parent |
2527 |
2527 |
2528 Returns 0 on success. |
2528 Returns 0 on success. |
2529 """ |
2529 """ |
2530 |
2530 |
2531 cmdutil.check_at_most_one_arg(opts, 'rev', 'change') |
2531 cmdutil.check_at_most_one_arg(opts, 'rev', 'change') |
2962 |
2962 |
2963 hg graft -r 345 --base 234 |
2963 hg graft -r 345 --base 234 |
2964 |
2964 |
2965 is thus pretty much the same as:: |
2965 is thus pretty much the same as:: |
2966 |
2966 |
2967 hg diff -r 234 -r 345 | hg import |
2967 hg diff --from 234 --to 345 | hg import |
2968 |
2968 |
2969 but using merge to resolve conflicts and track moved files. |
2969 but using merge to resolve conflicts and track moved files. |
2970 |
2970 |
2971 The result of a merge can thus be backported as a single commit by |
2971 The result of a merge can thus be backported as a single commit by |
2972 specifying one of the merge parents as base, and thus effectively |
2972 specifying one of the merge parents as base, and thus effectively |