Changeset ccf60d4442dd…
Parent 25250c1694da…
by
Changes to 2 files · Browse files at ccf60d4442dd Showing diff from parent 25250c1694da Diff from another changeset...
@@ -32,6 +32,8 @@
* Support cloning repositories without HEAD set.
(D-Key, Jelmer Vernooij, issue #69)
+
+ * Support ``MemoryRepo.get_config``. (Jelmer Vernooij)
0.8.5 2012-03-29
|
@@ -967,16 +967,7 @@
:return: `ConfigFile` object for the ``.git/config`` file.
"""
- from dulwich.config import ConfigFile
- path = os.path.join(self._controldir, 'config')
- try:
- return ConfigFile.from_path(path)
- except (IOError, OSError), e:
- if e.errno != errno.ENOENT:
- raise
- ret = ConfigFile()
- ret.path = path
- return ret
+ raise NotImplementedError(self.get_config)
def get_config_stack(self):
"""Return a config stack for this repository.
@@ -1395,6 +1386,22 @@
return target
+ def get_config(self):
+ """Retrieve the config object.
+
+ :return: `ConfigFile` object for the ``.git/config`` file.
+ """
+ from dulwich.config import ConfigFile
+ path = os.path.join(self._controldir, 'config')
+ try:
+ return ConfigFile.from_path(path)
+ except (IOError, OSError), e:
+ if e.errno != errno.ENOENT:
+ raise
+ ret = ConfigFile()
+ ret.path = path
+ return ret
+
def __repr__(self):
return "<Repo at %r>" % self.path
@@ -1479,6 +1486,14 @@ """
raise NoIndexPresent()
+ def get_config(self):
+ """Retrieve the config object.
+
+ :return: `ConfigFile` object.
+ """
+ from dulwich.config import ConfigFile
+ return ConfigFile()
+
@classmethod
def init_bare(cls, objects, refs):
"""Create a new bare repository in memory.
|
Loading...