mercurial/commands.py
changeset 50031 b979cdde99e6
parent 50030 5deac4eaa7d1
child 50032 06619266679d
equal deleted inserted replaced
50030:5deac4eaa7d1 50031:b979cdde99e6
   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