[Request] [+ ] D9030: py3: don't risk passing a None value to error.ManifestLookupError()

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Thu Sep 17 16:58:09 UTC 2020


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

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



To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20200917/9751aec9/attachment.html>


More information about the Mercurial-patches mailing list