]> arthur.barton.de Git - bup.git/commitdiff
metadata_file(): don't load metadata objects for all the files in a dir.
authorRob Browning <rlb@defaultvalue.org>
Fri, 18 Oct 2013 23:30:01 +0000 (18:30 -0500)
committerRob Browning <rlb@defaultvalue.org>
Tue, 22 Oct 2013 23:24:42 +0000 (18:24 -0500)
When only asked for the .bupm via metdata_file(), don't also parse the
.bupm and create all the metadata objects for the dir.  Aside from
being potentially wasteful, that may also make it impossible to
retrieve a broken .bupm via "cat-file --bupm" (for analysis).

Thanks to Anton Eliasson <devel@antoneliasson.se> for helping find the
problem and test the fix.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/vfs.py

index b60a6adc5d0f921717a96c2d2a20c7ec0cf0e08c..e03b0ea61c310cdfaf200bf025ad697e2049a61f 100644 (file)
@@ -441,7 +441,8 @@ class Dir(Node):
 
     def metadata_file(self):
         """Return this Dir's .bupm File, if any."""
-        self._populate_metadata()
+        if not self._subs:
+            self._mksubs()
         return self._bupm