##// END OF EJS Templates
log: remove dead code to follow descendants if ascending revisions specified...
Yuya Nishihara -
r35728:ea332001 default
parent child Browse files
Show More
@@ -2359,8 +2359,6 b' def _makenofollowlogfilematcher(repo, pa'
2359 'only_merges': ('merge()', None),
2359 'only_merges': ('merge()', None),
2360 '_ancestors': ('ancestors(%r)', None),
2360 '_ancestors': ('ancestors(%r)', None),
2361 '_fancestors': ('_firstancestors(%r)', None),
2361 '_fancestors': ('_firstancestors(%r)', None),
2362 '_descendants': ('descendants(%r)', None),
2363 '_fdescendants': ('_firstdescendants(%r)', None),
2364 '_matchfiles': (None, '_matchfiles(%ps)'),
2362 '_matchfiles': (None, '_matchfiles(%ps)'),
2365 'date': ('date(%s)', None),
2363 'date': ('date(%s)', None),
2366 'branch': ('branch(%s)', '%lr'),
2364 'branch': ('branch(%s)', '%lr'),
@@ -2372,7 +2370,7 b' def _makenofollowlogfilematcher(repo, pa'
2372 'user': ('user(%s)', '%lr'),
2370 'user': ('user(%s)', '%lr'),
2373 }
2371 }
2374
2372
2375 def _makelogrevset(repo, pats, opts, revs):
2373 def _makelogrevset(repo, pats, opts):
2376 """Return (expr, filematcher) where expr is a revset string built
2374 """Return (expr, filematcher) where expr is a revset string built
2377 from log options and file patterns or None. If --stat or --patch
2375 from log options and file patterns or None. If --stat or --patch
2378 are not passed filematcher is None. Otherwise it is a callable
2376 are not passed filematcher is None. Otherwise it is a callable
@@ -2386,10 +2384,6 b' def _makelogrevset(repo, pats, opts, rev'
2386 followfirst = 1
2384 followfirst = 1
2387 else:
2385 else:
2388 followfirst = 0
2386 followfirst = 0
2389 # --follow with FILE behavior depends on revs...
2390 it = iter(revs)
2391 startrev = next(it)
2392 followdescendants = startrev < next(it, startrev)
2393
2387
2394 # branch and only_branch are really aliases and must be handled at
2388 # branch and only_branch are really aliases and must be handled at
2395 # the same time
2389 # the same time
@@ -2434,8 +2428,8 b' def _makelogrevset(repo, pats, opts, rev'
2434 slowpath = False
2428 slowpath = False
2435
2429
2436 fpats = ('_patsfollow', '_patsfollowfirst')
2430 fpats = ('_patsfollow', '_patsfollowfirst')
2437 fnopats = (('_ancestors', '_fancestors'),
2431 fnopats = ('_ancestors', '_fancestors')
2438 ('_descendants', '_fdescendants'))
2432
2439 if slowpath:
2433 if slowpath:
2440 # See walkchangerevs() slow path.
2434 # See walkchangerevs() slow path.
2441 #
2435 #
@@ -2454,7 +2448,7 b' def _makelogrevset(repo, pats, opts, rev'
2454 matchargs.append('x:' + p)
2448 matchargs.append('x:' + p)
2455 opts['_matchfiles'] = matchargs
2449 opts['_matchfiles'] = matchargs
2456 if follow:
2450 if follow:
2457 opts[fnopats[0][followfirst]] = '.'
2451 opts[fnopats[followfirst]] = '.'
2458 else:
2452 else:
2459 if follow:
2453 if follow:
2460 if pats:
2454 if pats:
@@ -2462,8 +2456,8 b' def _makelogrevset(repo, pats, opts, rev'
2462 # manifest entry, so use match.files(), not pats.
2456 # manifest entry, so use match.files(), not pats.
2463 opts[fpats[followfirst]] = list(match.files())
2457 opts[fpats[followfirst]] = list(match.files())
2464 else:
2458 else:
2465 op = fnopats[followdescendants][followfirst]
2459 op = fnopats[followfirst]
2466 opts[op] = 'rev(%d)' % startrev
2460 opts[op] = '.'
2467 else:
2461 else:
2468 opts['_patslog'] = list(pats)
2462 opts['_patslog'] = list(pats)
2469
2463
@@ -2505,8 +2499,6 b' def _makelogrevset(repo, pats, opts, rev'
2505 return expr, filematcher
2499 return expr, filematcher
2506
2500
2507 def _logrevs(repo, opts):
2501 def _logrevs(repo, opts):
2508 # Default --rev value depends on --follow but --follow behavior
2509 # depends on revisions resolved from --rev...
2510 follow = opts.get('follow') or opts.get('follow_first')
2502 follow = opts.get('follow') or opts.get('follow_first')
2511 if opts.get('rev'):
2503 if opts.get('rev'):
2512 revs = scmutil.revrange(repo, opts['rev'])
2504 revs = scmutil.revrange(repo, opts['rev'])
@@ -2530,7 +2522,7 b' def getlogrevs(repo, pats, opts):'
2530 revs = _logrevs(repo, opts)
2522 revs = _logrevs(repo, opts)
2531 if not revs:
2523 if not revs:
2532 return smartset.baseset(), None
2524 return smartset.baseset(), None
2533 expr, filematcher = _makelogrevset(repo, pats, opts, revs)
2525 expr, filematcher = _makelogrevset(repo, pats, opts)
2534 if opts.get('graph') and opts.get('rev'):
2526 if opts.get('graph') and opts.get('rev'):
2535 # User-specified revs might be unsorted, but don't sort before
2527 # User-specified revs might be unsorted, but don't sort before
2536 # _makelogrevset because it might depend on the order of revs
2528 # _makelogrevset because it might depend on the order of revs
@@ -3280,7 +3280,7 b' def log(ui, repo, *pats, **opts):'
3280 File history is shown without following rename or copy history of
3280 File history is shown without following rename or copy history of
3281 files. Use -f/--follow with a filename to follow history across
3281 files. Use -f/--follow with a filename to follow history across
3282 renames and copies. --follow without a filename will only show
3282 renames and copies. --follow without a filename will only show
3283 ancestors or descendants of the starting revision.
3283 ancestors of the starting revision.
3284
3284
3285 By default this command prints revision number and changeset id,
3285 By default this command prints revision number and changeset id,
3286 tags, non-trivial parents, user, date and time, and a summary for
3286 tags, non-trivial parents, user, date and time, and a summary for
@@ -95,7 +95,7 b' o (0) root'
95 > revs = cmdutil._logrevs(repo, opts)
95 > revs = cmdutil._logrevs(repo, opts)
96 > if not revs:
96 > if not revs:
97 > return None
97 > return None
98 > return cmdutil._makelogrevset(repo, pats, opts, revs)[0]
98 > return cmdutil._makelogrevset(repo, pats, opts)[0]
99 >
99 >
100 > def uisetup(ui):
100 > def uisetup(ui):
101 > def printrevset(orig, repo, pats, opts):
101 > def printrevset(orig, repo, pats, opts):
@@ -1867,9 +1867,7 b' Test --follow-first'
1867 []
1867 []
1868 (func
1868 (func
1869 (symbol '_firstancestors')
1869 (symbol '_firstancestors')
1870 (func
1870 (symbol '.'))
1871 (symbol 'rev')
1872 (symbol '6')))
1873 <filteredset
1871 <filteredset
1874 <spanset- 0:7>,
1872 <spanset- 0:7>,
1875 <generatorsetdesc+>>
1873 <generatorsetdesc+>>
General Comments 0
You need to be logged in to leave comments. Login now