##// END OF EJS Templates
applyupdates: audit unlinking of renamed files and directories
Adrian Buehlmann -
r14398:ae1f7a53 default
parent child Browse files
Show More
@@ -296,14 +296,15 def applyupdates(repo, action, wctx, mct
296 if f != fd and move:
296 if f != fd and move:
297 moves.append(f)
297 moves.append(f)
298
298
299 audit = scmutil.pathauditor(repo.root)
300
299 # remove renamed files after safely stored
301 # remove renamed files after safely stored
300 for f in moves:
302 for f in moves:
301 if os.path.lexists(repo.wjoin(f)):
303 if os.path.lexists(repo.wjoin(f)):
302 repo.ui.debug("removing %s\n" % f)
304 repo.ui.debug("removing %s\n" % f)
305 audit(f)
303 os.unlink(repo.wjoin(f))
306 os.unlink(repo.wjoin(f))
304
307
305 audit_path = scmutil.pathauditor(repo.root)
306
307 numupdates = len(action)
308 numupdates = len(action)
308 for i, a in enumerate(action):
309 for i, a in enumerate(action):
309 f, m = a[:2]
310 f, m = a[:2]
@@ -313,7 +314,7 def applyupdates(repo, action, wctx, mct
313 continue
314 continue
314 if m == "r": # remove
315 if m == "r": # remove
315 repo.ui.note(_("removing %s\n") % f)
316 repo.ui.note(_("removing %s\n") % f)
316 audit_path(f)
317 audit(f)
317 if f == '.hgsubstate': # subrepo states need updating
318 if f == '.hgsubstate': # subrepo states need updating
318 subrepo.submerge(repo, wctx, mctx, wctx, overwrite)
319 subrepo.submerge(repo, wctx, mctx, wctx, overwrite)
319 try:
320 try:
@@ -340,6 +341,7 def applyupdates(repo, action, wctx, mct
340 if (move and repo.dirstate.normalize(fd) != f
341 if (move and repo.dirstate.normalize(fd) != f
341 and os.path.lexists(repo.wjoin(f))):
342 and os.path.lexists(repo.wjoin(f))):
342 repo.ui.debug("removing %s\n" % f)
343 repo.ui.debug("removing %s\n" % f)
344 audit(f)
343 os.unlink(repo.wjoin(f))
345 os.unlink(repo.wjoin(f))
344 elif m == "g": # get
346 elif m == "g": # get
345 flags = a[2]
347 flags = a[2]
@@ -354,6 +356,7 def applyupdates(repo, action, wctx, mct
354 f2, fd, flags = a[2:]
356 f2, fd, flags = a[2:]
355 if f:
357 if f:
356 repo.ui.note(_("moving %s to %s\n") % (f, fd))
358 repo.ui.note(_("moving %s to %s\n") % (f, fd))
359 audit(f)
357 t = wctx.filectx(f).data()
360 t = wctx.filectx(f).data()
358 repo.wwrite(fd, t, flags)
361 repo.wwrite(fd, t, flags)
359 util.unlinkpath(repo.wjoin(f))
362 util.unlinkpath(repo.wjoin(f))
General Comments 0
You need to be logged in to leave comments. Login now