private void ProcessChangeSetInfo(ChangeSetInfo info)
        {
            // Find related work items
            var work_items = new List<PrimaryWorkitem>();
            foreach (string refe in info.References)
            {
                var wi = _v1.Get.PrimaryWorkitemByDisplayID(refe);
                if (wi == null) {
                    // Let's see if this is a secondary work item
                    var sec_wi = _v1.Get.SecondaryWorkitemByDisplayID(refe);
                    if (sec_wi != null) {
                        wi = sec_wi.Parent;
                    } else {
                        // We can't find it, let's just get out of here
                        return;
                    }
                }
                work_items.Add(wi);
            }

            // Find or create the changeset asset
            var cs_filter = new ChangeSetFilter();
            cs_filter.Reference.Add(info.Revision);
            var change_sets = _v1.Get.ChangeSets(cs_filter);
            string cs_name = string.Format("'{0}' on '{1}' - {2}", info.Author, TimeZone.CurrentTimeZone.ToLocalTime(info.ChangeDate), info.Message);
            string cs_ref = string.Format("{0} - {1}", info.ReposName, info.Revision);
            if (change_sets.Count == 0)
            {
                change_sets = new List<ChangeSet>();
                var cs = _v1.Create.ChangeSet(info.Message, cs_ref);
                change_sets.Add(cs);
            }

            //Update changeset asset
            foreach (ChangeSet cs in change_sets)
            {
                foreach (var wi in work_items)
                {
                    cs.PrimaryWorkitems.Add(wi);
                    cs.Name = cs_name;
                    cs.Reference = cs_ref;
                }
            }

            // Find or create the links to the work item
            var link_url = string.Format(info.ReferenceUrl, info.Revision);
            var link_name = string.Format(_linkinfo.Name, info.Revision);
            var link_filter = new LinkFilter();
            link_filter.URL.Add(link_url);
            foreach (var wi in work_items)
            {
                var links = wi.GetLinks(link_filter);
                if (links.Count > 0)
                {
                    continue;
                }
                wi.CreateLink(link_name, link_url, true);
            }
        }
        /// <summary>
        /// Associate this BuildRun with one or more ChangeSets. If there is no ChangeSet, then create one.
        /// </summary>
        /// <param name="run">This BuildRun.</param>
        /// <param name="changes">The changes as reported by CCNet.</param>
        private void SetChangeSets(BuildRun run, IEnumerable<ChangeInfo> changes) {
            foreach(ChangeInfo change in changes) {
                // See if we have this ChangeSet in the system.
                ChangeSetFilter filter = new ChangeSetFilter();
                filter.Reference.Add(change.Number.ToString());
                ICollection<ChangeSet> changeSets = Instance.Get.ChangeSets(filter);
                if(changeSets.Count == 0) {
                    // We don't have one yet. Create one.
                    string name = string.Format("{0} on {1}", change.User, change.Stamp);
                    ChangeSet changeSet = Instance.Create.ChangeSet(name, change.Number.ToString());
                    changeSet.Description = change.Comment;
                    changeSets = new List<ChangeSet>();
                    changeSets.Add(changeSet);
                    Trace("Created new ChangeSet: {0}", name);
                }

                IEnumerable<PrimaryWorkitem> workitems = DetermineWorkitems(change);

                // Associate with our new BuildRun.
                foreach(ChangeSet changeSet in changeSets) {
                    run.ChangeSets.Add(changeSet);
                    foreach(PrimaryWorkitem workitem in workitems) {
                        changeSet.PrimaryWorkitems.Add(workitem);
                        //workitem.CompletedIn.Clear();

                        List<BuildRun> toRemove = new List<BuildRun>();
                        foreach (BuildRun otherRun in workitem.CompletedIn) {
                            if (otherRun.BuildProject == run.BuildProject) {
                                toRemove.Add(otherRun);
                            }
                        }

                        foreach (BuildRun buildRun in toRemove) {
                            workitem.CompletedIn.Remove(buildRun);
                        }

                        workitem.CompletedIn.Add(run);
                        Trace("Associated ChangeSet with PrimaryWorkitem: {0}", workitem.ID);
                    }
                }
            }
        }