Exemple #1
0
		// Get status for a single file (non recursive).
		// Will return valid status even if the file has nothing to show (has no changes).
		// If error happened, invalid status data will be returned (check statusData.IsValid).
		public static SVNAsyncOperation<SVNStatusData> GetStatusAsync(string path, bool offline, bool fetchLockDetails = true, int timeout = COMMAND_TIMEOUT)
		{
			// If default timeout, give some more time for online operations, just in case.
			if (timeout == COMMAND_TIMEOUT && !offline) {
				timeout *= 2;
			}

			var options = new SVNStatusDataOptions() {
				Depth = SVNStatusDataOptions.SearchDepth.Empty,
				Timeout = timeout,
				RaiseError = false,
				Offline = offline,
				FetchLockOwner = fetchLockDetails,  // If offline, this is ignored.
			};

			return SVNAsyncOperation<SVNStatusData>.Start(op => {

				var statusData = GetStatuses(path, options).FirstOrDefault();

				// If no path was found, error happened.
				if (!statusData.IsValid) {
					// Fallback to unversioned as we don't touch them.
					statusData.Status = VCFileStatus.Unversioned;
				}

				return statusData;
			});
		}
        public static SVNAsyncOperation <TResult> Start(OperationHandler operationHandler)
        {
            var op = new SVNAsyncOperation <TResult>(operationHandler);

            op.Start();
            return(op);
        }
Exemple #3
0
		// Get statuses of files based on the options you provide.
		// NOTE: data is returned ONLY for folders / files that has something to show (has changes, locks or remote changes).
		//		 If used with non-recursive option it will return single data with normal status (if non).
		public static SVNAsyncOperation<IEnumerable<SVNStatusData>> GetStatusesAsync(string path, bool recursive, bool offline, bool fetchLockDetails = true, int timeout = COMMAND_TIMEOUT)
		{
			// If default timeout, give some more time for online operations, just in case.
			if (timeout == COMMAND_TIMEOUT && !offline) {
				timeout *= 2;
			}

			var options = new SVNStatusDataOptions() {
				Depth = recursive ? SVNStatusDataOptions.SearchDepth.Infinity : SVNStatusDataOptions.SearchDepth.Empty,
				Timeout = timeout,
				RaiseError = false,
				Offline = offline,
				FetchLockOwner = fetchLockDetails,  // If offline, this is ignored.
			};

			return SVNAsyncOperation<IEnumerable<SVNStatusData>>.Start(op => GetStatuses(path, options));
		}
Exemple #4
0
		// Get statuses of files based on the options you provide.
		// NOTE: data is returned ONLY for folders / files that has something to show (has changes, locks or remote changes).
		//		 If used with non-recursive option it will return single data with normal status (if non).
		public static SVNAsyncOperation<IEnumerable<SVNStatusData>> GetStatusesAsync(string path, SVNStatusDataOptions options)
		{
			return SVNAsyncOperation<IEnumerable<SVNStatusData>>.Start(op => GetStatuses(path, options));
		}
Exemple #5
0
		// Commit files to SVN directly (without GUI).
		// If you plan to commit large files, you might want to tweak the timeout argument.
		// On commit all included locks will be unlocked unless specified not to by the keepLocks param.
		public static SVNAsyncOperation<CommitOperationResult> CommitAsync(IEnumerable<string> assetPaths, bool includeMeta, bool recursive, string message, string encoding = "", bool keepLocks = false, int timeout = COMMAND_TIMEOUT * 10)
		{
			return SVNAsyncOperation<CommitOperationResult>.Start(op => Commit(assetPaths, includeMeta, recursive, message, encoding, keepLocks, timeout));
		}
Exemple #6
0
		// Update file or folder in SVN directly (without GUI).
		// If you plan to update large files, you might want to tweak the timeout argument.
		// The force param will auto-resolve tree conflicts occurring on incoming new files (add) over existing unversioned files in the working copy.
		public static SVNAsyncOperation<UpdateOperationResult> UpdateAsync(string path, UpdateResolveConflicts resolveConflicts = UpdateResolveConflicts.Postpone, bool force = false, int revision = -1, int timeout = COMMAND_TIMEOUT * 10)
		{
			return SVNAsyncOperation<UpdateOperationResult>.Start(op => Update(path, resolveConflicts, force, revision, timeout));
		}
Exemple #7
0
		// Unlock a file on the repository server.
		// NOTE: If assembly reload happens, task will be lost, complete handler won't be called.
		public static SVNAsyncOperation<LockOperationResult> UnlockFileAsync(string path, bool force, int timeout = COMMAND_TIMEOUT)
		{
			return SVNAsyncOperation<LockOperationResult>.Start(op => UnlockFile(path, force, timeout));
		}
Exemple #8
0
		// Lock a file on the repository server.
		// NOTE: If assembly reload happens, task will be lost, complete handler won't be called.
		public static SVNAsyncOperation<LockOperationResult> LockFileAsync(string path, bool force, string message = "", string encoding = "", int timeout = COMMAND_TIMEOUT)
		{
			return SVNAsyncOperation<LockOperationResult>.Start(op => LockFile(path, force, message, encoding, timeout));
		}
Exemple #9
0
		// Ask the repository server for lock details of the specified file.
		// NOTE: If assembly reload happens, request will be lost, complete handler won't be called.
		public static SVNAsyncOperation<LockDetails> FetchLockDetailsAsync(string path, int timeout = COMMAND_TIMEOUT)
		{
			return SVNAsyncOperation<LockDetails>.Start(op => FetchLockDetails(path, timeout, false));
		}