wal-e/wal-e — pull request #63 by drob (2013-12-02 12:25:53+00:00)
Title: Adds a way to specify a number of backups to keep when deleting old backups.

This behavior can be invoked with `wal-e delete [--confirm] retain N`, where `N` is the number of backups you'd like to retain.

Includes some fixes to existing bugs.

The diff isn't lining up particularly well. The main idea is:
- Pull out code in `delete_before` into helper functions `_delete_wals_before` and `_delete_base_backups_before`.
- In `delete_with_retention`, compute the last key to retain and invoke the new helper functions.