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