##// END OF EJS Templates
largefiles: remove directories emptied after their files are moved (issue3515)
Matt Harbison -
r21196:5c0d5b95 stable
parent child Browse files
Show More
@@ -579,6 +579,10 b' def overridecopy(orig, ui, repo, pats, o'
579 os.makedirs(destlfiledir)
579 os.makedirs(destlfiledir)
580 if rename:
580 if rename:
581 os.rename(repo.wjoin(srclfile), repo.wjoin(destlfile))
581 os.rename(repo.wjoin(srclfile), repo.wjoin(destlfile))
582
583 # The file is gone, but this deletes any empty parent
584 # directories as a side-effect.
585 util.unlinkpath(repo.wjoin(srclfile), True)
582 lfdirstate.remove(srclfile)
586 lfdirstate.remove(srclfile)
583 else:
587 else:
584 util.copyfile(repo.wjoin(srclfile),
588 util.copyfile(repo.wjoin(srclfile),
@@ -214,8 +214,18 b' Test copies and moves from a directory o'
214 ./baz/largefile
214 ./baz/largefile
215 ./dirb
215 ./dirb
216 ./dirb/largefile
216 ./dirb/largefile
217 ./foo
217 $ cd ..
218 $ cd ../../a
218 $ hg mv dira dirc
219 moving .hglf/dira/baz/largefile to .hglf/dirc/baz/largefile (glob)
220 moving .hglf/dira/dirb/largefile to .hglf/dirc/dirb/largefile (glob)
221 $ find * | sort
222 dirc
223 dirc/baz
224 dirc/baz/largefile
225 dirc/dirb
226 dirc/dirb/largefile
227 $ hg up -qC
228 $ cd ../a
219
229
220 #if serve
230 #if serve
221 Test display of largefiles in hgweb
231 Test display of largefiles in hgweb
General Comments 0
You need to be logged in to leave comments. Login now