コード例 #1
0
	virtual bool Run(P4Task& task, const CommandArgs& args)
	{
		ClearStatus();
		m_ProjectPath = task.GetP4Root();
		
		ChangelistRevision cl;
		upipe >> cl;
		
		upipe.BeginList();
		
		vector<string> toks;
		if (Tokenize(toks, m_ProjectPath, "/") == 0)
		{
			upipe.ErrorLine(string("Project path invalid - ") + m_ProjectPath);
			upipe.EndList();
			upipe.ErrorLine("Invalid project path", MARemote);
			upipe.EndResponse();
			return true;
		}
		
		upipe.Log() << "Project path is " << m_ProjectPath << endl;
		
		string rev = cl == kDefaultListRevision ? string("default") : cl;
		const std::string cmd = string("describe -s ") + rev;
		
		task.CommandRun(cmd, this);
		
		// The OutputState and other callbacks will now output to stdout.
		// We just wrap up the communication here.
		upipe.EndList();
		upipe << GetStatus();
		upipe.EndResponse();
		
		return true;
	}
コード例 #2
0
	virtual bool Run(P4Task& task, const CommandArgs& args)
	{
		ClearStatus();
		m_ProjectPath = task.GetP4Root();
		m_Result.clear();

		ChangelistRevision cl;
		Pipe() >> cl;
		
		vector<string> toks;
		if (Tokenize(toks, m_ProjectPath, "/") == 0)
		{
			Pipe().BeginList();
			Pipe().WarnLine(string("Project path invalid - ") + m_ProjectPath);
			Pipe().EndList();
			Pipe().EndResponse();
			return true;
		}
		
		Pipe().Log().Debug() << "Project path is " << m_ProjectPath << unityplugin::Endl;
		
		string rev = cl == kDefaultListRevision ? string("default") : cl;
		const std::string cmd = string("describe -s ") + rev;
		
		task.CommandRun(cmd, this);
		
		if (!MapToLocal(task, m_Result))
		{
			// Abort since there was an error mapping files to depot path
			Pipe().BeginList();
			Pipe().WarnLine("Files couldn't be mapped in perforce view");
			Pipe().EndList();
			Pipe().EndResponse();
			return true;
		}

		Pipe() << m_Result;
		m_Result.clear();
		Pipe() << GetStatus();

		Pipe().EndResponse();
		
		return true;
	}