Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/cmdutil.py @ 23533:891aaa7c0c70
scmutil: pass a matcher to scmutil.addremove() instead of a list of patterns
This will make it easier to support subrepository operations.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sun, 09 Nov 2014 19:57:02 -0500 |
parents | 32e68271a037 |
children | 72c23fa4f52f |
comparison
equal
deleted
inserted
replaced
23532:fad896292e7d | 23533:891aaa7c0c70 |
---|---|
2195 '''commit the specified files or all outstanding changes''' | 2195 '''commit the specified files or all outstanding changes''' |
2196 date = opts.get('date') | 2196 date = opts.get('date') |
2197 if date: | 2197 if date: |
2198 opts['date'] = util.parsedate(date) | 2198 opts['date'] = util.parsedate(date) |
2199 message = logmessage(ui, opts) | 2199 message = logmessage(ui, opts) |
2200 matcher = scmutil.match(repo[None], pats, opts) | |
2200 | 2201 |
2201 # extract addremove carefully -- this function can be called from a command | 2202 # extract addremove carefully -- this function can be called from a command |
2202 # that doesn't support addremove | 2203 # that doesn't support addremove |
2203 if opts.get('addremove'): | 2204 if opts.get('addremove'): |
2204 scmutil.addremove(repo, pats, opts) | 2205 scmutil.addremove(repo, matcher, opts) |
2205 | 2206 |
2206 return commitfunc(ui, repo, message, | 2207 return commitfunc(ui, repo, message, matcher, opts) |
2207 scmutil.match(repo[None], pats, opts), opts) | |
2208 | 2208 |
2209 def amend(ui, repo, commitfunc, old, extra, pats, opts): | 2209 def amend(ui, repo, commitfunc, old, extra, pats, opts): |
2210 # amend will reuse the existing user if not specified, but the obsolete | 2210 # amend will reuse the existing user if not specified, but the obsolete |
2211 # marker creation requires that the current user's name is specified. | 2211 # marker creation requires that the current user's name is specified. |
2212 if obsolete._enabled: | 2212 if obsolete._enabled: |