Exemplo n.º 1
0
        public static int Status(SvnPath path,
								 SvnOptRevision revision,
								 SvnWcStatus.Func statusFunc, IntPtr statusBaton,
								 bool descend, bool getAll, bool update, bool noIgnore,
			   					 SvnClientContext ctx, AprPool pool)
        {
            int rev;
            SvnDelegate statusDelegate = new SvnDelegate(statusFunc);
            Debug.Write(String.Format("svn_client_status({0},{1},{2},{3},{4:X},{5},{6},{7},{8},{9})...",path,revision,statusFunc.Method.Name,statusBaton.ToInt32(),descend,getAll,update,noIgnore,ctx,pool));
            SvnError err = Svn.svn_client_status(out rev, path, revision,
                                                 (Svn.svn_wc_status_func_t) statusDelegate.Wrapper,
                                                 statusBaton,
                                                 (descend ? 1 : 0), (getAll ? 1 : 0),
                                                 (update ? 1 : 0), (noIgnore ? 1 : 0),
                                                 ctx, pool);
            if( !err.IsNoError )
                throw new SvnException(err);
            Debug.WriteLine(String.Format("Done({0})",rev));
            if( update )
                return(rev);
            else
                return(-1);
        }
Exemplo n.º 2
0
 private char WcStatusChar(SvnWcStatus.Kind kind)
 {
     switch( kind )
     {
         case SvnWcStatus.Kind.None			: return ' ';
         case SvnWcStatus.Kind.Unversioned	: return '?';
         case SvnWcStatus.Kind.Normal		: return ' ';
         case SvnWcStatus.Kind.Added			: return 'A';
         case SvnWcStatus.Kind.Missing		: return '!';
         case SvnWcStatus.Kind.Deleted		: return 'D';
         case SvnWcStatus.Kind.Replaced		: return 'R';
         case SvnWcStatus.Kind.Modified		: return 'M';
         case SvnWcStatus.Kind.Merged		: return 'G';
         case SvnWcStatus.Kind.Conflicted	: return 'C';
         case SvnWcStatus.Kind.Ignored		: return 'I';
         case SvnWcStatus.Kind.Obstructed	: return '~';
         case SvnWcStatus.Kind.External		: return 'X';
         case SvnWcStatus.Kind.Incomplete	: return 'I';
     }
     return '?';
 }
Exemplo n.º 3
0
 // svn_wc_status_func_t Wrapper
 public SvnDelegate(SvnWcStatus.Func func)
 {
     mFunc = func;
     mWrapperFunc = new Svn.svn_wc_status_func_t(SvnWcStatusFuncWrapper);
 }
Exemplo n.º 4
0
        private void StatusCallback(IntPtr baton, SvnPath path, SvnWcStatus status)
        {
            if (status.IsNull
                || (oQuiet && status.Entry.IsNull)
              			|| ((status.TextStatus == SvnWcStatus.Kind.None)
              		    && (status.ReposTextStatus == SvnWcStatus.Kind.None)))
              	{
                return;
            }

            string wrkRevNum = "";
            string ciRevNum = "";
            string ciAuthor = "";
            char oodStatus = '@';

            if (oShowUpdates || oVerbose)
            {
                if( status.Entry.IsNull )
                    wrkRevNum = "";
                else if( status.Entry.Revision < 0 )
                    wrkRevNum = " ? ";
                else if( status.Copied )
                    wrkRevNum = "-";
                else
                    wrkRevNum = status.Entry.Revision.ToString();

                if( status.ReposTextStatus != SvnWcStatus.Kind.None
                    || status.ReposPropStatus != SvnWcStatus.Kind.None )
                    oodStatus = '*';
                else
                    oodStatus = ' ';

                if( oVerbose )
                {
                    if( status.Entry.IsNull )
                        ciRevNum = "";
                    else if( status.Entry.CommitRev < 0 )
                        ciRevNum = " ? ";
                    else
                        ciRevNum = status.Entry.CommitRev.ToString();

                    if( status.Entry.IsNull )
                        ciAuthor = "";
                    else if( status.Entry.CommitAuthor.IsNull )
                        ciAuthor = " ? ";
                    else
                        ciAuthor = status.Entry.CommitAuthor.ToString();
                }
            }

            if(oVerbose)
            {
                Console.WriteLine("{0}{1}{2}{3}{4}  {5}   {6,6}   {7,6:X} {8,-12} {9}",
                                  WcStatusChar(status.TextStatus),
                                  WcStatusChar(status.PropStatus),
                                  status.Locked ? 'L' : ' ',
                                  status.Copied ? '+' : ' ',
                                  status.Switched ? 'S' : ' ',
                                  oodStatus,
                                  wrkRevNum,
                                  ciRevNum,
                                  ciAuthor,
                                  path);
            }
            else if (oShowUpdates)
            {
                Console.WriteLine("{0}{1}{2}{3}{4}  {5}   {6,6}   {7}",
                                  WcStatusChar(status.TextStatus),
                                  WcStatusChar(status.PropStatus),
                                  status.Locked ? 'L' : ' ',
                                  status.Copied ? '+' : ' ',
                                  status.Switched ? 'S' : ' ',
                                  oodStatus,
                                  wrkRevNum,
                                  path);
            }
            else
            {
                Console.WriteLine("{0}{1}{2}{3}{4}  {5}",
                                  WcStatusChar(status.TextStatus),
                                  WcStatusChar(status.PropStatus),
                                  status.Locked ? 'L' : ' ',
                                  status.Copied ? '+' : ' ',
                                  status.Switched ? 'S' : ' ',
                                  path);
            }
        }
Exemplo n.º 5
0
        public int Status(string path, SvnRevision revision,
						  SvnWcStatus.Func statusFunc, IntPtr statusBaton,
						  bool descend, bool getAll, bool update, bool noIgnore)
        {
            return Status(new SvnPath(path,mPool), revision.ToSvnOpt(mPool), statusFunc, statusBaton,
                          descend, getAll, update, noIgnore, mContext, mPool);
        }