Mercurial > hg-stable
diff hgext/largefiles/overrides.py @ 21196:5c0d5b95b824 stable
largefiles: remove directories emptied after their files are moved (issue3515)
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Fri, 25 Apr 2014 22:34:09 -0400 |
parents | 49e13e76ec5a |
children | c5d35995d192 |
line wrap: on
line diff
--- a/hgext/largefiles/overrides.py Sat Apr 26 18:13:06 2014 +0900 +++ b/hgext/largefiles/overrides.py Fri Apr 25 22:34:09 2014 -0400 @@ -579,6 +579,10 @@ os.makedirs(destlfiledir) if rename: os.rename(repo.wjoin(srclfile), repo.wjoin(destlfile)) + + # The file is gone, but this deletes any empty parent + # directories as a side-effect. + util.unlinkpath(repo.wjoin(srclfile), True) lfdirstate.remove(srclfile) else: util.copyfile(repo.wjoin(srclfile),