code: def commit(self, repo_name, branch=None, parent=None, description=None):
          
          commit = self.start_commit(repo_name, branch, parent, description)
          try:
              yield commit
          except Exception as e:
              print("An exception occurred during an open commit. "
                    "Trying to finish it (Currently a commit can't be cancelled)")
              raise e
          finally:
              self.finish_commit(commit)
docs: A context manager for doing stuff inside a commit.