def update(repo_path, force = False, branch = 'master', infofile_filepath = Helper2.get_data_filepath('infofile'), release_notes_dirpath = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'release_notes')): helper = Helper2(repo_path = repo_path) remote_sha = helper.remote_head_sha(dst_branch = branch) local_sha = helper.local_sha(branch = branch) if remote_sha == local_sha: print "Up to date" else: if helper.uncommited_changes(): print "An update is available but there are uncommited changes in " + repo_path sys.exit(-1) if force or _prompt("An update is available. Update now?"): helper.checkout(branch) helper.merge(remote_sha) _update_happened(infofile_filepath, release_notes_dirpath) print "Updated"