예제 #1
0
        internal unsafe SvnListEventArgs(
            sbyte *path,
            svn_dirent_t dirent,
            svn_lock_t @lock,
            sbyte *absPath,
            Uri repositoryRoot,
            sbyte *externalParentUrl,
            sbyte *externalTarget)
        {
            if (path == null)
            {
                throw new ArgumentNullException(nameof(path));
            }
            if (absPath == null)
            {
                throw new ArgumentNullException(nameof(absPath));
            }

            Path = SvnBase.Utf8_PtrToString(path);

            _pDirEnt             = dirent;
            _pLock               = @lock;
            _pAbsPath            = absPath;
            RepositoryRoot       = repositoryRoot;
            _external_parent_url = externalParentUrl;
            _external_target     = externalTarget;
        }
예제 #2
0
        protected internal override unsafe void Detach(bool keepProperties)
        {
            try
            {
                if (keepProperties)
                {
                    GC.KeepAlive(Path);
                    GC.KeepAlive(BasePath);
                    GC.KeepAlive(Lock);
                    GC.KeepAlive(Entry);
                    GC.KeepAlive(ExternalParent);
                    GC.KeepAlive(ExternalTarget);
                }

                _lock?.Detach(keepProperties);
                _entry?.Detach(keepProperties);
            }
            finally
            {
                _pAbsPath            = null;
                _pLock               = null;
                _pDirEnt             = null;
                _external_parent_url = null;
                _external_target     = null;

                base.Detach(keepProperties);
            }
        }
예제 #3
0
            internal StatusEnt(svn_wc_status2_t status, string localpath)
            {
                LocalFilePath     = localpath;
                TextStatus        = (svn_wc_status_kind)status.text_status;
                PropsStatus       = (svn_wc_status_kind)status.prop_status;
                Locked            = status.locked;
                Copied            = status.copied;
                Switched          = status.switched;
                RemoteTextStatus  = (svn_wc_status_kind)status.repos_text_status;
                RemotePropsStatus = (svn_wc_status_kind)status.repos_prop_status;

                if (status.to_svn_wc_entry_t == IntPtr.Zero)
                {
                    return;
                }

                svn_wc_entry_t ent = (svn_wc_entry_t)Marshal.PtrToStructure(status.to_svn_wc_entry_t, typeof(svn_wc_entry_t));

                Name               = ent.name;
                Revision           = (int)ent.revision;
                Url                = ent.url;
                Repository         = ent.repos;
                RepositoryUuid     = ent.repos_uuid;
                IsDirectory        = ent.node_kind == svn_node_kind_t.Dir;
                Schedule           = (NodeSchedule)ent.schedule;
                Copied             = ent.copied;
                Deleted            = ent.deleted;
                Absent             = ent.absent;
                Incomplete         = ent.incomplete;
                CopiedFrom         = ent.copiedfrom_url;
                CopiedFromRevision = (int)ent.copiedfrom_rev;
                ConflictOld        = ent.conflict_old;
                ConflictNew        = ent.conflict_new;
                ConflictWorking    = ent.conflict_working;
                PropertyRejectFile = ent.property_reject_file;
                TextTime           = Epoch.AddTicks(ent.text_time * 10);
                PropTime           = Epoch.AddTicks(ent.prop_time * 10);
                Checksum           = ent.checksum;
                LastCommitRevision = (int)ent.last_commit_rev;
                LastCommitDate     = Epoch.AddTicks(ent.last_commit_date * 10);
                LastCommitAuthor   = ent.last_commit_author;
                LockToken          = ent.lock_token;
                LockOwner          = ent.lock_owner;
                LockComment        = ent.lock_comment;

                if (status.repos_lock != IntPtr.Zero)
                {
                    svn_lock_t repoLock = (svn_lock_t)Marshal.PtrToStructure(status.repos_lock, typeof(svn_lock_t));
                    LockToken   = repoLock.token;
                    LockOwner   = repoLock.owner;
                    LockComment = repoLock.comment;
                    RepoLocked  = true;
                }
                if (LockToken != null)
                {
                    LockOwned  = true;
                    RepoLocked = true;
                }
            }
예제 #4
0
        internal SvnLockInfo(svn_lock_t @lock, bool localData)
        {
            if (@lock == null)
            {
                throw new ArgumentNullException(nameof(@lock));
            }

            _localData          = localData;
            _lock               = @lock;
            IsRawNetworkComment = @lock.is_dav_comment;
            CreationTime        = SvnBase.DateTimeFromAprTime(@lock.creation_date);
            ExpirationTime      = SvnBase.DateTimeFromAprTime(@lock.expiration_date);
        }
예제 #5
0
 internal void Detach(bool keepProperties)
 {
     try
     {
         if (keepProperties)
         {
             GC.KeepAlive(Path);
             GC.KeepAlive(Token);
             GC.KeepAlive(Owner);
             GC.KeepAlive(Comment);
         }
     }
     finally
     {
         _lock = null;
         //base.Detach(keepProperties);
     }
 }