@@ -104,6 +104,8 @@ public static Synchronizer FromProjectConfiguration(ProjectFolderConfiguration p
104
104
105
105
public SyncResults SyncNow ( SyncOptions options )
106
106
{
107
+ using var activity = LibChorusActivitySource . Value . StartActivity ( ) ;
108
+
107
109
SyncResults results = new SyncResults ( ) ;
108
110
List < RepositoryAddress > sourcesToTry = options . RepositorySourcesToTry ;
109
111
// this saves us from trying to connect twice to the same repo that is, for example, not there.
@@ -156,12 +158,14 @@ public SyncResults SyncNow(SyncOptions options)
156
158
error . DoNotifications ( Repository , _progress ) ;
157
159
results . Succeeded = false ;
158
160
results . ErrorEncountered = error ;
161
+ activity ? . AddException ( error ) ;
159
162
}
160
163
catch ( UserCancelledException )
161
164
{
162
165
results . Succeeded = false ;
163
166
results . Cancelled = true ;
164
167
results . ErrorEncountered = null ;
168
+ activity ? . SetTag ( "app.chorus.sync.cancelled" , true ) ;
165
169
}
166
170
catch ( Exception error )
167
171
{
@@ -178,6 +182,7 @@ public SyncResults SyncNow(SyncOptions options)
178
182
179
183
results . Succeeded = false ;
180
184
results . ErrorEncountered = error ;
185
+ activity ? . AddException ( error ) ;
181
186
}
182
187
finally
183
188
{
@@ -245,6 +250,7 @@ public void SetIsOneOfDefaultSyncAddresses(RepositoryAddress address, bool enabl
245
250
246
251
private void SendToOthers ( HgRepository repo , List < RepositoryAddress > sourcesToTry , Dictionary < RepositoryAddress , bool > connectionAttempt )
247
252
{
253
+ using var activity = LibChorusActivitySource . Value . StartActivity ( ) ;
248
254
foreach ( RepositoryAddress address in sourcesToTry )
249
255
{
250
256
ThrowIfCancelPending ( ) ;
@@ -325,6 +331,7 @@ private void SendToOneOther(RepositoryAddress address, Dictionary<RepositoryAddr
325
331
/// <returns>true if there was at least one successful pull</returns>
326
332
private bool PullFromOthers ( HgRepository repo , List < RepositoryAddress > sourcesToTry , Dictionary < RepositoryAddress , bool > connectionAttempt )
327
333
{
334
+ using var activity = LibChorusActivitySource . Value . StartActivity ( ) ;
328
335
bool didGetFromAtLeastOneSource = false ;
329
336
foreach ( RepositoryAddress source in new List < RepositoryAddress > ( sourcesToTry ) ) // LT-18276: apparently possible to modify sourcesToTry
330
337
{
@@ -628,6 +635,7 @@ private void TryToMakeCloneForSource(RepositoryAddress repoDescriptor)
628
635
#region Merging
629
636
private void MergeHeadsOrRollbackAndThrow ( HgRepository repo , Revision workingRevBeforeSync )
630
637
{
638
+ using var activity = LibChorusActivitySource . Value . StartActivity ( ) ;
631
639
try
632
640
{
633
641
MergeHeads ( ) ;
@@ -642,6 +650,7 @@ private void MergeHeadsOrRollbackAndThrow(HgRepository repo, Revision workingRev
642
650
_progress . WriteException ( error ) ;
643
651
_progress . WriteError ( "Rolling back..." ) ;
644
652
UpdateToTheDescendantRevision ( repo , workingRevBeforeSync ) ; //rollback
653
+ activity ? . AddException ( error ) ;
645
654
throw ;
646
655
}
647
656
}
0 commit comments