comparison mercurial/commands.py @ 32196:a77e61b45384

py3: handle opts correctly for `hg add` opts in add command were passed again to cmdutil.add() as kwargs so we need to convert them again to str. Intstead we convert them to bytes when passing scmutil.match(). Opts handling is also corrected for all the functions which are called from cmdutil.add().
author Pulkit Goyal <7895pulkit@gmail.com>
date Tue, 25 Apr 2017 01:52:30 +0530
parents e807c373846a
children 282b288aa20c
comparison
equal deleted inserted replaced
32195:e807c373846a 32196:a77e61b45384
253 ? foo.c 253 ? foo.c
254 254
255 Returns 0 if all files are successfully added. 255 Returns 0 if all files are successfully added.
256 """ 256 """
257 257
258 opts = pycompat.byteskwargs(opts) 258 m = scmutil.match(repo[None], pats, pycompat.byteskwargs(opts))
259 m = scmutil.match(repo[None], pats, opts)
260 rejected = cmdutil.add(ui, repo, m, "", False, **opts) 259 rejected = cmdutil.add(ui, repo, m, "", False, **opts)
261 return rejected and 1 or 0 260 return rejected and 1 or 0
262 261
263 @command('addremove', 262 @command('addremove',
264 similarityopts + subrepoopts + walkopts + dryrunopts, 263 similarityopts + subrepoopts + walkopts + dryrunopts,