# HG changeset patch # User Boris Feld # Date 2019-01-02 04:02:25 # Node ID cfd95219102de1579cbb22e813d714c004454c9a # Parent 6a63ba61e71f7a744129384a8c0b6487a6c7f552 strip: move attributes shortcut assigned earlier This series will add support for "soft" stripping using the archived phase in addition to the usual heavy weight revlog stripping. First, we need to refactor the strip function to extract logic common to the "soft-strip" case. We are about to extract bits of the strip function into separate functions. Those blocks of code contain variables for frequently accessed attributes. We move those variables outside of the soon to be moved blocks. diff --git a/mercurial/repair.py b/mercurial/repair.py --- a/mercurial/repair.py +++ b/mercurial/repair.py @@ -108,8 +108,9 @@ def strip(ui, repo, nodelist, backup=Tru repo = repo.unfiltered() repo.destroying() + vfs = repo.vfs + cl = repo.changelog - cl = repo.changelog # TODO handle undo of merge sets if isinstance(nodelist, str): nodelist = [nodelist] @@ -169,7 +170,6 @@ def strip(ui, repo, nodelist, backup=Tru # create a changegroup for all the branches we need to keep backupfile = None - vfs = repo.vfs node = nodelist[-1] if backup: backupfile = backupbundle(repo, stripbases, cl.heads(), node, topic)