5971 working directory, not even if ``--force`` is specified. |
5971 working directory, not even if ``--force`` is specified. |
5972 |
5972 |
5973 Returns 0 on success, 1 if any warnings encountered. |
5973 Returns 0 on success, 1 if any warnings encountered. |
5974 """ |
5974 """ |
5975 |
5975 |
5976 opts = pycompat.byteskwargs(opts) |
5976 after, force = opts.get('after'), opts.get('force') |
5977 after, force = opts.get(b'after'), opts.get(b'force') |
5977 dryrun = opts.get('dry_run') |
5978 dryrun = opts.get(b'dry_run') |
|
5979 if not pats and not after: |
5978 if not pats and not after: |
5980 raise error.InputError(_(b'no files specified')) |
5979 raise error.InputError(_(b'no files specified')) |
5981 |
5980 |
5982 with repo.wlock(), repo.dirstate.changing_files(repo): |
5981 with repo.wlock(), repo.dirstate.changing_files(repo): |
5983 m = scmutil.match(repo[None], pats, opts) |
5982 m = scmutil.match(repo[None], pats, pycompat.byteskwargs(opts)) |
5984 subrepos = opts.get(b'subrepos') |
5983 subrepos = opts.get('subrepos') |
5985 uipathfn = scmutil.getuipathfn(repo, legacyrelativevalue=True) |
5984 uipathfn = scmutil.getuipathfn(repo, legacyrelativevalue=True) |
5986 return cmdutil.remove( |
5985 return cmdutil.remove( |
5987 ui, repo, m, b"", uipathfn, after, force, subrepos, dryrun=dryrun |
5986 ui, repo, m, b"", uipathfn, after, force, subrepos, dryrun=dryrun |
5988 ) |
5987 ) |
5989 |
5988 |