# Add objects to the repo store instance object_store = _repo.object_store object_store.add_object(blob) object_store.add_object(tree) object_store.add_object(commit) _repo.refs['refs/heads/' + master_branch] = commit.id
# Build the tag object and tag
tag = Tag()
tag.tagger = author
tag.message = message
tag.name = tag
tag.object = (Commit, commit.id) tag.tag_time = commit.author_time tag.tag_timezone = tz object_store.add_object(tag) _repo['refs/tags/' + tag] = tag.id
This doesn't seem to be included in the documentation. I'm wondering, would it be helpful to you if I added this to the tutorial docs then sent a pull request to jelmer/dulwich?
Thanks Jelmer, the feedback was very helpful.
I ended up creating tags by doing the following:
# Open the repo config[ 'top_dir' ])
master_ branch = 'master'
_repo = Repo(self.
# Build the commit object string( "empty" )
tree.add( tag, 0100644, blob.id)
blob = Blob.from_
tree = Tree()
commit = Commit()
commit. author = commit.committer = author
commit. commit_ time = commit.author_time = int(time()) '-0200' )[0]
commit. commit_ timezone = commit. author_ timezone = tz
commit. encoding = "UTF-8"
commit. message = 'Tagging repo for deploy: ' + message
commit.tree = tree.id
tz = parse_timezone(
# Add objects to the repo store instance
object_ store = _repo.object_store
object_ store.add_ object( blob)
object_ store.add_ object( tree)
object_ store.add_ object( commit)
_repo. refs['refs/ heads/' + master_branch] = commit.id
# Build the tag object and tag
tag.tag_ time = commit.author_time
tag.tag_ timezone = tz
object_ store.add_ object( tag)
_repo[ 'refs/tags/ ' + tag] = tag.id
tag = Tag()
tag.tagger = author
tag.message = message
tag.name = tag
tag.object = (Commit, commit.id)
This doesn't seem to be included in the documentation. I'm wondering, would it be helpful to you if I added this to the tutorial docs then sent a pull request to jelmer/dulwich?