Revision 4147814e trunk/Pithos.Core/FileState.cs

b/trunk/Pithos.Core/FileState.cs
420 420
        }
421 421

  
422 422
        /// <summary>
423
        /// Remove all FileState rows from the database whose path
423
        /// Mark Unversioned all FileState rows from the database whose path
424 424
        /// starts with one of the removed paths
425 425
        /// </summary>
426 426
        /// <param name="removed"></param>
427
        public static void RemovePaths(List<string> removed)
427
        public static void UnversionPaths(List<string> removed)
428 428
        {
429 429
            if (removed == null)
430 430
                return;
......
442 442

  
443 443
            //Generate a query from the disjunction
444 444
            var query=QueryOver.Of<FileState>().Where(disjunction);
445
            //Adn retrieveonly the IDs
446
            var idQuery = new ProjectionQuery<FileState,Guid>(query.DetachedCriteria,
447
                Projections.ProjectionList()
448
                .Add(Projections.Id()));
449
            
450
            var ids=idQuery.Execute();
451
            DeleteAll(ids);
452
                
445
                        
446
            ExecuteWithRetry((session,instance)=>
447
                                 {
448
                                     using (var t=session.BeginTransaction())
449
                                     {
450
                                         var states = query.GetExecutableQueryOver(session).List();
451
                                         foreach (var state in states)
452
                                         {
453
                                             state.FileStatus = FileStatus.Unversioned;
454
                                             state.OverlayStatus = FileOverlayStatus.Unversioned;
455
                                             state.Update();
456
                                         }
457
                                         t.Commit();
458
                                     }
459
                                     return null;
460
                                 },null);
453 461
        }
462

  
454 463
    }
455 464

  
456 465
    [ActiveRecord("Tags")]

Also available in: Unified diff