Ejemplo n.º 1
0
 /// <summary>
 /// Exports a file of the specified reversion to a designated location</summary>
 /// <param name="sourceUri">URI of file to be exported</param>
 /// <param name="destUri">URI of export location</param>
 /// <param name="revision">Source control revision</param>
 public abstract void Export(Uri sourceUri, Uri destUri, SourceControlRevision revision);
Ejemplo n.º 2
0
 /// <summary>
 /// Exports a file of the specified reversion to a designated location</summary>
 public abstract void Export(Uri sourceUri, Uri destUri, SourceControlRevision revision);
Ejemplo n.º 3
0
        /// <summary>
        /// Exports a file of the specified revision to a designated location</summary>
        /// <param name="sourceUri">Source file URI</param>
        /// <param name="destUri">Designated location URI</param>
        /// <param name="revision">Source control revision of file</param>
        public override void Export(Uri sourceUri, Uri destUri, SourceControlRevision revision)
        {
            if (!(Enabled && m_connectionManager.InitializeConnection()))
                return;
            
            string toPath = destUri.Path();
            string fromPath = sourceUri.Path();

            switch (revision.Kind)
            {
                case SourceControlRevisionKind.Number:
                    fromPath += "#" + revision.Number;
                    break;
                case SourceControlRevisionKind.Unspecified:
                    throw new NotSupportedException("Can't export revision of none ");
                //fromPath += "#none";
                //break;
                case SourceControlRevisionKind.Base:
                    fromPath += "#have";
                    break;
                case SourceControlRevisionKind.Head:
                    fromPath += "#head";
                    break;
                case SourceControlRevisionKind.Working:
                    //just file copy 
                    System.IO.File.Copy(fromPath, toPath, true);
                    return;
                case SourceControlRevisionKind.Date:
                    fromPath += "@" + revision.Date;
                    break;
                case SourceControlRevisionKind.ChangeList:
                    fromPath += "@" + revision.ChangeListNumber;
                    break;
            }

            RunP4Command("print", "-q", "-o", toPath, fromPath);

        }