store: raise ProgrammingError if unable to decode a storage path
authorPulkit Goyal <pulkit@yandex-team.ru>
Tue, 13 Nov 2018 18:44:09 +0300
changeset 40624 66adfd58cb77
parent 40623 7c5a922be068
child 40625 39369475445c
store: raise ProgrammingError if unable to decode a storage path Right now, the function magically return False which is dangerous, so let's raise ProgrammingError. Suggested by Augie in D5139. Differential Revision: https://phab.mercurial-scm.org/D5264
mercurial/store.py
--- a/mercurial/store.py	Tue Nov 13 23:54:23 2018 -0500
+++ b/mercurial/store.py	Tue Nov 13 18:44:09 2018 +0300
@@ -38,6 +38,8 @@
     elif path.startswith('meta/'):
         return matcher.visitdir(path[len('meta/'):-len('/00manifest.i')] or '.')
 
+    raise error.ProgrammingError("cannot decode path %s" % path)
+
 # This avoids a collision between a file named foo and a dir named
 # foo.i or foo.d
 def _encodedir(path):