Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.9, 0.9.1, and 0.9.1.1

stable revgraph: catching up with today's tip version of walkchangerevs

Refs #663

Changeset 474c258c3d90

Parent 43ae04af99d4

by Steve Borho

Changes to one file · Browse files at 474c258c3d90 Showing diff from parent 43ae04af99d4 Diff from another changeset...

 
502
503
504
505
 
506
507
508
509
510
511
512
513
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
 
 
 
 
502
503
504
 
505
506
 
 
507
508
509
510
 
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
533
534
535
@@ -502,57 +502,34 @@
  pats - list of file names or patterns   opts - command line options for log command   ''' - + matching_revs = []   only_branch = opts.get('branch', None) - - # Log searches: pattern, keyword, date, etc   df = False   if opts['date']:   df = util.matchdate(opts['date'])   - stack = [] + def prep(ctx, fns): + if only_branch and ctx.branch() != only_branch: + return + if opts['no_merges'] and len(ctx.parents()) == 2: + return + if opts['only_merges'] and len(ctx.parents()) != 2: + return + if df and not df(ctx.date()[0]): + return + if opts['user'] and not [k for k in opts['user'] if k in ctx.user()]: + return + if opts['keyword']: + for k in [kw.lower() for kw in opts['keyword']]: + if (k in ctx.user().lower() or + k in ctx.description().lower() or + k in " ".join(ctx.files()).lower()): + break + else: + return + matching_revs.append(ctx.rev()) +   m = match.match(repo.root, repo.root, pats) - for st, ctx, fns in cmdutil.walkchangerevs(repo.ui, repo, m, opts): - rev = ctx.rev() - if st == 'iter': - if stack: - yield stack.pop() - continue - if st != 'add': - continue - - if only_branch: - if ctx.branch() != only_branch: - continue - - parents = __get_parents(repo, rev) - if opts['no_merges'] and len(parents) == 2: - continue - if opts['only_merges'] and len(parents) != 2: - continue - - if df and not df(ctx.date()[0]): - continue - - # TODO: add copies/renames later - if opts['keyword']: - miss = 0 - for k in [kw.lower() for kw in opts['keyword']]: - if not (k in ctx.user().lower() or - k in ctx.description().lower() or - k in " ".join(ctx.files()).lower()): - miss = 1 - break - if miss: - continue - - if opts['user']: - miss = 0 - for u in [u.lower() for u in opts['user']]: - if u not in ctx.user().lower(): - miss = 1 - break - if miss: - continue - - stack.append((rev, (0,0), [], None)) + for ctx in cmdutil.walkchangerevs(repo, m, opts, prep): + if ctx.rev() in matching_revs: + yield (ctx.rev(), (0,0), [], None)