/// <summary> /// Check out SVN or a GIT package. /// </summary> /// <param name="connection">Connection on which we should be checking this out on</param> /// <param name="scPackagePath">The svn path to the package. Basically what you would hand to the rc checkout command. Nohting like "tags" or "trunk" is permitted.</param> /// <param name="scRevision">The revision number. A SVN revision number. If blank, then the version associated with the build is checked out.</param> /// <returns></returns> public static Task <ISSHConnection> CheckoutPackageAsync(this ISSHConnection connection, string scPackagePath, string scRevision, Func <bool> failNow = null, bool dumpOnly = false) { if (string.IsNullOrWhiteSpace(scPackagePath)) { throw new ArgumentNullException("scPackagePath", "Package must be a valid path to a source control repro!"); } var isGit = scPackagePath.EndsWith(".git"); return(isGit ? connection.CheckoutPackageGitAsync(scPackagePath, scRevision, failNow, dumpOnly) : connection.CheckoutPackageSVNAsync(scPackagePath, scRevision, failNow, dumpOnly)); }
/// <summary> /// Check out a Git package from the CERN git repro, of what is pecified in the package. /// </summary> /// <param name="connection">Connection on which to do the checkout</param> /// <param name="scPackagePath">Path to the package, perhaps a short-cut (see remarks)</param> /// <param name="scRevision">Revision for the package, or empty to grab the head</param> /// <param name="failNow">Fuction that returns true if we should bail right away</param> /// <param name="dumpOnly">Just dump the commands output - don't actually do anything.</param> /// <returns></returns> public static ISSHConnection CheckoutPackageGit(this ISSHConnection connection, string scPackagePath, string scRevision, Func <bool> failNow = null, bool dumpOnly = false) { return(connection.CheckoutPackageGitAsync(scPackagePath, scRevision, failNow, dumpOnly) .WaitAndUnwrapException()); }