Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/cmdutil.py @ 9666:71e081b88f3e
cmdutil: update finddate()
walkchangerevs() now returns contexts, does not take a cache func.
author | Steve Borho <steve@borho.org> |
---|---|
date | Wed, 28 Oct 2009 22:47:46 -0500 |
parents | 2ae3758526d8 |
children | 8743f2e1bc54 |
comparison
equal
deleted
inserted
replaced
9661:c4f6c02e33c4 | 9666:71e081b88f3e |
---|---|
1021 return t | 1021 return t |
1022 | 1022 |
1023 def finddate(ui, repo, date): | 1023 def finddate(ui, repo, date): |
1024 """Find the tipmost changeset that matches the given date spec""" | 1024 """Find the tipmost changeset that matches the given date spec""" |
1025 df = util.matchdate(date) | 1025 df = util.matchdate(date) |
1026 get = util.cachefunc(lambda r: repo[r]) | |
1027 m = matchall(repo) | 1026 m = matchall(repo) |
1028 results = {} | 1027 results = {} |
1029 for st, rev, fns in walkchangerevs(ui, repo, m, get, {'rev':None}): | 1028 for st, ctx, fns in walkchangerevs(ui, repo, m, {'rev': None}): |
1029 rev = ctx.rev() | |
1030 if st == 'add': | 1030 if st == 'add': |
1031 d = get(rev).date() | 1031 d = ctx.date() |
1032 if df(d[0]): | 1032 if df(d[0]): |
1033 results[rev] = d | 1033 results[rev] = d |
1034 elif st == 'iter': | 1034 elif st == 'iter': |
1035 if rev in results: | 1035 if rev in results: |
1036 ui.status(_("Found revision %s from %s\n") % | 1036 ui.status(_("Found revision %s from %s\n") % |