##// END OF EJS Templates
largefiles: add --normal option to hg add (issue3061)
Na'Tosha Bard -
r15944:f19d5c85 stable
parent child Browse files
Show More
@@ -179,6 +179,11 def remove_largefiles(ui, repo, *pats, *
179 # matcher which matches only the normal files and runs the original
179 # matcher which matches only the normal files and runs the original
180 # version of add.
180 # version of add.
181 def override_add(orig, ui, repo, *pats, **opts):
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 bad = add_largefiles(ui, repo, *pats, **opts)
187 bad = add_largefiles(ui, repo, *pats, **opts)
183 installnormalfilesmatchfn(repo[None].manifest())
188 installnormalfilesmatchfn(repo[None].manifest())
184 result = orig(ui, repo, *pats, **opts)
189 result = orig(ui, repo, *pats, **opts)
@@ -23,6 +23,7 def uisetup(ui):
23 entry = extensions.wrapcommand(commands.table, 'add',
23 entry = extensions.wrapcommand(commands.table, 'add',
24 overrides.override_add)
24 overrides.override_add)
25 addopt = [('', 'large', None, _('add as largefile')),
25 addopt = [('', 'large', None, _('add as largefile')),
26 ('', 'normal', None, _('add as normal file')),
26 ('', 'lfsize', '', _('add all files above this size '
27 ('', 'lfsize', '', _('add all files above this size '
27 '(in megabytes) as largefiles '
28 '(in megabytes) as largefiles '
28 '(default: 10)'))]
29 '(default: 10)'))]
@@ -768,7 +768,18 Test that renaming a largefile results i
768 $ hg st
768 $ hg st
769 A sub2/large6-renamed
769 A sub2/large6-renamed
770 R sub2/large6
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 vanilla clients not locked out from largefiles servers on vanilla repos
784 vanilla clients not locked out from largefiles servers on vanilla repos
774 $ mkdir r1
785 $ mkdir r1
General Comments 0
You need to be logged in to leave comments. Login now