mercurial/subrepo.py
branchstable
changeset 21564 2e91d4964ecd
parent 21041 a2cc3c08c3ac
child 21565 7f7f634d073d
--- a/mercurial/subrepo.py	Sat May 17 14:43:06 2014 +0900
+++ b/mercurial/subrepo.py	Thu May 08 19:03:00 2014 +0900
@@ -315,16 +315,14 @@
         raise util.Abort(_("default path for subrepository not found"))
 
 def _sanitize(ui, path):
-    def v(arg, dirname, names):
+    for dirname, dirs, names in os.walk(path):
         if os.path.basename(dirname).lower() != '.hg':
-            return
+            continue
         for f in names:
             if f.lower() == 'hgrc':
-                ui.warn(
-                    _("warning: removing potentially hostile .hg/hgrc in '%s'")
-                      % path)
+                ui.warn(_("warning: removing potentially hostile 'hgrc' "
+                          "in '%s'\n") % dirname)
                 os.unlink(os.path.join(dirname, f))
-    os.walk(path, v, None)
 
 def subrepo(ctx, path):
     """return instance of the right subrepo class for subrepo in path"""