2013-10-02 64 views
0

我有一些用戶可以克隆版本庫,但我需要他們只能看到一些分支。Mercurial:在我的mercurial項目中只克隆版本庫的一個分支

例如,他們只能看到「stable」分支,所以我可以肯定他們不會嘗試不穩定的代碼。 或者客戶X只能看到他的定製分支。

我知道我可以提取發佈的源代碼並提供給他們。但由於「非技術性」原因,他們希望訪問存儲庫。

可能嗎?

感謝, 馬里奧

回答

3

可以使用ACL extension,在其中定義[acl.deny.branches][acl.allow.branches]

下面的示例配置取自ACL文檔頁面。

[hooks] 

    # Use this if you want to check access restrictions at commit time 
    pretxncommit.acl = python:hgext.acl.hook 

    # Use this if you want to check access restrictions for pull, push, 
    # bundle and serve. 
    pretxnchangegroup.acl = python:hgext.acl.hook 

    [acl] 
    # Check whether the source of incoming changes is in this list where 
    # "serve" == ssh or http, and "push", "pull" and "bundle" are the 
    # corresponding hg commands. 
    sources = serve 

    [acl.groups] 
    # If a group name is not defined here, and Mercurial is running under 
    # a Unix-like system, the list of users will be taken from the OS. 
    # Otherwise, an exception will be raised. 
    designers = user1, user2 

    [acl.deny.branches] 

    # Everyone is denied to the frozen branch: 
    frozen-branch = * 

    # A bad user is denied on all branches: 
    * = bad-user 

    [acl.allow.branches] 

    # A few users are allowed on branch-a: 
    branch-a = user-1, user-2, user-3 

    # Only one user is allowed on branch-b: 
    branch-b = user-1 

    # The super user is allowed on any branch: 
    * = super-user 

    # Everyone is allowed on branch-for-tests: 
    branch-for-tests = * 
相關問題