2011-10-05 72 views

回答

3

假设你已经想通了如何获得回购对象,用稳定的版本,你可以这样做:

start = repo[node].rev() 
end = repo['tip'].rev() 

for r in xrange(start, end + 1): 
    ctx = repo[r] 
    print ctx.user() 

在开发分支,你可以这样做:

for ctx in repo.set('%s:tip', node): # node here must be hex, use %n for binary 
    print ctx.user() 

还要注意'node :: tip'(两个冒号)可能是'between'中更有用的定义:它包含节点的所有后代和tip的所有祖先,而不仅仅是数字排序。

最后,确保你已经了解这里使用的内部API的所有注意事项:

https://www.mercurial-scm.org/wiki/MercurialApi

...并考虑使用python-hglib代替:

https://www.mercurial-scm.org/wiki/CommandServer

+0

那么,我需要在节点(包括)之后添加的所有变更集。所以严格的数字排序实际上就是我需要的。 –

相关问题