[PATCH STABLE] largefiles: use "ui.configlist()" to get largefiles.patterns configuration

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Thu Nov 24 02:58:46 CST 2011


# HG changeset patch
# User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
# Date 1322124890 -32400
# Branch stable
# Node ID 6c5e6ebe08128c91ee3f6d1119bc3ce3ba836837
# Parent  3992c7df85f2e404ae24af721c9ef09d1cc830f4
largefiles: use "ui.configlist()" to get largefiles.patterns configuration

current lfconvert implementation uses combination of "ui.config()" and
"str.split(' ')" to get largefiles.patterns configuration.

but it can not handle multiline configuration in hgrc files correctly.

lfconvert should use "ui.configlist()" instead of it, as same as
override_add does.

diff -r 3992c7df85f2 -r 6c5e6ebe0812 hgext/largefiles/lfcommands.py
--- a/hgext/largefiles/lfcommands.py	Wed Nov 23 16:25:44 2011 -0600
+++ b/hgext/largefiles/lfcommands.py	Thu Nov 24 17:54:50 2011 +0900
@@ -71,9 +71,7 @@
             lfiles = set()
             normalfiles = set()
             if not pats:
-                pats = ui.config(lfutil.longname, 'patterns', default=())
-                if pats:
-                    pats = pats.split(' ')
+                pats = ui.configlist(lfutil.longname, 'patterns', default=[])
             if pats:
                 matcher = match_.match(rsrc.root, '', list(pats))
             else:
diff -r 3992c7df85f2 -r 6c5e6ebe0812 tests/test-lfconvert.t
--- a/tests/test-lfconvert.t	Wed Nov 23 16:25:44 2011 -0600
+++ b/tests/test-lfconvert.t	Thu Nov 24 17:54:50 2011 +0900
@@ -5,7 +5,8 @@
   > graphlog =
   > [largefiles]
   > minsize = 0.5
-  > patterns = **.dat
+  > patterns = **.other
+  >     **.dat
   > EOF
 
 "lfconvert" works


More information about the Mercurial-devel mailing list