equal
deleted
inserted
replaced
329 Returns 0 if all files are successfully added. |
329 Returns 0 if all files are successfully added. |
330 """ |
330 """ |
331 opts = pycompat.byteskwargs(opts) |
331 opts = pycompat.byteskwargs(opts) |
332 if not opts.get(b'similarity'): |
332 if not opts.get(b'similarity'): |
333 opts[b'similarity'] = b'100' |
333 opts[b'similarity'] = b'100' |
334 with repo.wlock(): |
334 with repo.wlock(), repo.dirstate.changing_files(repo): |
335 matcher = scmutil.match(repo[None], pats, opts) |
335 matcher = scmutil.match(repo[None], pats, opts) |
336 relative = scmutil.anypats(pats, opts) |
336 relative = scmutil.anypats(pats, opts) |
337 uipathfn = scmutil.getuipathfn(repo, legacyrelativevalue=relative) |
337 uipathfn = scmutil.getuipathfn(repo, legacyrelativevalue=relative) |
338 return scmutil.addremove(repo, matcher, b"", uipathfn, opts) |
338 return scmutil.addremove(repo, matcher, b"", uipathfn, opts) |
339 |
339 |