mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
largefiles: test and simplify empty directory removal in remove
This commit is contained in:
parent
dbffdfd960
commit
7768e63bf5
@ -159,11 +159,7 @@ def remove_largefiles(ui, repo, *pats, **opts):
|
||||
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]
|
||||
|
@ -556,6 +556,14 @@ Test removing empty largefiles directories on update
|
||||
[1]
|
||||
$ hg update -q
|
||||
|
||||
Test hg remove removes empty largefiles directories
|
||||
$ test -d sub2 && echo "sub2 exists"
|
||||
sub2 exists
|
||||
$ hg remove sub2/*
|
||||
$ test -d sub2 && echo "error: sub2 should not exist anymore"
|
||||
[1]
|
||||
$ hg revert sub2/large6 sub2/large7
|
||||
|
||||
"revert" works on largefiles (and normal files too).
|
||||
$ echo hack3 >> normal3
|
||||
$ echo hack4 >> sub/normal4
|
||||
|
Loading…
Reference in New Issue
Block a user