mercurial/commands.py
changeset 41685 b81ecf3571d5
parent 41653 16a49c778bde
child 41686 935e06e95b91
equal deleted inserted replaced
41684:a8d3a4be066e 41685:b81ecf3571d5
   178 
   178 
   179     Returns 0 if all files are successfully added.
   179     Returns 0 if all files are successfully added.
   180     """
   180     """
   181 
   181 
   182     m = scmutil.match(repo[None], pats, pycompat.byteskwargs(opts))
   182     m = scmutil.match(repo[None], pats, pycompat.byteskwargs(opts))
   183     uipathfn = scmutil.getuipathfn(repo, forcerelativevalue=True)
   183     uipathfn = scmutil.getuipathfn(repo, legacyrelativevalue=True)
   184     rejected = cmdutil.add(ui, repo, m, "", uipathfn, False, **opts)
   184     rejected = cmdutil.add(ui, repo, m, "", uipathfn, False, **opts)
   185     return rejected and 1 or 0
   185     return rejected and 1 or 0
   186 
   186 
   187 @command('addremove',
   187 @command('addremove',
   188     similarityopts + subrepoopts + walkopts + dryrunopts,
   188     similarityopts + subrepoopts + walkopts + dryrunopts,
   254     opts = pycompat.byteskwargs(opts)
   254     opts = pycompat.byteskwargs(opts)
   255     if not opts.get('similarity'):
   255     if not opts.get('similarity'):
   256         opts['similarity'] = '100'
   256         opts['similarity'] = '100'
   257     matcher = scmutil.match(repo[None], pats, opts)
   257     matcher = scmutil.match(repo[None], pats, opts)
   258     relative = scmutil.anypats(pats, opts)
   258     relative = scmutil.anypats(pats, opts)
   259     uipathfn = scmutil.getuipathfn(repo, forcerelativevalue=relative)
   259     uipathfn = scmutil.getuipathfn(repo, legacyrelativevalue=relative)
   260     return scmutil.addremove(repo, matcher, "", uipathfn, opts)
   260     return scmutil.addremove(repo, matcher, "", uipathfn, opts)
   261 
   261 
   262 @command('annotate|blame',
   262 @command('annotate|blame',
   263     [('r', 'rev', '', _('annotate the specified revision'), _('REV')),
   263     [('r', 'rev', '', _('annotate the specified revision'), _('REV')),
   264     ('', 'follow', None,
   264     ('', 'follow', None,
  2256     if not pats:
  2256     if not pats:
  2257         raise error.Abort(_('no files specified'))
  2257         raise error.Abort(_('no files specified'))
  2258 
  2258 
  2259     m = scmutil.match(repo[None], pats, opts)
  2259     m = scmutil.match(repo[None], pats, opts)
  2260     dryrun, interactive = opts.get('dry_run'), opts.get('interactive')
  2260     dryrun, interactive = opts.get('dry_run'), opts.get('interactive')
  2261     uipathfn = scmutil.getuipathfn(repo, forcerelativevalue=True)
  2261     uipathfn = scmutil.getuipathfn(repo, legacyrelativevalue=True)
  2262     rejected = cmdutil.forget(ui, repo, m, prefix="", uipathfn=uipathfn,
  2262     rejected = cmdutil.forget(ui, repo, m, prefix="", uipathfn=uipathfn,
  2263                               explicitonly=False, dryrun=dryrun,
  2263                               explicitonly=False, dryrun=dryrun,
  2264                               interactive=interactive)[0]
  2264                               interactive=interactive)[0]
  2265     return rejected and 1 or 0
  2265     return rejected and 1 or 0
  2266 
  2266 
  4718     if not pats and not after:
  4718     if not pats and not after:
  4719         raise error.Abort(_('no files specified'))
  4719         raise error.Abort(_('no files specified'))
  4720 
  4720 
  4721     m = scmutil.match(repo[None], pats, opts)
  4721     m = scmutil.match(repo[None], pats, opts)
  4722     subrepos = opts.get('subrepos')
  4722     subrepos = opts.get('subrepos')
  4723     uipathfn = scmutil.getuipathfn(repo, forcerelativevalue=True)
  4723     uipathfn = scmutil.getuipathfn(repo, legacyrelativevalue=True)
  4724     return cmdutil.remove(ui, repo, m, "", uipathfn, after, force, subrepos,
  4724     return cmdutil.remove(ui, repo, m, "", uipathfn, after, force, subrepos,
  4725                           dryrun=dryrun)
  4725                           dryrun=dryrun)
  4726 
  4726 
  4727 @command('rename|move|mv',
  4727 @command('rename|move|mv',
  4728     [('A', 'after', None, _('record a rename that has already occurred')),
  4728     [('A', 'after', None, _('record a rename that has already occurred')),