Пример #1
0
        public void GetStatus()
        {
            pf = MAConf.instance.Configs[ap.ProductId];

            System.Collections.ObjectModel.Collection<SharpSvn.SvnStatusEventArgs> ss;
            SharpSvn.SvnStatusArgs sarg = new SharpSvn.SvnStatusArgs();
            sclient = new SharpSvn.SvnClient();
            ld = new List<string>();
            lver = new Dictionary<string, string>();
            lpath = new Dictionary<string, Dictionary<string, bool>>();
            lstatus = new Dictionary<string, Dictionary<string, SharpSvn.SvnStatus>>();
            Dictionary<string, bool> tpath; // 临时变量
            Dictionary<string, SharpSvn.SvnStatus> tstatus; // 临时变量
            string ext;

            foreach (CommitCom c in ap.ComComms)
            {
                // 对于无变动和要删除的,不需要再生成SAW库信息;对于小包,不需要生成 SAW库信息
                if (c.cstatus == ComStatus.NoChange || c.cstatus == ComStatus.Delete || c.ctype == ComType.Ssql)
                    continue;

                if (!ld.Contains(c.sawfile.LocalPath))
                {
                    ld.Add(c.sawfile.LocalPath);
                    lver.Add(c.sawfile.LocalPath, c.cver);
                }
            }

            foreach (string s in pf.CommitPublic)
            {
                if (!ld.Contains(s))
                {
                    ld.Add(System.IO.Path.Combine(pf.WorkSpace, s));
                    lver.Add(System.IO.Path.Combine(pf.WorkSpace, s), pf.logmessage);
                }
            }

            foreach (string k in ld)
            {
                try
                {
                    sarg.Depth = SharpSvn.SvnDepth.Infinity;
                    sclient.GetStatus(k, sarg, out ss);

                    if (ss.Count > 0)
                    {
                        tpath = new Dictionary<string, bool>();
                        tstatus = new Dictionary<string, SharpSvn.SvnStatus>();
                        foreach (SharpSvn.SvnStatusEventArgs s in ss)
                        {
                            if (s.LocalContentStatus == SharpSvn.SvnStatus.NotVersioned)
                            {
                                ext = System.IO.Path.GetExtension(s.Path).ToLower();
                                if (ext == ".dcu" || ext == ".~pas" || ext == ".~dfm")
                                    log.WriteLog("[NotVersioned] " + s.Path, LogLevel.FileLog);
                                else
                                    log.WriteLog("[NotVersioned] " + s.Path);

                                continue;
                            }
                            if (s.LocalContentStatus == SharpSvn.SvnStatus.Normal)
                                continue;

                            tpath.Add(s.Path, true);
                            tstatus.Add(s.Path, s.LocalContentStatus);
                        }

                        // 都是 Not Versioned 不需处理
                        if (tpath.Count > 0)
                        {
                            lpath.Add(k, tpath);
                            lstatus.Add(k, tstatus);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MAConf.instance.WriteLog("获取状态失败" + ex.Message, LogLevel.Error);
                }
            }
        }
Пример #2
0
        public void GetStatus()
        {
            pf = MAConf.instance.Configs[ap.ProductId];

            System.Collections.ObjectModel.Collection <SharpSvn.SvnStatusEventArgs> ss;
            SharpSvn.SvnStatusArgs sarg = new SharpSvn.SvnStatusArgs();
            sclient = new SharpSvn.SvnClient();
            ld      = new List <string>();
            lver    = new Dictionary <string, string>();
            lpath   = new Dictionary <string, Dictionary <string, bool> >();
            lstatus = new Dictionary <string, Dictionary <string, SharpSvn.SvnStatus> >();
            Dictionary <string, bool> tpath;                 // 临时变量
            Dictionary <string, SharpSvn.SvnStatus> tstatus; // 临时变量
            string ext;

            foreach (CommitCom c in ap.ComComms)
            {
                // 对于无变动和要删除的,不需要再生成SAW库信息;对于小包,不需要生成 SAW库信息
                if (c.cstatus == ComStatus.NoChange || c.cstatus == ComStatus.Delete || c.ctype == ComType.Ssql)
                {
                    continue;
                }

                if (!ld.Contains(c.sawfile.LocalPath))
                {
                    ld.Add(c.sawfile.LocalPath);
                    lver.Add(c.sawfile.LocalPath, c.cver);
                }
            }

            foreach (string s in pf.CommitPublic)
            {
                if (!ld.Contains(s))
                {
                    ld.Add(System.IO.Path.Combine(pf.WorkSpace, s));
                    lver.Add(System.IO.Path.Combine(pf.WorkSpace, s), pf.logmessage);
                }
            }

            foreach (string k in ld)
            {
                try
                {
                    sarg.Depth = SharpSvn.SvnDepth.Infinity;
                    sclient.GetStatus(k, sarg, out ss);

                    if (ss.Count > 0)
                    {
                        tpath   = new Dictionary <string, bool>();
                        tstatus = new Dictionary <string, SharpSvn.SvnStatus>();
                        foreach (SharpSvn.SvnStatusEventArgs s in ss)
                        {
                            if (s.LocalContentStatus == SharpSvn.SvnStatus.NotVersioned)
                            {
                                ext = System.IO.Path.GetExtension(s.Path).ToLower();
                                if (ext == ".dcu" || ext == ".~pas" || ext == ".~dfm")
                                {
                                    log.WriteLog("[NotVersioned] " + s.Path, LogLevel.FileLog);
                                }
                                else
                                {
                                    log.WriteLog("[NotVersioned] " + s.Path);
                                }

                                continue;
                            }
                            if (s.LocalContentStatus == SharpSvn.SvnStatus.Normal)
                            {
                                continue;
                            }

                            tpath.Add(s.Path, true);
                            tstatus.Add(s.Path, s.LocalContentStatus);
                        }

                        // 都是 Not Versioned 不需处理
                        if (tpath.Count > 0)
                        {
                            lpath.Add(k, tpath);
                            lstatus.Add(k, tstatus);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MAConf.instance.WriteLog("获取状态失败" + ex.Message, LogLevel.Error);
                }
            }
        }