Page MenuHomePhabricator

infinitepush: run at most one backup per hg command
ClosedPublic

Authored by stash on Sep 11 2017, 12:11 PM.

Details

Reviewers
durham
Group Reviewers
Restricted Project
Commits
rFBHGXbf3d1c4135ba: infinitepush: run at most one backup per hg command
Summary

Previously we ran auto backups in txnclose hook. But commands like histedit and
rebase create many transactions, and that means that lots of backup processes
are started at the same time. That means that sometimes backup processes use
too much memory.

Instead let's start it once per command if any transaction was opened
during the command.

Test Plan

Run unit-test.
Run histedit with autobackup enabled, and make sure just one backup process
was started.

Diff Detail

Repository
rFBHGX Facebook Mercurial Extensions
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

stash created this revision.Sep 11 2017, 12:11 PM
durham accepted this revision.Sep 11 2017, 1:43 PM
durham added a subscriber: durham.

The unit tests don't seem to cover the fact that only one process should be spawned. Should they do an operation with several transactions (like a stack rebase), and check the log file for multiple backup runs?

This revision is now accepted and ready to land.Sep 11 2017, 1:43 PM
stash updated this revision to Diff 1923.Sep 20 2017, 10:25 AM

Addressed comments

This revision was automatically updated to reflect the committed changes.