def save_file(self, file_path, contents, branch_name, commit_message=None):
        """Save a file into the repo and advances the specified branch head.

        If the branch does not exist yet, it will be created.
        """
        self._perform_file_operation(
            branch_name, self._save_file, file_path, contents, commit_message)
Save a file into the repo and advances the specified branch head.

        If the branch does not exist yet, it will be created.
        
portia_server/storage/repoman.py