]> arthur.barton.de Git - bup.git/commit - lib/bup/index.py
index: only collect metadata for stale paths
authorRob Browning <rlb@defaultvalue.org>
Sun, 25 Dec 2016 17:44:56 +0000 (11:44 -0600)
committerRob Browning <rlb@defaultvalue.org>
Mon, 26 Dec 2016 18:18:47 +0000 (12:18 -0600)
commit7d8f74a4f0ed85a1827ec02a9f39b336093b91dc
tree66dbd1cd4119b6be1fd071fa48c7c7bbb312deac
parent43ebef65bd8cf86f58d7bd49872cceea58d9712d
index: only collect metadata for stale paths

Stop collecting all of the metadata for every path, even if the path
hasn't changed since the last save.  Further, rework the code to
short-circuit some other unnecessary work.

To support this, split Entry.from_stat() into two parts, stale(), which
tests to see if an entry has "materially" changed, and
update_from_stat() which updates the entry to match the stat information
provided.

This should substantially decrease the indexing cost for paths that
haven't changed since the last save.

While we're here, rename hashgen to fake_hash so it's clearer that's its
only purpose.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
cmd/index-cmd.py
lib/bup/index.py
lib/bup/t/tindex.py