mercurial - 列出默认情况下变更集不稳定的用户

时间:2015-12-16 20:20:05

标签: mercurial

我希望能够输出默认提交的用户列表(或者更具体地说,书签@)尚未稳定的用户列表。要使用git执行此操作,我会这样做:

git log stable..at --format="%an" | sort | uniq

我最接近的是:

hg log -r "@ - stable" | grep user:

1 个答案:

答案 0 :(得分:3)

以下命令应该可以解决问题:

class foo(object):
    def __init__(self, x):
        self.x = x
        print "hi"
    def __enter__(self):
        return self
    def __exit__(self, exc_type, exc_val, exc_tb):
        print "bye"
        del self.x

with foo(123456789) as a:
    print a.x  # This works, because a.x still exists
# bye is printed at this point
print a.x # This fails, because we deleted the x attribute in __exit__ and the with is done
# a still exists until it goes out of scope, but it's logically "dead" and empty

hg log -r 'ancestors(@) - ancestors(stable)' -T '{author|person}\n' | sort -u -T选项允许您配置输出;有关详细信息,请参阅--template

hg help templates revset应该适用于ancestors(stable)书签和名为stable的命名分支; stable可以代替ancestors(default)来捕获整个默认分支,而不仅仅是标记ancestors(@)之后的部分。要进一步自定义作者信息(例如,仅提取电子邮件信息),请再次查看@; hg help templates将提供完整的作者信息,{author}将提供他们的电子邮件地址,{author|email}将提供电子邮件地址的本地部分等。上述{author|emailuser}将提供实名,以反映Git中{author|person}的语义。