Mercurial > hg
changeset 18153:51837a31b425
largefiles: remove reporemove portability wrapper
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Thu, 13 Dec 2012 19:19:06 +0100 |
parents | 4454607b5d25 |
children | 93c697d9c158 |
files | hgext/largefiles/lfutil.py hgext/largefiles/overrides.py |
diffstat | 2 files changed, 7 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/largefiles/lfutil.py Thu Dec 13 19:19:06 2012 +0100 +++ b/hgext/largefiles/lfutil.py Thu Dec 13 19:19:06 2012 +0100 @@ -31,18 +31,6 @@ add = repo[None].add return add(list) -def reporemove(repo, list, unlink=False): - def remove(list, unlink): - wlock = repo.wlock() - try: - if unlink: - for f in list: - util.unlinkpath(repo.wjoin(f), ignoremissing=True) - repo[None].forget(list) - finally: - wlock.release() - return remove(list, unlink=unlink) - def repoforget(repo, list): forget = repo[None].forget return forget(list)
--- a/hgext/largefiles/overrides.py Thu Dec 13 19:19:06 2012 +0100 +++ b/hgext/largefiles/overrides.py Thu Dec 13 19:19:06 2012 +0100 @@ -180,9 +180,9 @@ # If this is being called by addremove, let the original addremove # function handle this. if not getattr(repo, "_isaddremove", False): - lfutil.reporemove(repo, remove, unlink=True) - else: - lfutil.reporemove(repo, remove, unlink=False) + for f in remove: + util.unlinkpath(repo.wjoin(f), ignoremissing=True) + repo[None].forget(remove) finally: wlock.release() @@ -958,8 +958,10 @@ else: lfdirstate.remove(f) lfdirstate.write() - lfutil.reporemove(repo, [lfutil.standin(f) for f in forget], - unlink=True) + standins = [lfutil.standin(f) for f in forget] + for f in standins: + util.unlinkpath(repo.wjoin(f), ignoremissing=True) + repo[None].forget(standins) finally: wlock.release()