Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试bzr post-commit为我的私人 bugtracker 编写一个钩子,但我被困在函数签名上
bzr post-commit
post_commit(local, master, old_revno, old_revid, new_revno, mew_revid)
如何使用bzrlibin从中提取分支的提交消息Python?
bzrlib
Python
答案是这样的:
def check_commit_msg(local, master, old_revno, old_revid, new_revno, new_revid): branch = local or master revision = branch.repository.get_revision(new_revid) print revision.message
local 和 master 是 Branch 对象,因此一旦有了修订,就很容易提取消息。