1029 def prep(ctx, fns): |
1029 def prep(ctx, fns): |
1030 d = ctx.date() |
1030 d = ctx.date() |
1031 if df(d[0]): |
1031 if df(d[0]): |
1032 results[rev] = d |
1032 results[rev] = d |
1033 |
1033 |
1034 for ctx in walkchangerevs(ui, repo, m, {'rev':None}, prep): |
1034 for ctx in walkchangerevs(repo, m, {'rev':None}, prep): |
1035 rev = ctx.rev() |
1035 rev = ctx.rev() |
1036 if rev in results: |
1036 if rev in results: |
1037 ui.status(_("Found revision %s from %s\n") % |
1037 ui.status(_("Found revision %s from %s\n") % |
1038 (rev, util.datestr(results[rev]))) |
1038 (rev, util.datestr(results[rev]))) |
1039 return str(rev) |
1039 return str(rev) |
1040 |
1040 |
1041 raise util.Abort(_("revision matching date not found")) |
1041 raise util.Abort(_("revision matching date not found")) |
1042 |
1042 |
1043 def walkchangerevs(ui, repo, match, opts, prepare): |
1043 def walkchangerevs(repo, match, opts, prepare): |
1044 '''Iterate over files and the revs in which they changed. |
1044 '''Iterate over files and the revs in which they changed. |
1045 |
1045 |
1046 Callers most commonly need to iterate backwards over the history |
1046 Callers most commonly need to iterate backwards over the history |
1047 in which they are interested. Doing so has awful (quadratic-looking) |
1047 in which they are interested. Doing so has awful (quadratic-looking) |
1048 performance, so we use iterators in a "windowed" way. |
1048 performance, so we use iterators in a "windowed" way. |
1086 |
1086 |
1087 if not slowpath and not match.files(): |
1087 if not slowpath and not match.files(): |
1088 # No files, no patterns. Display all revs. |
1088 # No files, no patterns. Display all revs. |
1089 wanted = set(revs) |
1089 wanted = set(revs) |
1090 copies = [] |
1090 copies = [] |
|
1091 |
1091 if not slowpath: |
1092 if not slowpath: |
1092 # Only files, no patterns. Check the history of each file. |
1093 # Only files, no patterns. Check the history of each file. |
1093 def filerevgen(filelog, node): |
1094 def filerevgen(filelog, node): |
1094 cl_count = len(repo) |
1095 cl_count = len(repo) |
1095 if node is None: |
1096 if node is None: |