Patchwork D9985: softstrip: fix a reference to an undefined variable

login
register
mail settings
Submitter phabricator
Date Feb. 11, 2021, 10:37 p.m.
Message ID <differential-rev-PHID-DREV-7jbsvnk5o72hpqobwodz-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48300/
State Superseded
Headers show

Comments

phabricator - Feb. 11, 2021, 10:37 p.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  `backupfile` wasn't defined if no backup was requested. Let's set it
  to `None` by default, which matches what regular `repair.strip()`
  does.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9985

AFFECTED FILES
  mercurial/repair.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/repair.py b/mercurial/repair.py
--- a/mercurial/repair.py
+++ b/mercurial/repair.py
@@ -308,6 +308,7 @@ 
     if not tostrip:
         return None
 
+    backupfile = None
     if backup:
         node = tostrip[0]
         backupfile = _createstripbackup(repo, tostrip, node, topic)