From: Rob Browning Date: Fri, 18 Oct 2013 23:30:01 +0000 (-0500) Subject: metadata_file(): don't load metadata objects for all the files in a dir. X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=e9d4e4ae6e27d06cca5226e9bce2dc7f915e3780;p=packages%2Fb%2Fbup.git metadata_file(): don't load metadata objects for all the files in a dir. 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 for helping find the problem and test the fix. Signed-off-by: Rob Browning --- diff --git a/lib/bup/vfs.py b/lib/bup/vfs.py index b60a6ad..e03b0ea 100644 --- a/lib/bup/vfs.py +++ b/lib/bup/vfs.py @@ -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