diff mercurial/commands.py @ 9652:2cb0cab10d2e

walkchangerevs: pull out matchfn * * * imported patch mercurial/commands.py
author Matt Mackall <mpm@selenic.com>
date Sun, 25 Oct 2009 18:43:56 -0500
parents 022b15b9ec8c
children e4de75343743
line wrap: on
line diff
--- a/mercurial/commands.py	Mon Sep 21 19:21:32 2009 +0200
+++ b/mercurial/commands.py	Sun Oct 25 18:43:56 2009 -0500
@@ -1289,10 +1289,10 @@
     skip = {}
     revfiles = {}
     get = util.cachefunc(lambda r: repo[r])
-    changeiter, matchfn = cmdutil.walkchangerevs(ui, repo, pats, get, opts)
+    matchfn = cmdutil.match(repo, pats, opts)
     found = False
     follow = opts.get('follow')
-    for st, rev, fns in changeiter:
+    for st, rev, fns in cmdutil.walkchangerevs(ui, repo, matchfn, get, opts):
         if st == 'window':
             matches.clear()
             revfiles.clear()
@@ -1980,8 +1980,7 @@
     """
 
     get = util.cachefunc(lambda r: repo[r])
-    changeiter, matchfn = cmdutil.walkchangerevs(ui, repo, pats, get, opts)
-
+    matchfn = cmdutil.match(repo, pats, opts)
     limit = cmdutil.loglimit(opts)
     count = 0
 
@@ -2028,7 +2027,7 @@
     only_branches = opts.get('only_branch')
 
     displayer = cmdutil.show_changeset(ui, repo, opts, True, matchfn)
-    for st, rev, fns in changeiter:
+    for st, rev, fns in cmdutil.walkchangerevs(ui, repo, matchfn, get, opts):
         if st == 'add':
             parents = [p for p in repo.changelog.parentrevs(rev)
                        if p != nullrev]