Skip to content

Commit

Permalink
Hide the "ChangeList" column from file history, and use the "Revision…
Browse files Browse the repository at this point in the history
…" column to display ChangeSet values, effectively hiding the advanced internal RevisionId from the UI

Change requested by Codice Software
  • Loading branch information
SRombauts committed Nov 10, 2018
1 parent bed3bac commit ccf4df5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ bool FPlasticSourceControlProvider::UsesLocalReadOnlyState() const

bool FPlasticSourceControlProvider::UsesChangelists() const
{
return true;
return false; // We don't want to show ChangeList column anymore (Plastic SCM term would be ChangeSet)
}

bool FPlasticSourceControlProvider::UsesCheckout() const
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ bool FPlasticSourceControlRevision::Get( FString& InOutFilename ) const
{
// create the diff dir if we don't already have it (Plastic wont)
IFileManager::Get().MakeDirectory(*FPaths::DiffDir(), true);
// create a unique temp file name based on the unique commit Id
const FString TempFileName = FString::Printf(TEXT("%stemp-%d-%s"), *FPaths::DiffDir(), RevisionNumber, *FPaths::GetCleanFilename(Filename));
// create a unique temp file name based on the unique revision Id
const FString TempFileName = FString::Printf(TEXT("%stemp-%d-%s"), *FPaths::DiffDir(), RevisionId, *FPaths::GetCleanFilename(Filename));
InOutFilename = FPaths::ConvertRelativePathToFull(TempFileName);
}

Expand All @@ -37,7 +37,7 @@ bool FPlasticSourceControlRevision::Get( FString& InOutFilename ) const
else
{
// Format the revision specification of the file, like revid:1230@rep:myrep@repserver:myserver:8084
const FString RevisionSpecification = FString::Printf(TEXT("revid:%d@rep:%s@repserver:%s"), RevisionNumber, *RepositoryName, *ServerUrl);
const FString RevisionSpecification = FString::Printf(TEXT("revid:%d@rep:%s@repserver:%s"), RevisionId, *RepositoryName, *ServerUrl);
bCommandSuccessful = PlasticSourceControlUtils::RunDumpToFile(PathToPlasticBinary, RevisionSpecification, InOutFilename);
}
return bCommandSuccessful;
Expand Down Expand Up @@ -67,7 +67,7 @@ const FString& FPlasticSourceControlRevision::GetFilename() const

int32 FPlasticSourceControlRevision::GetRevisionNumber() const
{
return RevisionNumber;
return ChangesetNumber; // Using the Changelist as the Revision number to display in the Asset Diff Menu
}

const FString& FPlasticSourceControlRevision::GetRevision() const
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class FPlasticSourceControlRevision : public ISourceControlRevision, public TSha
public:
FPlasticSourceControlRevision()
: ChangesetNumber(0)
, RevisionNumber(0)
, RevisionId(0)
, Date(0)
, FileSize(0)
{
Expand Down Expand Up @@ -41,10 +41,10 @@ class FPlasticSourceControlRevision : public ISourceControlRevision, public TSha
/** The changeset number of this revision */
int32 ChangesetNumber;

/** The revision number of this file */
int32 RevisionNumber;
/** The internal revision ID of this file */
int32 RevisionId;

/** The revision to display to the user */
/** The revision to display to the user: use the changeset number */
FString Revision;

/** The description of this revision */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,7 @@ static void ParseLogResults(const FXmlFile& InXmlResult, FPlasticSourceControlRe
OutSourceControlRevision.Description = CommentNode->GetContent();
}
const FXmlNode* OwnerNode = ChangesetNode->FindChildNode(Owner);
if (CommentNode != nullptr)
if (OwnerNode != nullptr)
{
OutSourceControlRevision.UserName = OwnerNode->GetContent();
}
Expand All @@ -1274,14 +1274,14 @@ static void ParseLogResults(const FXmlFile& InXmlResult, FPlasticSourceControlRe
// Iterate on files to find the one we are tracking
for (const FXmlNode* ItemNode : ChangesNode->GetChildrenNodes())
{
int32 RevisionNumber = -1;
int32 RevisionId = -1;
const FXmlNode* RevIdNode = ItemNode->FindChildNode(RevId);
if (RevIdNode != nullptr)
{
RevisionNumber = FCString::Atoi(*RevIdNode->GetContent());
RevisionId = FCString::Atoi(*RevIdNode->GetContent());
}
// Is this about the file we are looking for?
if (RevisionNumber == OutSourceControlRevision.RevisionNumber)
if (RevisionId == OutSourceControlRevision.RevisionId)
{
const FXmlNode* DstCmPathNode = ItemNode->FindChildNode(DstCmPath);
if (DstCmPathNode != nullptr)
Expand All @@ -1295,7 +1295,7 @@ static void ParseLogResults(const FXmlFile& InXmlResult, FPlasticSourceControlRe
{
TSharedRef<FPlasticSourceControlRevision, ESPMode::ThreadSafe> MovedFromRevision = MakeShareable(new FPlasticSourceControlRevision);
MovedFromRevision->Filename = SrcCmPathNode->GetContent();
MovedFromRevision->RevisionNumber = FCString::Atoi(*ParentRevIdNode->GetContent());
MovedFromRevision->RevisionId = FCString::Atoi(*ParentRevIdNode->GetContent());

OutSourceControlRevision.BranchSource = MovedFromRevision;
}
Expand Down Expand Up @@ -1365,9 +1365,9 @@ static bool ParseHistoryResults(const TArray<FString>& InResults, TPlasticSource
const TSharedRef<FPlasticSourceControlRevision, ESPMode::ThreadSafe> SourceControlRevision = MakeShareable(new FPlasticSourceControlRevision);
const FString& Changeset = Infos[0];
const FString& RevisionId = Infos[1];
SourceControlRevision->ChangesetNumber = FCString::Atoi(*Changeset);
SourceControlRevision->RevisionNumber = FCString::Atoi(*RevisionId);
SourceControlRevision->Revision = RevisionId;
SourceControlRevision->ChangesetNumber = FCString::Atoi(*Changeset); // Value now used in the Revision column and in the Asset Menu History
SourceControlRevision->RevisionId = FCString::Atoi(*RevisionId); //
SourceControlRevision->Revision = Changeset;

// Run "cm log" on the changeset number
bResult = RunLogCommand(Changeset, *SourceControlRevision);
Expand Down

0 comments on commit ccf4df5

Please sign in to comment.