diff mercurial/statichttprepo.py @ 3851:8f18e31c4441

add "requires" file to the repo, specifying the requirements
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Sun, 10 Dec 2006 00:06:59 +0100
parents 630caaf29815
children c0b449154a90
line wrap: on
line diff
--- a/mercurial/statichttprepo.py	Sun Dec 10 00:06:45 2006 +0100
+++ b/mercurial/statichttprepo.py	Sun Dec 10 00:06:59 2006 +0100
@@ -37,7 +37,20 @@
         self.ui = ui
         self.revlogversion = 0
         self.opener = opener(self.path)
+        # find requirements
+        try:
+            requirements = self.opener("requires").read().splitlines()
+        except IOError:
+            requirements = []
+        # check them
+        for r in requirements:
+            if r not in self.supported:
+                raise repo.RepoError(_("requirement '%s' not supported") % r)
+
+        # setup store
+        self.spath = self.path
         self.sopener = opener(self.spath)
+
         self.manifest = manifest.manifest(self.sopener)
         self.changelog = changelog.changelog(self.sopener)
         self.tagscache = None