2336 |
2336 |
2337 def _makenofollowlogfilematcher(repo, pats, opts): |
2337 def _makenofollowlogfilematcher(repo, pats, opts): |
2338 '''hook for extensions to override the filematcher for non-follow cases''' |
2338 '''hook for extensions to override the filematcher for non-follow cases''' |
2339 return None |
2339 return None |
2340 |
2340 |
|
2341 _opt2logrevset = { |
|
2342 'no_merges': ('not merge()', None), |
|
2343 'only_merges': ('merge()', None), |
|
2344 '_ancestors': ('ancestors(%(val)s)', None), |
|
2345 '_fancestors': ('_firstancestors(%(val)s)', None), |
|
2346 '_descendants': ('descendants(%(val)s)', None), |
|
2347 '_fdescendants': ('_firstdescendants(%(val)s)', None), |
|
2348 '_matchfiles': ('_matchfiles(%(val)s)', None), |
|
2349 'date': ('date(%(val)r)', None), |
|
2350 'branch': ('branch(%(val)r)', ' or '), |
|
2351 '_patslog': ('filelog(%(val)r)', ' or '), |
|
2352 '_patsfollow': ('follow(%(val)r)', ' or '), |
|
2353 '_patsfollowfirst': ('_followfirst(%(val)r)', ' or '), |
|
2354 'keyword': ('keyword(%(val)r)', ' or '), |
|
2355 'prune': ('not (%(val)r or ancestors(%(val)r))', ' and '), |
|
2356 'user': ('user(%(val)r)', ' or '), |
|
2357 } |
|
2358 |
2341 def _makelogrevset(repo, pats, opts, revs): |
2359 def _makelogrevset(repo, pats, opts, revs): |
2342 """Return (expr, filematcher) where expr is a revset string built |
2360 """Return (expr, filematcher) where expr is a revset string built |
2343 from log options and file patterns or None. If --stat or --patch |
2361 from log options and file patterns or None. If --stat or --patch |
2344 are not passed filematcher is None. Otherwise it is a callable |
2362 are not passed filematcher is None. Otherwise it is a callable |
2345 taking a revision number and returning a match objects filtering |
2363 taking a revision number and returning a match objects filtering |
2346 the files to be detailed when displaying the revision. |
2364 the files to be detailed when displaying the revision. |
2347 """ |
2365 """ |
2348 opt2revset = { |
|
2349 'no_merges': ('not merge()', None), |
|
2350 'only_merges': ('merge()', None), |
|
2351 '_ancestors': ('ancestors(%(val)s)', None), |
|
2352 '_fancestors': ('_firstancestors(%(val)s)', None), |
|
2353 '_descendants': ('descendants(%(val)s)', None), |
|
2354 '_fdescendants': ('_firstdescendants(%(val)s)', None), |
|
2355 '_matchfiles': ('_matchfiles(%(val)s)', None), |
|
2356 'date': ('date(%(val)r)', None), |
|
2357 'branch': ('branch(%(val)r)', ' or '), |
|
2358 '_patslog': ('filelog(%(val)r)', ' or '), |
|
2359 '_patsfollow': ('follow(%(val)r)', ' or '), |
|
2360 '_patsfollowfirst': ('_followfirst(%(val)r)', ' or '), |
|
2361 'keyword': ('keyword(%(val)r)', ' or '), |
|
2362 'prune': ('not (%(val)r or ancestors(%(val)r))', ' and '), |
|
2363 'user': ('user(%(val)r)', ' or '), |
|
2364 } |
|
2365 |
|
2366 opts = dict(opts) |
2366 opts = dict(opts) |
2367 # follow or not follow? |
2367 # follow or not follow? |
2368 follow = opts.get('follow') or opts.get('follow_first') |
2368 follow = opts.get('follow') or opts.get('follow_first') |
2369 if opts.get('follow_first'): |
2369 if opts.get('follow_first'): |
2370 followfirst = 1 |
2370 followfirst = 1 |