@@ -56,7 +56,8 @@ void ChangeList::PrepareDownload(const BranchSet& branchSet)
5656
5757 std::unique_lock<std::mutex> lock (*cl.stateMutex );
5858 cl.state = Described;
59- cl.stateCV ->notify_all (); });
59+ cl.stateCV ->notify_all ();
60+ });
6061}
6162
6263void ChangeList::StartDownloadAndLFSUpload (int nPrintBatch)
@@ -107,7 +108,8 @@ void ChangeList::StartDownloadAndLFSUpload(int nPrintBatch)
107108
108109 // Download any remaining files that were smaller in number than the total batch size.
109110 // Additionally, signal the batch processing end.
110- cl.DownloadBatch (printBatchFiles, printBatchFileData); });
111+ cl.DownloadBatch (printBatchFiles, printBatchFileData);
112+ });
111113}
112114
113115void ChangeList::DownloadBatch (std::shared_ptr<std::vector<std::string>> printBatchFiles, std::shared_ptr<std::vector<FileData*>> printBatchFileData)
@@ -118,37 +120,37 @@ void ChangeList::DownloadBatch(std::shared_ptr<std::vector<std::string>> printBa
118120 // Only perform the batch processing when there are files to process.
119121 if (!printBatchFileData->empty ())
120122 {
121- const PrintResult& printData = p4->PrintFiles (*printBatchFiles);
123+ const PrintResult& printData = p4->PrintFiles (*printBatchFiles);
122124 for (int i = 0 ; i < printBatchFiles->size (); i++)
123125 {
124- std::string filePath = P4Unescape (printBatchFileData->at (i)->GetRelativeDepotPath ());
125- // If in LFS mode, we determine whether a file is LFS-tracked, and if so, we do produce a pointer file and upload the file contents.
126- if (! lfsClient || !lfsClient->IsLFSTracked (filePath))
127- {
128- printBatchFileData->at (i)->MoveContentsOnceFrom (printData.GetPrintData ().at (i).contents );
129- }
130- else
131- {
132- const auto & fileContents = printData.GetPrintData ().at (i).contents ;
133- const std::vector<char > pointerFileContents = lfsClient->CreatePointerFileContents (fileContents);
134- Communicator::UploadResult uploadResult = lfsClient->UploadFile (fileContents);
135- switch (uploadResult)
136- {
137- case Communicator::UploadResult::Uploaded:
138- SUCCESS (" Uploaded file " << filePath << " to LFS (" << fileContents.size () << " bytes)" );
139- break ;
140- case Communicator::UploadResult::AlreadyExists:
141- SUCCESS (" File " << filePath << " already exists in LFS, skipping upload" );
142- break ;
143- case Communicator::UploadResult::Error:
144- ERR (" Failed to upload file " << filePath << " to LFS" );
145- // Not nice, but we have no other means to signal any intermediate errors from here
146- std::abort ();
147- }
148-
149- // git blob content should be a pointer file, so replace the contents
150- printBatchFileData->at (i)->MoveContentsOnceFrom (pointerFileContents);
151- }
126+ std::string filePath = P4Unescape (printBatchFileData->at (i)->GetRelativeDepotPath ());
127+ // If in LFS mode, we determine whether a file is LFS-tracked, and if so, we do produce a pointer file and upload the file contents.
128+ if (!lfsClient || !lfsClient->IsLFSTracked (filePath))
129+ {
130+ printBatchFileData->at (i)->MoveContentsOnceFrom (printData.GetPrintData ().at (i).contents );
131+ }
132+ else
133+ {
134+ const auto & fileContents = printData.GetPrintData ().at (i).contents ;
135+ const std::vector<char > pointerFileContents = lfsClient->CreatePointerFileContents (fileContents);
136+ Communicator::UploadResult uploadResult = lfsClient->UploadFile (fileContents);
137+ switch (uploadResult)
138+ {
139+ case Communicator::UploadResult::Uploaded:
140+ SUCCESS (" Uploaded file " << filePath << " to LFS (" << fileContents.size () << " bytes)" );
141+ break ;
142+ case Communicator::UploadResult::AlreadyExists:
143+ SUCCESS (" File " << filePath << " already exists in LFS, skipping upload" );
144+ break ;
145+ case Communicator::UploadResult::Error:
146+ ERR (" Failed to upload file " << filePath << " to LFS" );
147+ // Not nice, but we have no other means to signal any intermediate errors from here
148+ std::abort ();
149+ }
150+
151+ // git blob content should be a pointer file, so replace the contents
152+ printBatchFileData->at (i)->MoveContentsOnceFrom (pointerFileContents);
153+ }
152154 }
153155 }
154156
@@ -158,7 +160,8 @@ void ChangeList::DownloadBatch(std::shared_ptr<std::vector<std::string>> printBa
158160 {
159161 state = CommitReady;
160162 stateCV->notify_all ();
161- } });
163+ }
164+ });
162165}
163166
164167void ChangeList::WaitForBeingCommitReady ()
0 commit comments