diff --git a/hgext/largefiles/lfcommands.py b/hgext/largefiles/lfcommands.py --- a/hgext/largefiles/lfcommands.py +++ b/hgext/largefiles/lfcommands.py @@ -466,7 +466,7 @@ def _updatelfile(repo, lfdirstate, lfile # 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 --git a/tests/test-largefiles.t b/tests/test-largefiles.t --- a/tests/test-largefiles.t +++ b/tests/test-largefiles.t @@ -546,6 +546,14 @@ Now "update check" is happy. 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