Пример #1
0
 internal void Detach(bool keepProperties)
 {
     try
     {
         if (keepProperties)
         {
             GC.KeepAlive(Name);
             GC.KeepAlive(Uri);
             GC.KeepAlive(RepositoryUri);
             GC.KeepAlive(RepositoryId);
             GC.KeepAlive(CopiedFrom);
             GC.KeepAlive(ConflictOldFile);
             GC.KeepAlive(ConflictNewFile);
             GC.KeepAlive(ConflictWorkFile);
             GC.KeepAlive(PropertyRejectFile);
             GC.KeepAlive(Checksum);
             GC.KeepAlive(LastChangeAuthor);
             GC.KeepAlive(LockToken);
             GC.KeepAlive(LockOwner);
             GC.KeepAlive(LockComment);
             GC.KeepAlive(ChangeList);
             GC.KeepAlive(FileExternalPath);
             GC.KeepAlive(FileExternalRevision);
             GC.KeepAlive(FileExternalOperationalRevision);
         }
     }
     finally
     {
         _client = null;
         _status = null;
         _entry  = null;
         _pool   = null;
     }
 }
Пример #2
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;
                }
            }
Пример #3
0
        internal unsafe void Ensure()
        {
            if (_ensured || _status == null)
            {
                return;
            }

            _ensured = true;

            svn_wc_status2_t.__Internal *status2;

            var error = libsvnsharp_wc_private.svn_wc__status2_from_3(
                (void **)&status2,
                svn_wc_status3_t.__CreateInstance(_status.backwards_compatibility_baton),
                _client.CtxHandle.wc_ctx,
                _status.local_abspath,
                _pool.Handle,
                _pool.Handle);

            if (error != null)
            {
                throw SvnException.Create(error);
            }

            var entry = svn_wc_entry_t.__CreateInstance(status2->entry);

            _entry = entry;

            _revision           = entry.revision;
            _nodeKind           = (SvnNodeKind)entry.kind;
            _schedule           = (SvnSchedule)entry.schedule;
            _copied             = entry.copied;
            _deleted            = entry.deleted;
            _absent             = entry.absent;
            _incomplete         = entry.incomplete;
            _copyFromRev        = entry.copyfrom_rev;
            _textTime           = SvnBase.DateTimeFromAprTime(entry.text_time);
            _lastChangeRev      = entry.cmt_rev;
            _lastChangeTime     = SvnBase.DateTimeFromAprTime(entry.cmt_date);
            _lockTime           = SvnBase.DateTimeFromAprTime(entry.lock_creation_date);
            _hasProperties      = entry.has_props;
            _hasPropertyChanges = entry.has_prop_mods;
            _wcSize             = entry.working_size;
            _keepLocal          = entry.keep_local;
            _depth = (SvnDepth)entry.depth;
        }
Пример #4
0
 private SvnWcEntry(svn_wc_entry_t *ptr)
 {
     mEntry = ptr;
 }