Patchwork D10874: revlog: fix a typo closing the wrong file

login
register
mail settings
Submitter phabricator
Date June 12, 2021, 4:57 a.m.
Message ID <differential-rev-PHID-DREV-pe2zcudzaaqzpna7u2qr-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49194/
State Superseded
Headers show

Comments

phabricator - June 12, 2021, 4:57 a.m.
mharbison72 created this revision.
Herald added a reviewer: indygreg.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Caught by pytype as possibly being None, but the file is closed in the previous
  conditional.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/revlog.py

CHANGE DETAILS




To: mharbison72, indygreg, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -2243,7 +2243,7 @@ 
                 if dfh is not None:
                     dfh.close()
                 if sdfh is not None:
-                    dfh.close()
+                    sdfh.close()
                 # closing the index file last to avoid exposing referent to
                 # potential unflushed data content.
                 if ifh is not None: