D5264: store: raise ProgrammingError if unable to decode a storage path

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Tue Nov 13 15:49:22 UTC 2018


pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Right now, the function magically return False which is dangerous, so let's
  raise ProgrammingError.
  
  Suggested by Augie in https://phab.mercurial-scm.org/D5139.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/store.py

CHANGE DETAILS

diff --git a/mercurial/store.py b/mercurial/store.py
--- a/mercurial/store.py
+++ b/mercurial/store.py
@@ -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):



To: pulkit, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list