Ah I see. You're correct in assuming that I'm looking to create a tag. However, the above steps seem to be omitting some calls to actually create the tag in .git/refs/tags or .git/packed-refs nor is it visible when I run 'git tag'. (http://git-scm.com/book/en/Git-Basics-Tagging)
If I try to to add the object to a repo object store I see the following:
>>> from dulwich.repo import Repo
>>> from dulwich.objects import Tag
>>> r = Repo(".")
>>> object_store = r.object_store
>>> tag = Tag()
>>> tag.tagger = 'rfaulk'
>>> tag.message = 'test tag 1,2.'
>>> tag.name = 'test-tag'
>>> object_store.add_object(tag)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/dulwich/object_store.py", line 610, in add_object
dir = os.path.join(self.path, obj.id[:2])
File "/Library/Python/2.7/site-packages/dulwich/objects.py", line 492, in id
return self.sha().hexdigest()
File "/Library/Python/2.7/site-packages/dulwich/objects.py", line 483, in sha
new_sha.update(self._header())
File "/Library/Python/2.7/site-packages/dulwich/objects.py", line 462, in _header
return object_header(self.type, self.raw_length())
File "/Library/Python/2.7/site-packages/dulwich/objects.py", line 467, in raw_length
for chunk in self.as_raw_chunks():
File "/Library/Python/2.7/site-packages/dulwich/objects.py", line 253, in as_raw_chunks
self._chunked_text = self._serialize()
File "/Library/Python/2.7/site-packages/dulwich/objects.py", line 654, in _serialize
chunks.append("%s %s\n" % (_OBJECT_HEADER, self._object_sha))
AttributeError: _object_sha
Ah I see. You're correct in assuming that I'm looking to create a tag. However, the above steps seem to be omitting some calls to actually create the tag in .git/refs/tags or .git/packed-refs nor is it visible when I run 'git tag'. (http:// git-scm. com/book/ en/Git- Basics- Tagging)
If I try to to add the object to a repo object store I see the following:
>>> from dulwich.repo import Repo store.add_ object( tag) Python/ 2.7/site- packages/ dulwich/ object_ store.py" , line 610, in add_object join(self. path, obj.id[:2]) Python/ 2.7/site- packages/ dulwich/ objects. py", line 492, in id ).hexdigest( ) Python/ 2.7/site- packages/ dulwich/ objects. py", line 483, in sha sha.update( self._header( )) Python/ 2.7/site- packages/ dulwich/ objects. py", line 462, in _header header( self.type, self.raw_length()) Python/ 2.7/site- packages/ dulwich/ objects. py", line 467, in raw_length raw_chunks( ): Python/ 2.7/site- packages/ dulwich/ objects. py", line 253, in as_raw_chunks _chunked_ text = self._serialize() Python/ 2.7/site- packages/ dulwich/ objects. py", line 654, in _serialize append( "%s %s\n" % (_OBJECT_HEADER, self._object_sha))
>>> from dulwich.objects import Tag
>>> r = Repo(".")
>>> object_store = r.object_store
>>> tag = Tag()
>>> tag.tagger = 'rfaulk'
>>> tag.message = 'test tag 1,2.'
>>> tag.name = 'test-tag'
>>> object_
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/
dir = os.path.
File "/Library/
return self.sha(
File "/Library/
new_
File "/Library/
return object_
File "/Library/
for chunk in self.as_
File "/Library/
self.
File "/Library/
chunks.
AttributeError: _object_sha
Am I missing something here?