Show More
@@ -179,6 +179,11 b' def remove_largefiles(ui, repo, *pats, *' | |||
|
179 | 179 | # matcher which matches only the normal files and runs the original |
|
180 | 180 | # version of add. |
|
181 | 181 | def override_add(orig, ui, repo, *pats, **opts): |
|
182 | normal = opts.pop('normal') | |
|
183 | if normal: | |
|
184 | if opts.get('large'): | |
|
185 | raise util.Abort(_('--normal cannot be used with --large')) | |
|
186 | return orig(ui, repo, *pats, **opts) | |
|
182 | 187 | bad = add_largefiles(ui, repo, *pats, **opts) |
|
183 | 188 | installnormalfilesmatchfn(repo[None].manifest()) |
|
184 | 189 | result = orig(ui, repo, *pats, **opts) |
@@ -23,6 +23,7 b' def uisetup(ui):' | |||
|
23 | 23 | entry = extensions.wrapcommand(commands.table, 'add', |
|
24 | 24 | overrides.override_add) |
|
25 | 25 | addopt = [('', 'large', None, _('add as largefile')), |
|
26 | ('', 'normal', None, _('add as normal file')), | |
|
26 | 27 | ('', 'lfsize', '', _('add all files above this size ' |
|
27 | 28 | '(in megabytes) as largefiles ' |
|
28 | 29 | '(default: 10)'))] |
@@ -768,7 +768,18 b' Test that renaming a largefile results i' | |||
|
768 | 768 | $ hg st |
|
769 | 769 | A sub2/large6-renamed |
|
770 | 770 | R sub2/large6 |
|
771 |
$ cd .. |
|
|
771 | $ cd .. | |
|
772 | ||
|
773 | Test --normal flag | |
|
774 | ||
|
775 | $ dd if=/dev/urandom bs=2k count=11k > new-largefile 2> /dev/null | |
|
776 | $ hg add --normal --large new-largefile | |
|
777 | abort: --normal cannot be used with --large | |
|
778 | [255] | |
|
779 | $ hg add --normal new-largefile | |
|
780 | new-largefile: up to 69 MB of RAM may be required to manage this file | |
|
781 | (use 'hg revert new-largefile' to cancel the pending addition) | |
|
782 | $ cd .. | |
|
772 | 783 | |
|
773 | 784 | vanilla clients not locked out from largefiles servers on vanilla repos |
|
774 | 785 | $ mkdir r1 |
General Comments 0
You need to be logged in to leave comments.
Login now