Show More
@@ -2599,7 +2599,7 b' def _parselinerangelogopt(repo, opts):' | |||||
2599 | except ValueError: |
|
2599 | except ValueError: | |
2600 | raise error.Abort(_('malformatted line-range pattern %s') % pat) |
|
2600 | raise error.Abort(_('malformatted line-range pattern %s') % pat) | |
2601 | try: |
|
2601 | try: | |
2602 |
fromline, toline = map(int, linerange.split(' |
|
2602 | fromline, toline = map(int, linerange.split(':')) | |
2603 | except ValueError: |
|
2603 | except ValueError: | |
2604 | raise error.Abort(_("invalid line range for %s") % pat) |
|
2604 | raise error.Abort(_("invalid line range for %s") % pat) | |
2605 | msg = _("line range pattern '%s' must match exactly one file") % pat |
|
2605 | msg = _("line range pattern '%s' must match exactly one file") % pat |
@@ -3280,7 +3280,7 b' def log(ui, repo, *pats, **opts):' | |||||
3280 |
|
3280 | |||
3281 | .. container:: verbose |
|
3281 | .. container:: verbose | |
3282 |
|
3282 | |||
3283 |
Use -L/--line-range FILE,M |
|
3283 | Use -L/--line-range FILE,M:N options to follow the history of lines | |
3284 | from M to N in FILE. With -p/--patch only diff hunks affecting |
|
3284 | from M to N in FILE. With -p/--patch only diff hunks affecting | |
3285 | specified line range will be shown. This option requires --follow; |
|
3285 | specified line range will be shown. This option requires --follow; | |
3286 | it can be specified multiple times. Currently, this option is not |
|
3286 | it can be specified multiple times. Currently, this option is not | |
@@ -3357,12 +3357,12 b' def log(ui, repo, *pats, **opts):' | |||||
3357 |
|
3357 | |||
3358 | - changesets touching lines 13 to 23 for file.c:: |
|
3358 | - changesets touching lines 13 to 23 for file.c:: | |
3359 |
|
3359 | |||
3360 |
hg log -L file.c,13 |
|
3360 | hg log -L file.c,13:23 | |
3361 |
|
3361 | |||
3362 | - changesets touching lines 13 to 23 for file.c and lines 2 to 6 of |
|
3362 | - changesets touching lines 13 to 23 for file.c and lines 2 to 6 of | |
3363 | main.c with patch:: |
|
3363 | main.c with patch:: | |
3364 |
|
3364 | |||
3365 |
hg log -L file.c,13 |
|
3365 | hg log -L file.c,13:23 -L main.c,2:6 -p | |
3366 |
|
3366 | |||
3367 | See :hg:`help dates` for a list of formats valid for -d/--date. |
|
3367 | See :hg:`help dates` for a list of formats valid for -d/--date. | |
3368 |
|
3368 |
@@ -101,7 +101,7 b' Add some changes with two diff hunks' | |||||
101 | -11+ |
|
101 | -11+ | |
102 | +11- |
|
102 | +11- | |
103 |
|
103 | |||
104 |
$ hg log -f -L foo,5 |
|
104 | $ hg log -f -L foo,5:7 -p | |
105 | changeset: 5:cfdf972b3971 |
|
105 | changeset: 5:cfdf972b3971 | |
106 | tag: tip |
|
106 | tag: tip | |
107 | user: test |
|
107 | user: test | |
@@ -175,12 +175,12 b' Add some changes with two diff hunks' | |||||
175 |
|
175 | |||
176 | With --template. |
|
176 | With --template. | |
177 |
|
177 | |||
178 |
$ hg log -f -L foo,5 |
|
178 | $ hg log -f -L foo,5:7 -T '{rev}:{node|short} {desc|firstline}\n' | |
179 | 5:cfdf972b3971 foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+ |
|
179 | 5:cfdf972b3971 foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+ | |
180 | 4:eaec41c1a0c9 11 -> 11+; leading space before "1" |
|
180 | 4:eaec41c1a0c9 11 -> 11+; leading space before "1" | |
181 | 2:63a884426fd0 2 -> 2+; added bar |
|
181 | 2:63a884426fd0 2 -> 2+; added bar | |
182 | 0:5ae1f82b9a00 init |
|
182 | 0:5ae1f82b9a00 init | |
183 |
$ hg log -f -L foo,5 |
|
183 | $ hg log -f -L foo,5:7 -T json | |
184 | [ |
|
184 | [ | |
185 | { |
|
185 | { | |
186 | "rev": 5, |
|
186 | "rev": 5, | |
@@ -234,7 +234,7 b' With --template.' | |||||
234 |
|
234 | |||
235 | With some white-space diff option, respective revisions are skipped. |
|
235 | With some white-space diff option, respective revisions are skipped. | |
236 |
|
236 | |||
237 |
$ hg log -f -L foo,5 |
|
237 | $ hg log -f -L foo,5:7 -p --config diff.ignorews=true | |
238 | changeset: 5:cfdf972b3971 |
|
238 | changeset: 5:cfdf972b3971 | |
239 | tag: tip |
|
239 | tag: tip | |
240 | user: test |
|
240 | user: test | |
@@ -290,7 +290,7 b' With some white-space diff option, respe' | |||||
290 |
|
290 | |||
291 | Regular file patterns are allowed with -L and their diff shows all lines. |
|
291 | Regular file patterns are allowed with -L and their diff shows all lines. | |
292 |
|
292 | |||
293 |
$ hg log -f -L foo,5 |
|
293 | $ hg log -f -L foo,5:7 -p bar | |
294 | changeset: 5:cfdf972b3971 |
|
294 | changeset: 5:cfdf972b3971 | |
295 | tag: tip |
|
295 | tag: tip | |
296 | user: test |
|
296 | user: test | |
@@ -349,7 +349,7 b' Regular file patterns are allowed with -' | |||||
349 |
|
349 | |||
350 | Option --rev acts as a restriction. |
|
350 | Option --rev acts as a restriction. | |
351 |
|
351 | |||
352 |
$ hg log -f -L foo,5 |
|
352 | $ hg log -f -L foo,5:7 -p -r 'desc(2)' | |
353 | changeset: 2:63a884426fd0 |
|
353 | changeset: 2:63a884426fd0 | |
354 | user: test |
|
354 | user: test | |
355 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
355 | date: Thu Jan 01 00:00:00 1970 +0000 | |
@@ -387,7 +387,7 b' Option --rev acts as a restriction.' | |||||
387 | With several -L patterns, changes touching any files in their respective line |
|
387 | With several -L patterns, changes touching any files in their respective line | |
388 | range are show. |
|
388 | range are show. | |
389 |
|
389 | |||
390 |
$ hg log -f -L foo,5 |
|
390 | $ hg log -f -L foo,5:7 -L bar,1:2 -p | |
391 | changeset: 5:cfdf972b3971 |
|
391 | changeset: 5:cfdf972b3971 | |
392 | tag: tip |
|
392 | tag: tip | |
393 | user: test |
|
393 | user: test | |
@@ -481,7 +481,7 b' range are show.' | |||||
481 | Multiple -L options with the same file yields changes touching any of |
|
481 | Multiple -L options with the same file yields changes touching any of | |
482 | specified line ranges. |
|
482 | specified line ranges. | |
483 |
|
483 | |||
484 |
$ hg log -f -L foo,5 |
|
484 | $ hg log -f -L foo,5:7 -L foo,14:15 -p | |
485 | changeset: 5:cfdf972b3971 |
|
485 | changeset: 5:cfdf972b3971 | |
486 | tag: tip |
|
486 | tag: tip | |
487 | user: test |
|
487 | user: test | |
@@ -617,7 +617,7 b' A file with a comma in its name.' | |||||
617 | > p |
|
617 | > p | |
618 | > EOF |
|
618 | > EOF | |
619 | $ hg ci -m 'azerty' |
|
619 | $ hg ci -m 'azerty' | |
620 |
$ hg log -f -L ba,z,1 |
|
620 | $ hg log -f -L ba,z,1:2 -p | |
621 | changeset: 8:52373265138b |
|
621 | changeset: 8:52373265138b | |
622 | tag: tip |
|
622 | tag: tip | |
623 | user: test |
|
623 | user: test | |
@@ -658,7 +658,7 b' Exact prefix kinds work in -L options.' | |||||
658 |
|
658 | |||
659 | $ mkdir dir |
|
659 | $ mkdir dir | |
660 | $ cd dir |
|
660 | $ cd dir | |
661 |
$ hg log -f -L path:foo,5 |
|
661 | $ hg log -f -L path:foo,5:7 -p | |
662 | changeset: 5:cfdf972b3971 |
|
662 | changeset: 5:cfdf972b3971 | |
663 | user: test |
|
663 | user: test | |
664 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
664 | date: Thu Jan 01 00:00:00 1970 +0000 | |
@@ -758,7 +758,7 b' Renames are followed.' | |||||
758 | -11- |
|
758 | -11- | |
759 | +1+0 |
|
759 | +1+0 | |
760 | +1+1- |
|
760 | +1+1- | |
761 |
$ hg log -f -L relpath:baz,5 |
|
761 | $ hg log -f -L relpath:baz,5:7 -p | |
762 | changeset: 9:6af29c3a778f |
|
762 | changeset: 9:6af29c3a778f | |
763 | tag: tip |
|
763 | tag: tip | |
764 | user: test |
|
764 | user: test | |
@@ -856,7 +856,7 b' Binary files work but without diff hunks' | |||||
856 | >>> open('binary', 'w').write('this\nis\na\nbinary\0') |
|
856 | >>> open('binary', 'w').write('this\nis\na\nbinary\0') | |
857 | $ hg add binary |
|
857 | $ hg add binary | |
858 | $ hg ci -m 'add a binary file' --quiet |
|
858 | $ hg ci -m 'add a binary file' --quiet | |
859 |
$ hg log -f -L binary,1 |
|
859 | $ hg log -f -L binary,1:2 -p | |
860 | changeset: 10:c96381c229df |
|
860 | changeset: 10:c96381c229df | |
861 | tag: tip |
|
861 | tag: tip | |
862 | user: test |
|
862 | user: test | |
@@ -871,7 +871,7 b' Binary files work but without diff hunks' | |||||
871 | Wc$_QA$SmdpqC~Ew%)G>+N(KNlNClYy |
|
871 | Wc$_QA$SmdpqC~Ew%)G>+N(KNlNClYy | |
872 |
|
872 | |||
873 |
|
873 | |||
874 |
$ hg log -f -L binary,1 |
|
874 | $ hg log -f -L binary,1:2 -p --config diff.git=false | |
875 | changeset: 10:c96381c229df |
|
875 | changeset: 10:c96381c229df | |
876 | tag: tip |
|
876 | tag: tip | |
877 | user: test |
|
877 | user: test | |
@@ -884,19 +884,19 b' Binary files work but without diff hunks' | |||||
884 |
|
884 | |||
885 | Option --follow is required. |
|
885 | Option --follow is required. | |
886 |
|
886 | |||
887 |
$ hg log -L foo,5 |
|
887 | $ hg log -L foo,5:7 | |
888 | abort: --line-range requires --follow |
|
888 | abort: --line-range requires --follow | |
889 | [255] |
|
889 | [255] | |
890 |
|
890 | |||
891 | Non-exact pattern kinds are not allowed. |
|
891 | Non-exact pattern kinds are not allowed. | |
892 |
|
892 | |||
893 | $ cd .. |
|
893 | $ cd .. | |
894 |
$ hg log -f -L glob:*a*,1 |
|
894 | $ hg log -f -L glob:*a*,1:2 | |
895 | hg: parse error: line range pattern 'glob:*a*' must match exactly one file |
|
895 | hg: parse error: line range pattern 'glob:*a*' must match exactly one file | |
896 | [255] |
|
896 | [255] | |
897 |
|
897 | |||
898 | Graph log does work yet. |
|
898 | Graph log does work yet. | |
899 |
|
899 | |||
900 |
$ hg log -f -L dir/baz,5 |
|
900 | $ hg log -f -L dir/baz,5:7 --graph | |
901 | abort: graph not supported with line range patterns |
|
901 | abort: graph not supported with line range patterns | |
902 | [255] |
|
902 | [255] |
General Comments 0
You need to be logged in to leave comments.
Login now