##// END OF EJS Templates
scmutil: drop some aliases in cmdutil
Matt Mackall -
r14321:003d63bb default
parent child Browse files
Show More
@@ -12,12 +12,9 b' import util, scmutil, templater, patch, '
12 import match as matchmod
12 import match as matchmod
13 import subrepo
13 import subrepo
14
14
15 expandpats = scmutil.expandpats
16 match = scmutil.match
15 match = scmutil.match
17 matchall = scmutil.matchall
16 matchall = scmutil.matchall
18 matchfiles = scmutil.matchfiles
17 matchfiles = scmutil.matchfiles
19 addremove = scmutil.addremove
20 dirstatecopy = scmutil.dirstatecopy
21
18
22 def parsealiases(cmd):
19 def parsealiases(cmd):
23 return cmd.lstrip("^").split("|")
20 return cmd.lstrip("^").split("|")
@@ -270,7 +267,8 b' def copy(ui, repo, pats, opts, rename=Fa'
270 targets[abstarget] = abssrc
267 targets[abstarget] = abssrc
271
268
272 # fix up dirstate
269 # fix up dirstate
273 dirstatecopy(ui, repo, wctx, abssrc, abstarget, dryrun=dryrun, cwd=cwd)
270 scmutil.dirstatecopy(ui, repo, wctx, abssrc, abstarget,
271 dryrun=dryrun, cwd=cwd)
274 if rename and not dryrun:
272 if rename and not dryrun:
275 wctx.remove([abssrc], not after)
273 wctx.remove([abssrc], not after)
276
274
@@ -341,7 +339,7 b' def copy(ui, repo, pats, opts, rename=Fa'
341 return res
339 return res
342
340
343
341
344 pats = expandpats(pats)
342 pats = scmutil.expandpats(pats)
345 if not pats:
343 if not pats:
346 raise util.Abort(_('no source or destination specified'))
344 raise util.Abort(_('no source or destination specified'))
347 if len(pats) == 1:
345 if len(pats) == 1:
@@ -1135,7 +1133,7 b' def commit(ui, repo, commitfunc, pats, o'
1135 # extract addremove carefully -- this function can be called from a command
1133 # extract addremove carefully -- this function can be called from a command
1136 # that doesn't support addremove
1134 # that doesn't support addremove
1137 if opts.get('addremove'):
1135 if opts.get('addremove'):
1138 addremove(repo, pats, opts)
1136 scmutil.addremove(repo, pats, opts)
1139
1137
1140 return commitfunc(ui, repo, message, match(repo, pats, opts), opts)
1138 return commitfunc(ui, repo, message, match(repo, pats, opts), opts)
1141
1139
@@ -195,7 +195,7 b' def addremove(ui, repo, *pats, **opts):'
195 raise util.Abort(_('similarity must be a number'))
195 raise util.Abort(_('similarity must be a number'))
196 if sim < 0 or sim > 100:
196 if sim < 0 or sim > 100:
197 raise util.Abort(_('similarity must be between 0 and 100'))
197 raise util.Abort(_('similarity must be between 0 and 100'))
198 return cmdutil.addremove(repo, pats, opts, similarity=sim / 100.0)
198 return scmutil.addremove(repo, pats, opts, similarity=sim / 100.0)
199
199
200 @command('^annotate|blame',
200 @command('^annotate|blame',
201 [('r', 'rev', '', _('annotate the specified revision'), _('REV')),
201 [('r', 'rev', '', _('annotate the specified revision'), _('REV')),
@@ -11,7 +11,7 b' import tempfile, zlib'
11
11
12 from i18n import _
12 from i18n import _
13 from node import hex, nullid, short
13 from node import hex, nullid, short
14 import base85, mdiff, scmutil, util, diffhelpers, copies, encoding, wdutil
14 import base85, mdiff, scmutil, util, diffhelpers, copies, encoding
15
15
16 gitre = re.compile('diff --git a/(.*) b/(.*)')
16 gitre = re.compile('diff --git a/(.*) b/(.*)')
17
17
@@ -1181,7 +1181,7 b' def _updatedir(ui, repo, patches, simila'
1181
1181
1182 wctx = repo[None]
1182 wctx = repo[None]
1183 for src, dst in copies:
1183 for src, dst in copies:
1184 wdutil.dirstatecopy(ui, repo, wctx, src, dst, cwd=cwd)
1184 scmutil.dirstatecopy(ui, repo, wctx, src, dst, cwd=cwd)
1185 if (not similarity) and removes:
1185 if (not similarity) and removes:
1186 wctx.remove(sorted(removes), True)
1186 wctx.remove(sorted(removes), True)
1187
1187
@@ -1195,7 +1195,7 b' def _updatedir(ui, repo, patches, simila'
1195 flags = (isexec and 'x' or '') + (islink and 'l' or '')
1195 flags = (isexec and 'x' or '') + (islink and 'l' or '')
1196 repo.wwrite(gp.path, '', flags)
1196 repo.wwrite(gp.path, '', flags)
1197 util.setflags(dst, islink, isexec)
1197 util.setflags(dst, islink, isexec)
1198 wdutil.addremove(repo, cfiles, similarity=similarity)
1198 scmutil.addremove(repo, cfiles, similarity=similarity)
1199 files = patches.keys()
1199 files = patches.keys()
1200 files.extend([r for r in removes if r not in files])
1200 files.extend([r for r in removes if r not in files])
1201 return sorted(files)
1201 return sorted(files)
General Comments 0
You need to be logged in to leave comments. Login now