# HG changeset patch # User Patrick Mezard # Date 1326796172 -3600 # Node ID 29defa7d20f6d2a00e75c4bfe92bfc0115ac2321 # Parent a3e2b9a1f063d11f2a64c9e38f2b37f0e0a92b9b largefiles: remove empty directories upon update (issue3202) diff -r a3e2b9a1f063 -r 29defa7d20f6 hgext/largefiles/lfcommands.py --- a/hgext/largefiles/lfcommands.py Sun Jan 15 13:39:09 2012 +0100 +++ b/hgext/largefiles/lfcommands.py Tue Jan 17 11:29:32 2012 +0100 @@ -451,7 +451,7 @@ # largefile is converted back to a normal file: the standin # disappears, but a new (normal) file appears as the lfile. if os.path.exists(abslfile) and lfile not in repo[None]: - os.unlink(abslfile) + util.unlinkpath(abslfile) ret = -1 state = repo.dirstate[lfutil.standin(lfile)] if state == 'n': diff -r a3e2b9a1f063 -r 29defa7d20f6 tests/test-largefiles.t --- a/tests/test-largefiles.t Sun Jan 15 13:39:09 2012 +0100 +++ b/tests/test-largefiles.t Tue Jan 17 11:29:32 2012 +0100 @@ -571,6 +571,14 @@ getting changed largefiles 1 largefiles updated, 0 removed +Test removing empty largefiles directories on update + $ test -d sub2 && echo "sub2 exists" + sub2 exists + $ hg update -q null + $ test -d sub2 && echo "error: sub2 should not exist anymore" + [1] + $ hg update -q + "revert" works on largefiles (and normal files too). $ echo hack3 >> normal3 $ echo hack4 >> sub/normal4