예제 #1
0
        internal void OnBeforeSolutionRenameFile(string oldName, string newName, VSQUERYRENAMEFILEFLAGS flags, out bool ok)
        {
            ok = true;
            if (!IsActive)
                return;

            //if (IsProjectFileOrSolution(oldName))
            //{
            //    // TODO: Is enlisted -> Ask user!
            //}

            using (SvnSccContext svn = new SvnSccContext(Context))
            {
                if (!svn.CouldAdd(newName, SvnNodeKind.File))
                {
                    ok = false;
                    return;
                }

                if (svn.IsUnversioned(oldName))
                    return;
            }
        }
예제 #2
0
 protected bool SvnCanAddPath(string fullpath, SvnNodeKind nodeKind)
 {
     using (SvnSccContext svn = new SvnSccContext(Context))
     {
         // Determine if we could add fullname
         if (!svn.CouldAdd(fullpath, nodeKind))
         {
             if (svn.BelowAdminDir(fullpath))
                 _batchErrors.Add(string.Format(Resources.SvnPathXBlocked, fullpath));
             else
                 _batchErrors.Add(string.Format(Resources.PathXBlocked, fullpath));
             return false;
         }
         else
             return true;
     }
 }
예제 #3
0
        /// <summary>
        /// Called just before a file in a project is renamed
        /// </summary>
        /// <param name="project">The SCC project.</param>
        /// <param name="oldName">The old name.</param>
        /// <param name="newName">The new name.</param>
        /// <param name="flags">The flags.</param>
        /// <param name="ok">if set to <c>true</c> [ok].</param>
        internal void OnBeforeProjectRenameFile(IVsSccProject2 project, string oldName, string newName, VSQUERYRENAMEFILEFLAGS flags, out bool ok)
        {
            ok = true;

            if (!_projectMap.ContainsKey(project))
                return; // Not managed by us

            if (!IsActive)
                return;

            using (SvnSccContext svn = new SvnSccContext(Context))
            {
                if (!svn.CouldAdd(newName, SvnNodeKind.File))
                {
                    ok = false;
                    return;
                }

                if (svn.IsUnversioned(oldName))
                    return;
            }
        }