Show More
@@ -1066,23 +1066,23 b' def _followfirst(repo, subset, x):' | |||||
1066 | # of every revisions or files revisions. |
|
1066 | # of every revisions or files revisions. | |
1067 | return _follow(repo, subset, x, '_followfirst', followfirst=True) |
|
1067 | return _follow(repo, subset, x, '_followfirst', followfirst=True) | |
1068 |
|
1068 | |||
1069 | @predicate('followlines(file, fromline, toline[, rev=.])', safe=True) |
|
1069 | @predicate('followlines(file, fromline, toline[, startrev=.])', safe=True) | |
1070 | def followlines(repo, subset, x): |
|
1070 | def followlines(repo, subset, x): | |
1071 | """Changesets modifying `file` in line range ('fromline', 'toline'). |
|
1071 | """Changesets modifying `file` in line range ('fromline', 'toline'). | |
1072 |
|
1072 | |||
1073 | Line range corresponds to 'file' content at 'rev' and should hence be |
|
1073 | Line range corresponds to 'file' content at 'startrev' and should hence be | |
1074 | consistent with file size. If rev is not specified, working directory's |
|
1074 | consistent with file size. If startrev is not specified, working directory's | |
1075 | parent is used. |
|
1075 | parent is used. | |
1076 | """ |
|
1076 | """ | |
1077 | from . import context # avoid circular import issues |
|
1077 | from . import context # avoid circular import issues | |
1078 |
|
1078 | |||
1079 | args = getargsdict(x, 'followlines', 'file *lines rev') |
|
1079 | args = getargsdict(x, 'followlines', 'file *lines startrev') | |
1080 | if len(args['lines']) != 2: |
|
1080 | if len(args['lines']) != 2: | |
1081 | raise error.ParseError(_("followlines takes at least three arguments")) |
|
1081 | raise error.ParseError(_("followlines takes at least three arguments")) | |
1082 |
|
1082 | |||
1083 | rev = '.' |
|
1083 | rev = '.' | |
1084 | if 'rev' in args: |
|
1084 | if 'startrev' in args: | |
1085 | revs = getset(repo, fullreposet(repo), args['rev']) |
|
1085 | revs = getset(repo, fullreposet(repo), args['startrev']) | |
1086 | if len(revs) != 1: |
|
1086 | if len(revs) != 1: | |
1087 | raise error.ParseError( |
|
1087 | raise error.ParseError( | |
1088 | _("followlines expects exactly one revision")) |
|
1088 | _("followlines expects exactly one revision")) |
@@ -490,11 +490,11 b' Test followlines() revset' | |||||
490 | 16: baz:0 |
|
490 | 16: baz:0 | |
491 | 19: baz:3 |
|
491 | 19: baz:3 | |
492 | 20: baz:4 |
|
492 | 20: baz:4 | |
493 | $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3, 5, rev=20)' |
|
493 | $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3, 5, startrev=20)' | |
494 | 16: baz:0 |
|
494 | 16: baz:0 | |
495 | 19: baz:3 |
|
495 | 19: baz:3 | |
496 | 20: baz:4 |
|
496 | 20: baz:4 | |
497 | $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3, 5, rev=.^)' |
|
497 | $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3, 5, startrev=.^)' | |
498 | 16: baz:0 |
|
498 | 16: baz:0 | |
499 | 19: baz:3 |
|
499 | 19: baz:3 | |
500 | $ printf "0\n0\n" | cat - baz > baz1 |
|
500 | $ printf "0\n0\n" | cat - baz > baz1 | |
@@ -591,7 +591,7 b' check error cases' | |||||
591 | $ hg log -r 'followlines(baz, 1)' |
|
591 | $ hg log -r 'followlines(baz, 1)' | |
592 | hg: parse error: followlines takes at least three arguments |
|
592 | hg: parse error: followlines takes at least three arguments | |
593 | [255] |
|
593 | [255] | |
594 | $ hg log -r 'followlines(baz, 1, 2, rev=desc("b"))' |
|
594 | $ hg log -r 'followlines(baz, 1, 2, startrev=desc("b"))' | |
595 | hg: parse error: followlines expects exactly one revision |
|
595 | hg: parse error: followlines expects exactly one revision | |
596 | [255] |
|
596 | [255] | |
597 | $ hg log -r 'followlines("glob:*", 1, 2)' |
|
597 | $ hg log -r 'followlines("glob:*", 1, 2)' |
General Comments 0
You need to be logged in to leave comments.
Login now