2017-04-26 55 views
1

示例方案:檢查誰在推善變HG提交

revision #100 - user1 makes a commit on DEV branch in 2017-01-01 
revision #101 - user2 cherry picked user1's commit to master branch (hg graft -r 100) in 2017-01-02 

汞柱日誌:

changeset:101 
user: user1 
date: 2017-01-01 
summary: message 100 

changeset:100 
user: user1 
date: 2017-01-01 
summary: message 100 

但我怎麼會知道用戶2推改版#101?

+1

檢查託管存儲庫的站點的日誌。 –

回答

0

你不能(除了Lasse在他的評論中提出的建議)。

考慮:

touch a; hg add a; hg commit -m 'Add a as myself' 
touch b; hg add b; hg commit -m 'Add b as you' --user [email protected] 
hg update 0 
hg branch stable 
hg graft --user [email protected] --force 1 


hg log --graph 

@ changeset: 2:3078a4888a8a 
| branch:  stable 
| tag:   tip 
| parent:  0:f7fa0d60eaf2 
| user:  [email protected] 
| date:  Fri Apr 28 20:07:35 2017 +0200 
| summary:  Add b as you 
| 
| o changeset: 1:e12471b861d6 
|/ user:  [email protected] 
| date:  Fri Apr 28 20:07:35 2017 +0200 
| summary:  Add b as you 
| 
o changeset: 0:f7fa0d60eaf2 
    user:  This Is Me [email protected] 
    date:  Fri Apr 28 20:06:42 2017 +0200 
    summary:  Add a as myself 

如果你想想看,這是比什麼是顯得不那麼令人震驚(我不是說這不是一個問題,你介意)。

Mercurial有一個extension to perform PGP signatures這可能會有所幫助,但事實並非如此,需要一定的設置。

要有詳細的解釋,看看CommitSigningPlan,雖然我不知道狀態。

據我所知,monotone是一個分佈式VCS系統,旨在解決這類問題,我不確定它是否還在開發中。我想完成一個哲學觀察:如果一個項目必須保護自己免受這種問題的困擾(一個授權的開發人員冒充另一個人),那麼也許該項目有其他問題...再次,這並不意味着驗證提交併不重要。