comparison mercurial/commands.py @ 35646:a177c6aa055a

log: rewrite --follow-first -rREV like --follow for consistency (BC) This helps fixing the "--follow -rREV PATH" issue. .. bc:: ``log --follow-first -rREV``, which is deprecated, now follows the first parent of merge revisions from the specified ``REV`` just like ``log --follow -rREV``.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 10 Dec 2017 18:25:33 +0900
parents 4b68ca118d8d
children e29823c6d3e8
comparison
equal deleted inserted replaced
35645:b6b7855c79aa 35646:a177c6aa055a
3403 if linerange and pats: 3403 if linerange and pats:
3404 raise error.Abort( 3404 raise error.Abort(
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') and opts.get('rev'): 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'):
3409 opts['rev'] = [revsetlang.formatspec('reverse(::%lr)', opts.get('rev'))] 3413 opts['rev'] = [revsetlang.formatspec('reverse(::%lr)', opts.get('rev'))]
3410 del opts['follow'] 3414 del opts['follow']
3411 3415
3412 repo = scmutil.unhidehashlikerevs(repo, opts.get('rev'), 'nowarn') 3416 repo = scmutil.unhidehashlikerevs(repo, opts.get('rev'), 'nowarn')
3413 revs, filematcher = cmdutil.getlogrevs(repo, pats, opts) 3417 revs, filematcher = cmdutil.getlogrevs(repo, pats, opts)