Beispiel #1
0
        // Given a changeset, fetch all of the associated files
        public bool GetChangeset(string localpath, Changeset change)
        {
            long               ResultValue;
            bool               Cancelled;
            string             ResultDescription;
            SAWSDiffMergeParam DiffMergeParam = new SAWSDiffMergeParam();

            Console.WriteLine("Fetching changeset {0} ({1}) by {2}: {3}", change.Id, change.CommitDate, change.Author, change.Comment);

            foreach (SourceFile file in change.Files.ToList())
            {
                ResultValue = sawObject.GetOldVersionFile(file.SourceName, file.VersionLow, file.VersionHigh, localpath + file.SourceName.Trim('$').Replace('/', '\\'),
                                                          false, Enum_ModifiedFileHandling.Enum_ReplaceModifiedFile, Enum_EOL.Enum_EOLNative, Enum_CompareFileBy.Enum_CompareFileByChecksum,
                                                          Enum_SetLocalFileTime.Enum_SetLocalFileTimeCheckIn, DiffMergeParam, out Cancelled, out ResultDescription);
                //Console.WriteLine("{0}: Fetched {1} --> {2}", ResultValue, file.SourceName, localpath + file.SourceName.Trim('$').Replace('/', '\\'));
                if (ResultValue != 0)
                {
                    // If there was an error fetching the file, remove it from the list so we don't try to add it to git
                    Console.WriteLine("ERROR: {0}\t {1}", ResultValue, ResultDescription);
                    change.Files.Remove(file);
                }
            }

            return(true);
        }
Beispiel #2
0
        public bool GetFile(int version, string strLocalPath, string strRemotePath)
        {
            if (!(this.bConnected && this.bLogin))
            {
                return(false);
            }
            Boolean Cancelled;
            string  ResultDescription;
            string  FileNameOnServer = SAWCommon.ConvertPath(strRemotePath);
            int     VersionNumberLow = version;
            string  LocalFileName    = strLocalPath;
            var     MergeParam       = new SAWSDiffMergeParam();

            if (0 != sdkObject.GetOldVersionFile(FileNameOnServer, VersionNumberLow, 0, LocalFileName, false,
                                                 Enum_ModifiedFileHandling.Enum_ReplaceModifiedFile, Enum_EOL.Enum_EOLNative,
                                                 Enum_CompareFileBy.Enum_CompareFileByChecksum, Enum_SetLocalFileTime.Enum_SetLocalFileTimeCurrent,
                                                 MergeParam, out Cancelled, out ResultDescription))
            {
                return(false);
            }
            else
            {
                return(!Cancelled);
            }
        }