##// END OF EJS Templates
largefiles: test and simplify empty directory removal in remove
Patrick Mezard -
r15930:2dc59958 default
parent child Browse files
Show More
@@ -159,11 +159,7 b' def remove_largefiles(ui, repo, *pats, *'
159 if getattr(repo, "_isaddremove", False):
159 if getattr(repo, "_isaddremove", False):
160 ui.status(_('removing %s\n' % f))
160 ui.status(_('removing %s\n' % f))
161 if os.path.exists(repo.wjoin(f)):
161 if os.path.exists(repo.wjoin(f)):
162 os.unlink(repo.wjoin(f))
162 util.unlinkpath(repo.wjoin(f))
163 currentdir = os.path.split(f)[0]
164 while currentdir and not os.listdir(repo.wjoin(currentdir)):
165 os.rmdir(repo.wjoin(currentdir))
166 currentdir = os.path.split(currentdir)[0]
167 lfdirstate.remove(f)
163 lfdirstate.remove(f)
168 lfdirstate.write()
164 lfdirstate.write()
169 forget = [lfutil.standin(f) for f in forget]
165 forget = [lfutil.standin(f) for f in forget]
@@ -556,6 +556,14 b' Test removing empty largefiles directori'
556 [1]
556 [1]
557 $ hg update -q
557 $ hg update -q
558
558
559 Test hg remove removes empty largefiles directories
560 $ test -d sub2 && echo "sub2 exists"
561 sub2 exists
562 $ hg remove sub2/*
563 $ test -d sub2 && echo "error: sub2 should not exist anymore"
564 [1]
565 $ hg revert sub2/large6 sub2/large7
566
559 "revert" works on largefiles (and normal files too).
567 "revert" works on largefiles (and normal files too).
560 $ echo hack3 >> normal3
568 $ echo hack3 >> normal3
561 $ echo hack4 >> sub/normal4
569 $ echo hack4 >> sub/normal4
General Comments 0
You need to be logged in to leave comments. Login now