コード例 #1
0
 GetSetCloneOrigin(string cloneName, string originUrl, bool reset)
 {
     if (cloneName != null)
     {
         var clone = PyRevit.GetRegisteredClone(cloneName);
         if (clone.IsRepoDeploy)
         {
             if (originUrl != null || reset)
             {
                 string newUrl =
                     reset ? PyRevitConsts.OriginalRepoPath : originUrl;
                 clone.SetOrigin(newUrl);
             }
             else
             {
                 Console.WriteLine(string.Format("Clone \"{0}\" origin is at \"{1}\"",
                                                 clone.Name, clone.Origin));
             }
         }
         else
         {
             PyRevitCLIAppCmds.ReportCloneAsNoGit(clone);
         }
     }
 }
コード例 #2
0
 GetSetCloneBranch(string cloneName, string branchName)
 {
     if (cloneName != null)
     {
         var clone = PyRevit.GetRegisteredClone(cloneName);
         if (clone != null)
         {
             if (clone.IsRepoDeploy)
             {
                 if (branchName != null)
                 {
                     clone.SetBranch(branchName);
                 }
                 else
                 {
                     Console.WriteLine(string.Format("Clone \"{0}\" is on branch \"{1}\"",
                                                     clone.Name, clone.Branch));
                 }
             }
             else
             {
                 PyRevitCLIAppCmds.ReportCloneAsNoGit(clone);
             }
         }
     }
 }
コード例 #3
0
 GetSetCloneCommit(string cloneName, string commitHash)
 {
     if (cloneName != null)
     {
         var clone = PyRevit.GetRegisteredClone(cloneName);
         if (clone.IsRepoDeploy)
         {
             if (commitHash != null)
             {
                 clone.SetCommit(commitHash);
             }
             else
             {
                 Console.WriteLine(string.Format("Clone \"{0}\" is on commit \"{1}\"",
                                                 clone.Name, clone.Commit));
             }
         }
         else
         {
             PyRevitCLIAppCmds.ReportCloneAsNoGit(clone);
         }
     }
 }