Patchwork D9030: py3: don't risk passing a None value to error.ManifestLookupError()

login
register
mail settings
Submitter phabricator
Date Sept. 17, 2020, 4:58 p.m.
Message ID <differential-rev-PHID-DREV-tqbdzph7todvneai2h5y-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47191/
State Superseded
Headers show

Comments

phabricator - Sept. 17, 2020, 4:58 p.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This makes the test case added in 20dd2a259b0f <https://phab.mercurial-scm.org/rHG20dd2a259b0f5130b7bd4dcd58f84cbe0113756c> (test-grep: add tests
  for --follow with/without --diff and/or paths, 2020-09-11) pass on
  Python 3.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/context.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -271,7 +271,7 @@ 
                 return self._manifest.find(path)
             except KeyError:
                 raise error.ManifestLookupError(
-                    self._node, path, _(b'not found in manifest')
+                    self._node or b'None', path, _(b'not found in manifest')
                 )
         if '_manifestdelta' in self.__dict__ or path in self.files():
             if path in self._manifestdelta:
@@ -284,7 +284,7 @@ 
             node, flag = mfl[self._changeset.manifest].find(path)
         except KeyError:
             raise error.ManifestLookupError(
-                self._node, path, _(b'not found in manifest')
+                self._node or b'None', path, _(b'not found in manifest')
             )
 
         return node, flag