Exemple #1
0
        public override bool UnLock(string Path, ref string error)
        {
            if (client == null)
            {
                Init();
            }
            bool result = false;

            try
            {
                Collection <SvnListEventArgs> ListEventArgs;
                Uri targetUri = GetRemoteUriFromPath(Path, out ListEventArgs);

                if (ListEventArgs != null && ListEventArgs[0].Lock != null && ListEventArgs[0].Lock.Owner != SourceControlUser)
                {
                    if ((Reporter.ToUser(eUserMsgKeys.SourceControlFileLockedByAnotherUser, Path, ListEventArgs[0].Lock.Owner, ListEventArgs[0].Lock.Comment) == MessageBoxResult.Yes))
                    {
                        SvnUnlockArgs args = new SvnUnlockArgs();
                        args.BreakLock = true;
                        result         = client.RemoteUnlock(targetUri, args);
                    }
                    else
                    {
                        return(false);
                    }
                }
                else if (ListEventArgs != null && ListEventArgs[0].Lock != null && ListEventArgs[0].Lock.Owner == SourceControlUser)
                {
                    result = client.RemoteUnlock(targetUri);
                }
                else
                {
                    error = "Cannot Unlock Unlocked File";
                    return(false);
                }
            }
            catch (Exception e)
            {
                error = e.Message + Environment.NewLine + e.InnerException;
                return(false);
            }
            return(result);
        }
		public override void Unlock (IProgressMonitor monitor, bool breakLock, params FilePath[] paths)
		{
			SvnUnlockArgs args = new SvnUnlockArgs ();
			BindMonitor (args, monitor);
			args.BreakLock = breakLock;
			lock (client) 
				client.Unlock (paths.ToStringArray (), args);
		}
Exemple #3
0
		public override void Unlock (ProgressMonitor monitor, bool breakLock, params FilePath[] paths)
		{
			var args = new SvnUnlockArgs {
				BreakLock = breakLock,
			};
			BindMonitor (monitor);
			lock (client) 
				client.Unlock (paths.ToStringArray (), args);
		}