Mercurial > hg
diff hgext/largefiles/overrides.py @ 15930:2dc599583ebe
largefiles: test and simplify empty directory removal in remove
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Thu, 19 Jan 2012 10:07:13 +0100 |
parents | c96148346af8 |
children | f19d5c852f9b |
line wrap: on
line diff
--- a/hgext/largefiles/overrides.py Thu Jan 19 02:14:06 2012 +0100 +++ b/hgext/largefiles/overrides.py Thu Jan 19 10:07:13 2012 +0100 @@ -159,11 +159,7 @@ if getattr(repo, "_isaddremove", False): ui.status(_('removing %s\n' % f)) if os.path.exists(repo.wjoin(f)): - os.unlink(repo.wjoin(f)) - currentdir = os.path.split(f)[0] - while currentdir and not os.listdir(repo.wjoin(currentdir)): - os.rmdir(repo.wjoin(currentdir)) - currentdir = os.path.split(currentdir)[0] + util.unlinkpath(repo.wjoin(f)) lfdirstate.remove(f) lfdirstate.write() forget = [lfutil.standin(f) for f in forget]