Mercurial > hg-stable
changeset 14398:ae1f7a5373e8
applyupdates: audit unlinking of renamed files and directories
author | Adrian Buehlmann <adrian@cadifra.com> |
---|---|
date | Sat, 21 May 2011 02:05:00 +0200 |
parents | 0368ad7963be |
children | 71938479eff9 |
files | mercurial/merge.py |
diffstat | 1 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/merge.py Fri May 20 21:04:45 2011 +0300 +++ b/mercurial/merge.py Sat May 21 02:05:00 2011 +0200 @@ -296,14 +296,15 @@ if f != fd and move: moves.append(f) + audit = scmutil.pathauditor(repo.root) + # remove renamed files after safely stored for f in moves: if os.path.lexists(repo.wjoin(f)): repo.ui.debug("removing %s\n" % f) + audit(f) os.unlink(repo.wjoin(f)) - audit_path = scmutil.pathauditor(repo.root) - numupdates = len(action) for i, a in enumerate(action): f, m = a[:2] @@ -313,7 +314,7 @@ continue if m == "r": # remove repo.ui.note(_("removing %s\n") % f) - audit_path(f) + audit(f) if f == '.hgsubstate': # subrepo states need updating subrepo.submerge(repo, wctx, mctx, wctx, overwrite) try: @@ -340,6 +341,7 @@ if (move and repo.dirstate.normalize(fd) != f and os.path.lexists(repo.wjoin(f))): repo.ui.debug("removing %s\n" % f) + audit(f) os.unlink(repo.wjoin(f)) elif m == "g": # get flags = a[2] @@ -354,6 +356,7 @@ f2, fd, flags = a[2:] if f: repo.ui.note(_("moving %s to %s\n") % (f, fd)) + audit(f) t = wctx.filectx(f).data() repo.wwrite(fd, t, flags) util.unlinkpath(repo.wjoin(f))