# HG changeset patch # User Martin von Zweigbergk # Date 2021-02-10 17:49:50 # Node ID cd91543431604b0fcaa601a3aa8b3c862f0d7c41 # Parent beaa233e81f7d05560b0ba454f1315fab722de26 softstrip: fix a reference to an undefined variable `backupfile` wasn't defined if no backup was requested. Let's set it to `None` by default, which matches what regular `repair.strip()` does. Differential Revision: https://phab.mercurial-scm.org/D9985 diff --git a/mercurial/repair.py b/mercurial/repair.py --- a/mercurial/repair.py +++ b/mercurial/repair.py @@ -308,6 +308,7 @@ def softstrip(ui, repo, nodelist, backup if not tostrip: return None + backupfile = None if backup: node = tostrip[0] backupfile = _createstripbackup(repo, tostrip, node, topic)