Exemple #1
0
        private void Delete()
        {
            ILocalSyncTable localSyncTable = new LocalSyncTable(".");
            ILocalFileSystem localFileSystem = new LocalFileSystem();

            localSyncTable.CollectRepoFiles(localFile =>
                                            _remoteSyncTable.FilterExistingFiles(localFile, missingRemoteFile =>
                                                {
                                                    missingRemoteFile = localFileSystem.EnrichWithRepoRoot(missingRemoteFile);
                                                    _ui.LogBeginOfOperation(missingRemoteFile);
                                                    missingRemoteFile = localSyncTable.DeleteEntry(missingRemoteFile);
                                                    missingRemoteFile = localFileSystem.Delete(missingRemoteFile);
                                                    _ui.LogEndOfOperation(missingRemoteFile);
                                                }));
        }
Exemple #2
0
        private void Delete()
        {
            ILocalSyncTable localSyncTable = new LocalSyncTable(".");
            ILocalFileSystem localFileSystem = new LocalFileSystem();
            IUi ui = new Ui();

            localSyncTable.CollectRepoFiles(repoFile =>
                {
                    repoFile = localFileSystem.EnrichWithRepoRoot(repoFile);
                    localFileSystem.FilterExistingFiles(repoFile, r =>
                        {
                            ui.LogBeginOfOperation(repoFile);
                            r = _remoteSyncTable.DeleteEntry(r);
                            r = _remoteFileStore.Delete(r);
                            r = localSyncTable.DeleteEntry(r);
                            ui.LogEndOfOperation(r);
                        });
                });
        }
Exemple #3
0
        private void AddOrUpdate()
        {
            ILocalFileSystem localFileSystem = new LocalFileSystem();
            ILocalSyncTable localSyncTable = new LocalSyncTable(".");

            _remoteSyncTable.CollectRepoFiles(remoteFile =>
                {
                    remoteFile = localFileSystem.EnrichWithRepoRoot(remoteFile);
                    localSyncTable.FilterUnchangedById(remoteFile, changedRemoteFile =>
                        {
                            changedRemoteFile = ResolveConflicts(changedRemoteFile);
                            _ui.LogBeginOfOperation(changedRemoteFile);
                            var result = _remoteFileStore.Download(changedRemoteFile);
                            changedRemoteFile = localFileSystem.SaveToFile(result.Item1, result.Item2);
                            localSyncTable.AddOrUpdateEntry(changedRemoteFile);
                            _ui.LogEndOfOperation(changedRemoteFile);
                        });
                });
        }