Rename set_ref -> set_symbolic_ref.
authorJelmer Vernooij <jelmer@samba.org>
Mon, 5 Apr 2010 22:57:43 +0000 (00:57 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Mon, 5 Apr 2010 22:57:43 +0000 (00:57 +0200)
NEWS
dulwich/repo.py

diff --git a/NEWS b/NEWS
index 473aa5b2bd4515561d113700e41518bb72ee82c7..2f190a6ca9b5e9a737f3344d2948cbc353812e53 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -29,6 +29,9 @@
   * Repo.get_blob, Repo.commit, Repo.tag and Repo.tree are now deprecated.
     (Jelmer Vernooij)
 
+  * RefsContainer.set_ref() was renamed to RefsContainer.set_symbolic_ref(),
+    for clarity. (Jelmer Vernooij)
+
  API CHANGES
 
   * Blob.chunked was added. (Jelmer Vernooij)
index 3442bcd751450b3af1d51caeb24649118a915a0a..26bf5d1ca349de3600406b5979e745736dee08a4 100644 (file)
@@ -118,6 +118,12 @@ class RefsContainer(object):
     """A container for refs."""
 
     def set_ref(self, name, other):
+        warnings.warn("RefsContainer.set_ref() is deprecated."
+            "Use set_symblic_ref instead.",
+            category=DeprecationWarning, stacklevel=2)
+        return self.set_symbolic_ref(name, other)
+
+    def set_symbolic_ref(self, name, other):
         """Make a ref point at another ref.
 
         :param name: Name of the ref to set
@@ -1011,7 +1017,7 @@ class Repo(BaseRepo):
         for d in BASE_DIRECTORIES:
             os.mkdir(os.path.join(path, *d))
         ret = cls(path)
-        ret.refs.set_ref("HEAD", "refs/heads/master")
+        ret.refs.set_symbolic_ref("HEAD", "refs/heads/master")
         ret._put_named_file('description', "Unnamed repository")
         ret._put_named_file('config', """[core]
     repositoryformatversion = 0