示例#1
0
        protected override bool RunInternal(IRemoteClient client, RemoteCommandVerbOptions options)
        {
            LockCheckVerbOptions localOptions = options as LockCheckVerbOptions;

            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();
            }
            if (localOptions.Break)
            {
                return(client.BreakLocks(localOptions.Path, localOptions.Branch, localOptions.AllBranches, localOptions.Full));
            }
            else
            {
                return(client.ListLocks(localOptions.Path, localOptions.Branch, localOptions.AllBranches, localOptions.Full));
            }
        }