mercurial/commands.py
changeset 27144 24440cc7b441
parent 27143 fab21bac1024
child 27147 804abe8999f3
equal deleted inserted replaced
27143:fab21bac1024 27144:24440cc7b441
   244     those similar enough as renames. Detecting renamed files this way
   244     those similar enough as renames. Detecting renamed files this way
   245     can be expensive. After using this option, :hg:`status -C` can be
   245     can be expensive. After using this option, :hg:`status -C` can be
   246     used to check which files were identified as moved or renamed. If
   246     used to check which files were identified as moved or renamed. If
   247     not specified, -s/--similarity defaults to 100 and only renames of
   247     not specified, -s/--similarity defaults to 100 and only renames of
   248     identical files are detected.
   248     identical files are detected.
       
   249 
       
   250     .. container:: verbose
       
   251 
       
   252        Examples:
       
   253 
       
   254          - A number of files (bar.c and foo.c) are new,
       
   255            while foobar.c has been removed (without using :hg:`remove`)
       
   256            from the repository::
       
   257 
       
   258              $ ls
       
   259              bar.c foo.c
       
   260              $ hg status
       
   261              ! foobar.c
       
   262              ? bar.c
       
   263              ? foo.c
       
   264              $ hg addremove
       
   265              adding bar.c
       
   266              adding foo.c
       
   267              removing foobar.c
       
   268              $ hg status
       
   269              A bar.c
       
   270              A foo.c
       
   271              R foobar.c
       
   272 
       
   273          - A file foobar.c was moved to foo.c without using :hg:`rename`.
       
   274            Afterwards, it was edited slightly::
       
   275 
       
   276              $ ls
       
   277              foo.c
       
   278              $ hg status
       
   279              ! foobar.c
       
   280              ? foo.c
       
   281              $ hg addremove --similarity 90
       
   282              removing foobar.c
       
   283              adding foo.c
       
   284              recording removal of foobar.c as rename to foo.c (94% similar)
       
   285              $ hg status -C
       
   286              A foo.c
       
   287                foobar.c
       
   288              R foobar.c
   249 
   289 
   250     Returns 0 if all files are successfully added.
   290     Returns 0 if all files are successfully added.
   251     """
   291     """
   252     try:
   292     try:
   253         sim = float(opts.get('similarity') or 100)
   293         sim = float(opts.get('similarity') or 100)