Show More
@@ -2518,10 +2518,19 b' def getlogrevs(repo, pats, opts):' | |||||
2518 | is a callable taking a revision number and returning a match objects |
|
2518 | is a callable taking a revision number and returning a match objects | |
2519 | filtering the files to be detailed when displaying the revision. |
|
2519 | filtering the files to be detailed when displaying the revision. | |
2520 | """ |
|
2520 | """ | |
|
2521 | follow = opts.get('follow') or opts.get('follow_first') | |||
|
2522 | followfirst = opts.get('follow_first') | |||
|
2523 | if opts.get('rev'): | |||
|
2524 | # TODO: do not mutate opts here | |||
|
2525 | opts.pop('follow', None) | |||
|
2526 | opts.pop('follow_first', None) | |||
2521 | limit = loglimit(opts) |
|
2527 | limit = loglimit(opts) | |
2522 | revs = _logrevs(repo, opts) |
|
2528 | revs = _logrevs(repo, opts) | |
2523 | if not revs: |
|
2529 | if not revs: | |
2524 | return smartset.baseset(), None |
|
2530 | return smartset.baseset(), None | |
|
2531 | if opts.get('rev') and follow: | |||
|
2532 | revs = dagop.revancestors(repo, revs, followfirst=followfirst) | |||
|
2533 | revs.reverse() | |||
2525 | expr, filematcher = _makelogrevset(repo, pats, opts) |
|
2534 | expr, filematcher = _makelogrevset(repo, pats, opts) | |
2526 | if opts.get('graph') and opts.get('rev'): |
|
2535 | if opts.get('graph') and opts.get('rev'): | |
2527 | # User-specified revs might be unsorted, but don't sort before |
|
2536 | # User-specified revs might be unsorted, but don't sort before |
@@ -3405,14 +3405,6 b' def log(ui, repo, *pats, **opts):' | |||||
3405 | _('FILE arguments are not compatible with --line-range option') |
|
3405 | _('FILE arguments are not compatible with --line-range option') | |
3406 | ) |
|
3406 | ) | |
3407 |
|
3407 | |||
3408 | if opts.get('follow_first') and opts.get('rev'): |
|
|||
3409 | opts['rev'] = [revsetlang.formatspec('reverse(_firstancestors(%lr))', |
|
|||
3410 | opts.get('rev'))] |
|
|||
3411 | del opts['follow_first'] |
|
|||
3412 | elif opts.get('follow') and opts.get('rev'): |
|
|||
3413 | opts['rev'] = [revsetlang.formatspec('reverse(::%lr)', opts.get('rev'))] |
|
|||
3414 | del opts['follow'] |
|
|||
3415 |
|
||||
3416 | repo = scmutil.unhidehashlikerevs(repo, opts.get('rev'), 'nowarn') |
|
3408 | repo = scmutil.unhidehashlikerevs(repo, opts.get('rev'), 'nowarn') | |
3417 | revs, filematcher = cmdutil.getlogrevs(repo, pats, opts) |
|
3409 | revs, filematcher = cmdutil.getlogrevs(repo, pats, opts) | |
3418 | hunksfilter = None |
|
3410 | hunksfilter = None |
@@ -2295,28 +2295,28 b' changessincelatesttag with no prior tag' | |||||
2295 | -f |
|
2295 | -f | |
2296 | +g |
|
2296 | +g | |
2297 | $ testlog --follow -r6 -r8 -r5 -r7 -r4 |
|
2297 | $ testlog --follow -r6 -r8 -r5 -r7 -r4 | |
2298 | ['reverse(::(((6) or (8)) or ((5) or ((7) or (4)))))'] |
|
2298 | ['6', '8', '5', '7', '4'] | |
2299 | [] |
|
2299 | [] | |
2300 | <generatorsetdesc-> |
|
2300 | <generatorsetdesc-> | |
2301 |
|
2301 | |||
2302 | Test --follow-first and forward --rev |
|
2302 | Test --follow-first and forward --rev | |
2303 |
|
2303 | |||
2304 | $ testlog --follow-first -r6 -r8 -r5 -r7 -r4 |
|
2304 | $ testlog --follow-first -r6 -r8 -r5 -r7 -r4 | |
2305 | ['reverse(_firstancestors((((6) or (8)) or ((5) or ((7) or (4))))))'] |
|
2305 | ['6', '8', '5', '7', '4'] | |
2306 | [] |
|
2306 | [] | |
2307 | <generatorsetdesc-> |
|
2307 | <generatorsetdesc-> | |
2308 |
|
2308 | |||
2309 | Test --follow and backward --rev |
|
2309 | Test --follow and backward --rev | |
2310 |
|
2310 | |||
2311 | $ testlog --follow -r6 -r5 -r7 -r8 -r4 |
|
2311 | $ testlog --follow -r6 -r5 -r7 -r8 -r4 | |
2312 | ['reverse(::(((6) or (5)) or ((7) or ((8) or (4)))))'] |
|
2312 | ['6', '5', '7', '8', '4'] | |
2313 | [] |
|
2313 | [] | |
2314 | <generatorsetdesc-> |
|
2314 | <generatorsetdesc-> | |
2315 |
|
2315 | |||
2316 | Test --follow-first and backward --rev |
|
2316 | Test --follow-first and backward --rev | |
2317 |
|
2317 | |||
2318 | $ testlog --follow-first -r6 -r5 -r7 -r8 -r4 |
|
2318 | $ testlog --follow-first -r6 -r5 -r7 -r8 -r4 | |
2319 | ['reverse(_firstancestors((((6) or (5)) or ((7) or ((8) or (4))))))'] |
|
2319 | ['6', '5', '7', '8', '4'] | |
2320 | [] |
|
2320 | [] | |
2321 | <generatorsetdesc-> |
|
2321 | <generatorsetdesc-> | |
2322 |
|
2322 |
@@ -715,6 +715,15 b" log -f -r '1 + 4'" | |||||
715 | date: Thu Jan 01 00:00:01 1970 +0000 |
|
715 | date: Thu Jan 01 00:00:01 1970 +0000 | |
716 | summary: base |
|
716 | summary: base | |
717 |
|
717 | |||
|
718 | ||||
|
719 | log -fr with aliases: 'A' should be expanded, but 'reverse()' should have no | |||
|
720 | effect | |||
|
721 | ||||
|
722 | $ hg log --config 'revsetalias.reverse(x)=x' --config 'revsetalias.A=1+4' -qfrA | |||
|
723 | 4:ddb82e70d1a1 | |||
|
724 | 1:3d5bf5654eda | |||
|
725 | 0:67e992f2c4f3 | |||
|
726 | ||||
718 | log -r "follow('set:grep(b2)')" |
|
727 | log -r "follow('set:grep(b2)')" | |
719 |
|
728 | |||
720 | $ hg log -r "follow('set:grep(b2)')" |
|
729 | $ hg log -r "follow('set:grep(b2)')" |
General Comments 0
You need to be logged in to leave comments.
Login now