Mercurial > hg > mercurial-crew
comparison tests/test-largefiles.t @ 15792:7cbba3adabc7
largefiles: implement addremove (issue3064)
Implementing addremove correctly in largefiles is tricky, becuase the original
addremove function does not call into any of the add or remove function we've
already overridden in the extension. So the trick is to implement addremove
without duplicating any code.
This patch implements addremove by pulling out the interesting parts of
override_add() and override_remove() into generic utility functions, and
using those to handle the largefiles in addremove. Then a matcher is
installed that will ignore all largefiles, and the original addremove
function is called to take care of the regular files in addremove.
A small bit of monkey patching is used to make sure that remove_largefiles()
notifies the user when a file is removed by addremove and also makes sure
the removal of largefiles doesn't interfer with the original addremove's
operation of removing the standin.
author | Na'Tosha Bard <natosha@unity3d.com> |
---|---|
date | Sat, 07 Jan 2012 12:42:54 +0100 |
parents | 07b6af9076b4 |
children | 8bed8551d535 |
comparison
equal
deleted
inserted
replaced
15791:a814f8fcc65a | 15792:7cbba3adabc7 |
---|---|
284 $ cat sub2/large6 | 284 $ cat sub2/large6 |
285 large6 | 285 large6 |
286 $ cat sub2/large7 | 286 $ cat sub2/large7 |
287 large7 | 287 large7 |
288 | 288 |
289 Test addremove: verify that files that should be added as largfiles are added as | |
290 such and that already-existing largfiles are not added as normal files by | |
291 accident. | |
292 | |
293 $ rm normal3 | |
294 $ rm sub/large4 | |
295 $ echo "testing addremove with patterns" > testaddremove.dat | |
296 $ echo "normaladdremove" > normaladdremove | |
297 $ hg addremove | |
298 removing sub/large4 | |
299 adding testaddremove.dat as a largefile | |
300 removing normal3 | |
301 adding normaladdremove | |
302 | |
289 Clone a largefiles repo. | 303 Clone a largefiles repo. |
290 | 304 |
291 $ hg clone . ../b | 305 $ hg clone . ../b |
292 updating to branch default | 306 updating to branch default |
293 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | 307 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |