[PATCH 2 of 4] largefiles: allow minimum size to be a float

Greg Ward greg at gerg.ca
Tue Oct 11 20:12:00 CDT 2011


# HG changeset patch
# User Greg Ward <greg at gerg.ca>
# Date 1318381628 14400
# Node ID 3ed04d616bc9b9f57bd3735d008205e5b8d65e3d
# Parent  5fadd3117fe23f600ae22f258e6417ccf4d0dbb0
largefiles: allow minimum size to be a float

Some old-fashioned people (e.g. me) think that incompressible
binary files >100 kB count as "large".

diff --git a/hgext/largefiles/lfcommands.py b/hgext/largefiles/lfcommands.py
--- a/hgext/largefiles/lfcommands.py
+++ b/hgext/largefiles/lfcommands.py
@@ -469,7 +469,7 @@
 
 cmdtable = {
     'lfconvert': (lfconvert,
-                  [('s', 'size', 0, 'All files over this size (in megabytes) '
+                  [('s', 'size', '', 'All files over this size (in megabytes) '
                   'will be considered largefiles. This can also be specified '
                   'in your hgrc as [largefiles].size.'),
                   ('','tonormal',False,
diff --git a/hgext/largefiles/lfutil.py b/hgext/largefiles/lfutil.py
--- a/hgext/largefiles/lfutil.py
+++ b/hgext/largefiles/lfutil.py
@@ -107,9 +107,9 @@
         lfsize = ui.config(longname, 'size', default=default)
     if lfsize:
         try:
-            lfsize = int(lfsize)
+            lfsize = float(lfsize)
         except ValueError:
-            raise util.Abort(_('largefiles: size must be an integer, was %s\n')
+            raise util.Abort(_('largefiles: size must be number (not %s)\n')
                              % lfsize)
     if lfsize is None:
         raise util.Abort(_('minimum size for largefiles must be specified'))


More information about the Mercurial-devel mailing list