Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/cmdutil.py @ 14322:a90131b85fd8
scmutil: drop aliases in cmdutil for match functions
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 13 May 2011 14:58:24 -0500 |
parents | 003d63bb4fa5 |
children | a79fea6b3e77 |
comparison
equal
deleted
inserted
replaced
14321:003d63bb4fa5 | 14322:a90131b85fd8 |
---|---|
9 from i18n import _ | 9 from i18n import _ |
10 import os, sys, errno, re, tempfile | 10 import os, sys, errno, re, tempfile |
11 import util, scmutil, templater, patch, error, templatekw | 11 import util, scmutil, templater, patch, error, templatekw |
12 import match as matchmod | 12 import match as matchmod |
13 import subrepo | 13 import subrepo |
14 | |
15 match = scmutil.match | |
16 matchall = scmutil.matchall | |
17 matchfiles = scmutil.matchfiles | |
18 | 14 |
19 def parsealiases(cmd): | 15 def parsealiases(cmd): |
20 return cmd.lstrip("^").split("|") | 16 return cmd.lstrip("^").split("|") |
21 | 17 |
22 def findpossible(cmd, table, strict=False): | 18 def findpossible(cmd, table, strict=False): |
186 wctx = repo[None] | 182 wctx = repo[None] |
187 | 183 |
188 def walkpat(pat): | 184 def walkpat(pat): |
189 srcs = [] | 185 srcs = [] |
190 badstates = after and '?' or '?r' | 186 badstates = after and '?' or '?r' |
191 m = match(repo, [pat], opts, globbed=True) | 187 m = scmutil.match(repo, [pat], opts, globbed=True) |
192 for abs in repo.walk(m): | 188 for abs in repo.walk(m): |
193 state = repo.dirstate[abs] | 189 state = repo.dirstate[abs] |
194 rel = m.rel(abs) | 190 rel = m.rel(abs) |
195 exact = m.exact(abs) | 191 exact = m.exact(abs) |
196 if state in badstates: | 192 if state in badstates: |
801 regular display via changeset_printer() is done. | 797 regular display via changeset_printer() is done. |
802 """ | 798 """ |
803 # options | 799 # options |
804 patch = False | 800 patch = False |
805 if opts.get('patch') or opts.get('stat'): | 801 if opts.get('patch') or opts.get('stat'): |
806 patch = matchall(repo) | 802 patch = scmutil.matchall(repo) |
807 | 803 |
808 tmpl = opts.get('template') | 804 tmpl = opts.get('template') |
809 style = None | 805 style = None |
810 if tmpl: | 806 if tmpl: |
811 tmpl = templater.parsestring(tmpl, quoted=False) | 807 tmpl = templater.parsestring(tmpl, quoted=False) |
842 | 838 |
843 def finddate(ui, repo, date): | 839 def finddate(ui, repo, date): |
844 """Find the tipmost changeset that matches the given date spec""" | 840 """Find the tipmost changeset that matches the given date spec""" |
845 | 841 |
846 df = util.matchdate(date) | 842 df = util.matchdate(date) |
847 m = matchall(repo) | 843 m = scmutil.matchall(repo) |
848 results = {} | 844 results = {} |
849 | 845 |
850 def prep(ctx, fns): | 846 def prep(ctx, fns): |
851 d = ctx.date() | 847 d = ctx.date() |
852 if df(d[0]): | 848 if df(d[0]): |
1133 # extract addremove carefully -- this function can be called from a command | 1129 # extract addremove carefully -- this function can be called from a command |
1134 # that doesn't support addremove | 1130 # that doesn't support addremove |
1135 if opts.get('addremove'): | 1131 if opts.get('addremove'): |
1136 scmutil.addremove(repo, pats, opts) | 1132 scmutil.addremove(repo, pats, opts) |
1137 | 1133 |
1138 return commitfunc(ui, repo, message, match(repo, pats, opts), opts) | 1134 return commitfunc(ui, repo, message, scmutil.match(repo, pats, opts), opts) |
1139 | 1135 |
1140 def commiteditor(repo, ctx, subs): | 1136 def commiteditor(repo, ctx, subs): |
1141 if ctx.description(): | 1137 if ctx.description(): |
1142 return ctx.description() | 1138 return ctx.description() |
1143 return commitforceeditor(repo, ctx, subs) | 1139 return commitforceeditor(repo, ctx, subs) |