Patchwork [1,of,2] context: catch FilteredRepoLookupError instead of RepoLookupError

login
register
mail settings
Submitter Pierre-Yves David
Date Dec. 30, 2014, 4:03 a.m.
Message ID <44f97ee76cb556e6357d.1419912224@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/7261/
State Accepted
Commit 8f32dcfbc338fc0a1960c31655d56eeccffc7c32
Headers show

Comments

Pierre-Yves David - Dec. 30, 2014, 4:03 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1419383631 28800
#      Tue Dec 23 17:13:51 2014 -0800
# Node ID 44f97ee76cb556e6357d8638c660954c3088bd37
# Parent  14ac0c1579cdc55763facfc81e8abffc63464c5f
context: catch FilteredRepoLookupError instead of RepoLookupError

Now that we have a more specialised exception, lets use it when we meant to
catch the more specialised case.

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -893,11 +893,11 @@  class filectx(basefilectx):
 
     @propertycache
     def _changectx(self):
         try:
             return changectx(self._repo, self._changeid)
-        except error.RepoLookupError:
+        except error.FilteredRepoLookupError:
             # Linkrev may point to any revision in the repository.  When the
             # repository is filtered this may lead to `filectx` trying to build
             # `changectx` for filtered revision. In such case we fallback to
             # creating `changectx` on the unfiltered version of the reposition.
             # This fallback should not be an issue because `changectx` from