Follows the estimate work (#67–#70). Base is main; the whole estimate stack is merged.
Takeout's --estimate already counted and sized the mail, but calendars and contacts fell back to the plain per-file counts. Now it reads the .ics and .vcf files too: it counts the events and contacts that are new since the archive was last filled and sums the bytes of the record each would store — writing nothing.
How it dedupes
Each kind uses the same key the import keeps, so re-estimating a part-filled archive reports only what's left:
events by their UID — synthesised from the file path and ordinal when an event carries none, exactly as the import does;
contacts by the card UID.
So an object that appears in two files, or one already imported, counts once.
Changes
estimate_calendar / estimate_contacts in import_takeout/coordinator.rs, mirroring estimate_mail; the shared archived-id lookup is pulled into one archived_keys helper (mail now uses it too).
estimate_available's Takeout comment, the --estimate help, and the README updated: Takeout now itemizes mail, events and contacts.
The synthetic-Takeout estimate test asserts new events (≥2) and the four UID-deduped cards are counted and sized, and that a re-estimate after import finds nothing new of any kind (renamed estimate_counts_new_objects_and_sizes_them).
With this, --estimate sizes imap, maildir, caldav, carddav, EWS and a full Takeout (mail + events + contacts). Remaining on the estimate line: Graph/JMAP counts-only (sizes cost an extra round-trip per item).
Follows the estimate work (#67–#70). Base is `main`; the whole estimate stack is merged.
Takeout's `--estimate` already counted and sized the **mail**, but calendars and contacts fell back to the plain per-file counts. Now it reads the `.ics` and `.vcf` files too: it counts the **events** and **contacts** that are new since the archive was last filled and sums the bytes of the record each would store — writing nothing.
### How it dedupes
Each kind uses the same key the import keeps, so re-estimating a part-filled archive reports only what's left:
- **events** by their `UID` — synthesised from the file path and ordinal when an event carries none, exactly as the import does;
- **contacts** by the card `UID`.
So an object that appears in two files, or one already imported, counts once.
### Changes
- `estimate_calendar` / `estimate_contacts` in `import_takeout/coordinator.rs`, mirroring `estimate_mail`; the shared archived-id lookup is pulled into one `archived_keys` helper (mail now uses it too).
- `estimate_available`'s Takeout comment, the `--estimate` help, and the README updated: Takeout now itemizes mail, events and contacts.
- The synthetic-Takeout estimate test asserts new events (≥2) and the four UID-deduped cards are counted and sized, and that a re-estimate after import finds **nothing new of any kind** (renamed `estimate_counts_new_objects_and_sizes_them`).
### Verification
`cargo fmt`, `cargo clippy --all-targets -D warnings`, `cargo test --locked` (all 43 binaries) green.
With this, `--estimate` sizes imap, maildir, caldav, carddav, EWS and a full Takeout (mail + events + contacts). Remaining on the estimate line: Graph/JMAP counts-only (sizes cost an extra round-trip per item).
Takeout's --estimate counted and sized the mail but left calendars and
contacts to the plain file counts. Now it reads the .ics and .vcf files
as well: it counts the events and contacts that are new since the
archive was last filled and sums the bytes of the record each would
store, writing nothing.
Each kind dedupes by the same key the import keeps -- events by their
UID (synthesised from the file path and ordinal when an event has none,
exactly as the import does), contacts by the card UID -- so an object
that appears in two files, or one already imported, counts once. A
re-estimate of a part-filled archive reports only what is left.
The archived-id lookup the three scans share is pulled into one helper,
archived_keys. The synthetic-Takeout estimate test now asserts new
events and contacts are counted and sized, and that a re-estimate after
import finds nothing new of any kind.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Follows the estimate work (#67–#70). Base is
main; the whole estimate stack is merged.Takeout's
--estimatealready counted and sized the mail, but calendars and contacts fell back to the plain per-file counts. Now it reads the.icsand.vcffiles too: it counts the events and contacts that are new since the archive was last filled and sums the bytes of the record each would store — writing nothing.How it dedupes
Each kind uses the same key the import keeps, so re-estimating a part-filled archive reports only what's left:
UID— synthesised from the file path and ordinal when an event carries none, exactly as the import does;UID.So an object that appears in two files, or one already imported, counts once.
Changes
estimate_calendar/estimate_contactsinimport_takeout/coordinator.rs, mirroringestimate_mail; the shared archived-id lookup is pulled into onearchived_keyshelper (mail now uses it too).estimate_available's Takeout comment, the--estimatehelp, and the README updated: Takeout now itemizes mail, events and contacts.estimate_counts_new_objects_and_sizes_them).Verification
cargo fmt,cargo clippy --all-targets -D warnings,cargo test --locked(all 43 binaries) green.With this,
--estimatesizes imap, maildir, caldav, carddav, EWS and a full Takeout (mail + events + contacts). Remaining on the estimate line: Graph/JMAP counts-only (sizes cost an extra round-trip per item).