mercurial/cmdutil.py
changeset 38493 da2a7d8354b2
parent 38461 8459e8d2f729
child 38539 b1bbff1dd99a
equal deleted inserted replaced
38492:2394cd58b81f 38493:da2a7d8354b2
  1240         # fix up dirstate
  1240         # fix up dirstate
  1241         scmutil.dirstatecopy(ui, repo, wctx, abssrc, abstarget,
  1241         scmutil.dirstatecopy(ui, repo, wctx, abssrc, abstarget,
  1242                              dryrun=dryrun, cwd=cwd)
  1242                              dryrun=dryrun, cwd=cwd)
  1243         if rename and not dryrun:
  1243         if rename and not dryrun:
  1244             if not after and srcexists and not samefile:
  1244             if not after and srcexists and not samefile:
  1245                 repo.wvfs.unlinkpath(abssrc)
  1245                 rmdir = repo.ui.configbool('experimental', 'removeemptydirs')
       
  1246                 repo.wvfs.unlinkpath(abssrc, rmdir=rmdir)
  1246             wctx.forget([abssrc])
  1247             wctx.forget([abssrc])
  1247 
  1248 
  1248     # pat: ossep
  1249     # pat: ossep
  1249     # dest ossep
  1250     # dest ossep
  1250     # srcs: list of (hgsep, hgsep, ossep, bool)
  1251     # srcs: list of (hgsep, hgsep, ossep, bool)
  2267         with repo.wlock():
  2268         with repo.wlock():
  2268             if not after:
  2269             if not after:
  2269                 for f in list:
  2270                 for f in list:
  2270                     if f in added:
  2271                     if f in added:
  2271                         continue # we never unlink added files on remove
  2272                         continue # we never unlink added files on remove
  2272                     repo.wvfs.unlinkpath(f, ignoremissing=True)
  2273                     rmdir = repo.ui.configbool('experimental',
       
  2274                                                'removeemptydirs')
       
  2275                     repo.wvfs.unlinkpath(f, ignoremissing=True, rmdir=rmdir)
  2273             repo[None].forget(list)
  2276             repo[None].forget(list)
  2274 
  2277 
  2275     if warn:
  2278     if warn:
  2276         for warning in warnings:
  2279         for warning in warnings:
  2277             ui.warn(warning)
  2280             ui.warn(warning)
  3027         fc = ctx[f]
  3030         fc = ctx[f]
  3028         repo.wwrite(f, fc.data(), fc.flags())
  3031         repo.wwrite(f, fc.data(), fc.flags())
  3029 
  3032 
  3030     def doremove(f):
  3033     def doremove(f):
  3031         try:
  3034         try:
  3032             repo.wvfs.unlinkpath(f)
  3035             rmdir = repo.ui.configbool('experimental', 'removeemptydirs')
       
  3036             repo.wvfs.unlinkpath(f, rmdir=rmdir)
  3033         except OSError:
  3037         except OSError:
  3034             pass
  3038             pass
  3035         repo.dirstate.remove(f)
  3039         repo.dirstate.remove(f)
  3036 
  3040 
  3037     audit_path = pathutil.pathauditor(repo.root, cached=True)
  3041     audit_path = pathutil.pathauditor(repo.root, cached=True)