Beispiel #1
0
        protected override bool RunInternal(IRemoteClient client, RemoteCommandVerbOptions options)
        {
            LockVerbOptions localOptions = options as LockVerbOptions;

            if (string.IsNullOrEmpty(localOptions.Path) && !localOptions.Full)
            {
                Printer.PrintMessage("#x#Error:## missing specification of lock path!");
            }
            if (!localOptions.Full)
            {
                string fullPath = System.IO.Path.GetFullPath(localOptions.Path);
                if (System.IO.Directory.Exists(fullPath))
                {
                    fullPath += "/";
                }
                else if (!System.IO.File.Exists(fullPath))
                {
                    Printer.PrintMessage("#w#Warning:## File #b#\"{0}\"## does not exist (yet).", localOptions.Path);
                }
                localOptions.Path = client.Workspace.GetLocalPath(fullPath);
            }
            if (string.IsNullOrEmpty(localOptions.Branch))
            {
                localOptions.Branch = client.Workspace.CurrentBranch.ID.ToString();
            }
            return(client.AcquireLock(localOptions.Path, localOptions.Branch, localOptions.AllBranches, localOptions.Full, localOptions.Steal));
        }