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 |
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("|") |
24 |
21 |
25 def findpossible(cmd, table, strict=False): |
22 def findpossible(cmd, table, strict=False): |
268 ui.status(_('copying %s to %s\n') % (relsrc, reltarget)) |
265 ui.status(_('copying %s to %s\n') % (relsrc, reltarget)) |
269 |
266 |
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 |
277 # pat: ossep |
275 # pat: ossep |
278 # dest ossep |
276 # dest ossep |
1133 message = logmessage(opts) |
1131 message = logmessage(opts) |
1134 |
1132 |
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 |
1142 def commiteditor(repo, ctx, subs): |
1140 def commiteditor(repo, ctx, subs): |
1143 if ctx.description(): |
1141 if ctx.description(): |