softstrip: fix a reference to an undefined variable
authorMartin von Zweigbergk <martinvonz@google.com>
Wed, 10 Feb 2021 09:49:50 -0800
changeset 46515 cd9154343160
parent 46514 beaa233e81f7
child 46516 921e1253c8ba
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
mercurial/repair.py
--- a/mercurial/repair.py	Wed Feb 10 09:45:48 2021 -0800
+++ b/mercurial/repair.py	Wed Feb 10 09:49:50 2021 -0800
@@ -308,6 +308,7 @@
     if not tostrip:
         return None
 
+    backupfile = None
     if backup:
         node = tostrip[0]
         backupfile = _createstripbackup(repo, tostrip, node, topic)