]> arthur.barton.de Git - bup.git/commit
Use branch tip, not newest date to choose 'latest' in BranchList._mksubs().
authorRob Browning <rlb@defaultvalue.org>
Fri, 23 Nov 2012 20:18:52 +0000 (14:18 -0600)
committerRob Browning <rlb@defaultvalue.org>
Fri, 23 Nov 2012 21:33:34 +0000 (15:33 -0600)
commit24a2f98381009ee54de8cf55773878248bc1f007
tree24758f70d626e85b250af604e60ddc353f5d71e4
parent4cdbfa3c59b73b926632b1ab7b9683d7dba22e1e
Use branch tip, not newest date to choose 'latest' in BranchList._mksubs().

Previously 'latest' was chosen in the VFS by taking max(revs), which
would pick the most recent commit by rev_list date, which only has a
resolution of integer seconds.

That approach could fail if two commits (i.e. two "bup save" runs)
executed close enough together that both commits ended up with the
same rev_list date.  In that case, the sort order was determined by
the commit hash, which is effectively random.

Since I couldn't think of a case where you wouldn't want 'latest' to
refer to the most recent commit (save) to the relevant branch,
'latest' is now computed as revs[0], i.e. the first commit returned by
rev_list.

Thanks to Zoran and Gabriel for some helpful sanity checks while
tracking this down.

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