瀏覽代碼

Remove put_named_file from public API

Jelmer Vernooij 15 年之前
父節點
當前提交
cb066cfe6c
共有 1 個文件被更改,包括 4 次插入17 次删除
  1. 4 17
      dulwich/repo.py

+ 4 - 17
dulwich/repo.py

@@ -593,19 +593,6 @@ class BaseRepo(object):
         """
         raise NotImplementedError(self.get_named_file)
 
-    def put_named_file(self, relpath, contents):
-        """Write a file in the control directory with specified name and 
-        contents.
-
-        Although the filename should be interpreted as a filename relative to
-        the control dir in a disk-baked Repo, the object returned need not be
-        pointing to a file in that location.
-
-        :param path: The path to the file, relative to the control dir.
-        :param contents: Contents of the new file
-        """
-        raise NotImplementedError(self.put_named_file)
-
     def open_index(self):
         """Open the index for this repository.
         
@@ -823,7 +810,7 @@ class Repo(BaseRepo):
         """Return the path of the control directory."""
         return self._controldir
 
-    def put_named_file(self, path, contents):
+    def _put_named_file(self, path, contents):
         """Write a file from the control dir with a specific name and contents.
         """
         f = GitFile(os.path.join(self.controldir(), path), 'wb')
@@ -880,14 +867,14 @@ class Repo(BaseRepo):
             os.mkdir(os.path.join(path, *d))
         ret = cls(path)
         ret.refs.set_ref("HEAD", "refs/heads/master")
-        ret.put_named_file('description', "Unnamed repository")
-        ret.put_named_file('config', """[core]
+        ret._put_named_file('description', "Unnamed repository")
+        ret._put_named_file('config', """[core]
     repositoryformatversion = 0
     filemode = true
     bare = false
     logallrefupdates = true
 """)
-        ret.put_named_file(os.path.join('info', 'excludes'), '')
+        ret._put_named_file(os.path.join('info', 'excludes'), '')
         return ret
 
     create = init_bare