2012-03-27 4 views
1

저는 서버 측 TFS에서 일부 체크인 정책을 구현하는 프로젝트를 진행하고 있습니다. 이 일환으로, 나는 커밋되고있는 변경 집합의 역사를 얻으려고합니다. 하지만 체크인이 일어날 때, 나는 changeset 번호를 -1로 얻는다. 나는 왜 이런 일이 일어나는지 모른다. 나는 changeset 번호가 ProcessEvent 메소드가 실행 된 후에 만 ​​할당되는지 의문이다. 당신의 도움을 주셔서 감사합니다.TFS 체크인 이벤트 도용

public EventNotificationStatus ProcessEvent(TeamFoundationRequestContext requestContext, NotificationType notificationType, 
       object notificationEventArgs, out int statusCode, out string statusMessage, out ExceptionPropertyCollection properties) 
      { 
       statusCode = 0; 
       properties = null; 
       statusMessage = string.Empty; 


       if (notificationType == NotificationType.DecisionPoint) 
       { 
        try 
        { 
         if (notificationEventArgs is CheckinNotification) 
         { 
          CheckinNotification notification = notificationEventArgs as CheckinNotification; 


           int changeId = notification.Changeset;; // here I get the Changeset as -1 
         } 
        } 
       } 
      } 

답변

5

변경 집합이 커밋되기 전에 정책이 실행되기 때문에 현재 변경 집합 번호를 가져올 수 없습니다.

정책 위반시 체크 인을 거부 할 수 있도록 이렇게해야합니다. 체크인이 거부되면 변경 집합 번호가 증가하지 않아야합니다.

+0

답장을 보내 주셔서 감사합니다. – Jaleel

관련 문제