From e31089bf56ec773b65c7ff873d2403e79af86585 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20Veres-Szentkir=C3=A1lyi?= Date: Wed, 13 Jun 2012 11:20:46 +0200 Subject: [PATCH] documented `create_commit` in README --- README.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.rst b/README.rst index fb8b37c..f8b7b4c 100644 --- a/README.rst +++ b/README.rst @@ -142,6 +142,25 @@ This is their interface:: Signature.offset -- offset from utc in minutes +Creating commits +................ + +Commits can be created by calling the ``create_commit`` method of the +repository with the following parameters:: + + >>> from time import time + >>> author = Signature('Alice Author', 'alice@authors.tld', time(), 0) + >>> committer = Signature('Cecil Committer', 'cecil@committers.tld', time(), 0) + >>> tree = repo.TreeBuilder().write() + >>> repo.create_commit( + ... 'refs/heads/master', # the name of the reference to update + ... author, committer, 'one line commit message\n\ndetailed commit message', + ... tree, # binary string representing the tree object ID + ... [] # list of binary strings representing parents of the new commit + ... ) + '#\xe4