Example #1
0
        public override void OnExecute(CommandEventArgs e)
        {
            using (ExportDialog dlg = new ExportDialog(e.Context))
            {
                dlg.OriginPath = EnumTools.GetSingle(e.Selection.GetSelectedSvnItems(false)).FullPath;

                if (dlg.ShowDialog(e.Context) != DialogResult.OK)
                {
                    return;
                }

                SvnDepth depth = dlg.NonRecursive ? SvnDepth.Empty : SvnDepth.Infinity;

                e.GetService <IProgressRunner>().RunModal(CommandStrings.Exporting,
                                                          delegate(object sender, ProgressWorkerArgs wa)
                {
                    SvnExportArgs args = new SvnExportArgs();
                    args.Depth         = depth;
                    args.Revision      = dlg.Revision;
                    args.Overwrite     = true;

                    wa.Client.Export(dlg.ExportSource, dlg.LocalPath, args);
                });
            }
        }
Example #2
0
 public static bool UpdateDir(SvnClient client, string name, SvnDepth depth, string revision = null)
 {
     return(client.Update(name, new SvnUpdateArgs {
         Revision = SubversionHelper.MakeRevision(revision),
         Depth = depth,
         IgnoreExternals = true,
         KeepDepth = true
     }));
 }
Example #3
0
        /// <summary>Adds the specified path</summary>
        /// <exception type="SvnException">Operation failed</exception>
        /// <exception type="ArgumentException">Parameters invalid</exception>
        public bool Add(string path, SvnDepth depth)
        {
            if (string.IsNullOrEmpty(path))
            {
                throw new ArgumentNullException(nameof(path));
            }

            var args = new SvnAddArgs();

            args.Depth = depth;

            return(Add(path, args));
        }
Example #4
0
        private void ModifyFile(out string oldContents, out string newContents, string filePath,
            string revertPath, SvnDepth depth)
        {
            using (StreamReader reader = new StreamReader(filePath))
                oldContents = reader.ReadToEnd();
            using (StreamWriter writer = new StreamWriter(filePath))
                writer.WriteLine("mooooooo");

            SvnRevertArgs a = new SvnRevertArgs();
            a.Depth = depth;
            this.Client.Revert(revertPath, a);

            using (StreamReader reader = new StreamReader(filePath))
                newContents = reader.ReadToEnd();
        }
        private void ModifyFile(out string oldContents, out string newContents, string filePath,
                                string revertPath, SvnDepth depth)
        {
            using (StreamReader reader = new StreamReader(filePath))
                oldContents = reader.ReadToEnd();
            using (StreamWriter writer = new StreamWriter(filePath))
                writer.WriteLine("mooooooo");

            SvnRevertArgs a = new SvnRevertArgs();

            a.Depth = depth;
            this.Client.Revert(revertPath, a);

            using (StreamReader reader = new StreamReader(filePath))
                newContents = reader.ReadToEnd();
        }
Example #6
0
 static public void Checkout(Uri fromUri, string localPath, SvnDepth depth)
 {
     using (SvnClient svnClient = new SvnClient())
     {
         try
         {
             SvnCheckOutArgs args = new SvnCheckOutArgs();
             args.Depth = depth;
             svnClient.CheckOut(fromUri, localPath, args);
         }
         catch (Exception ex)
         {
             LogMessage(ex.Message);
         }
     }
 }
Example #7
0
        internal unsafe void Ensure()
        {
            if (_ensured || _status == null)
            {
                return;
            }

            _ensured = true;

            svn_wc_status2_t.__Internal *status2;

            var error = libsvnsharp_wc_private.svn_wc__status2_from_3(
                (void **)&status2,
                svn_wc_status3_t.__CreateInstance(_status.backwards_compatibility_baton),
                _client.CtxHandle.wc_ctx,
                _status.local_abspath,
                _pool.Handle,
                _pool.Handle);

            if (error != null)
            {
                throw SvnException.Create(error);
            }

            var entry = svn_wc_entry_t.__CreateInstance(status2->entry);

            _entry = entry;

            _revision           = entry.revision;
            _nodeKind           = (SvnNodeKind)entry.kind;
            _schedule           = (SvnSchedule)entry.schedule;
            _copied             = entry.copied;
            _deleted            = entry.deleted;
            _absent             = entry.absent;
            _incomplete         = entry.incomplete;
            _copyFromRev        = entry.copyfrom_rev;
            _textTime           = SvnBase.DateTimeFromAprTime(entry.text_time);
            _lastChangeRev      = entry.cmt_rev;
            _lastChangeTime     = SvnBase.DateTimeFromAprTime(entry.cmt_date);
            _lockTime           = SvnBase.DateTimeFromAprTime(entry.lock_creation_date);
            _hasProperties      = entry.has_props;
            _hasPropertyChanges = entry.has_prop_mods;
            _wcSize             = entry.working_size;
            _keepLocal          = entry.keep_local;
            _depth = (SvnDepth)entry.depth;
        }
Example #8
0
        internal static SharpSvn.SvnDepth ToSharpSvn(this SvnDepth depth)
        {
            switch (depth)
            {
            case SvnDepth.Empty:
                return(SharpSvn.SvnDepth.Empty);

            case SvnDepth.Files:
                return(SharpSvn.SvnDepth.Files);

            case SvnDepth.Immediates:
                return(SharpSvn.SvnDepth.Children);

            case SvnDepth.Infinity:
                return(SharpSvn.SvnDepth.Infinity);

            default:
                return(SharpSvn.SvnDepth.Unknown);
            }
        }
Example #9
0
        private void depthComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            ComboBox box   = (ComboBox)sender;
            SvnDepth depth = SvnDepth.Unknown;

            if (box.Text == MergeStrings.SvnDepthInfinity)
            {
                depth = SvnDepth.Infinity;
            }
            else if (box.Text == MergeStrings.SvnDepthChildren)
            {
                depth = SvnDepth.Children;
            }
            else if (box.Text == MergeStrings.SvnDepthFiles)
            {
                depth = SvnDepth.Files;
            }
            else if (box.Text == MergeStrings.SvnDepthEmpty)
            {
                depth = SvnDepth.Empty;
            }

            Depth = depth;
        }
Example #10
0
 public SvnExportArgs()
 {
     _depth    = SvnDepth.Infinity;
     _revision = SvnRevision.None;
 }
Example #11
0
 public SvnInfoArgs()
 {
     _revision = SvnRevision.None;
     _depth    = SvnDepth.Empty;
 }
Example #12
0
 public SvnStatusArgs()
 {
     _depth    = SvnDepth.Infinity;
     _revision = SvnRevision.None;
 }
Example #13
0
 public SvnUpdateArgs()
 {
     _depth    = SvnDepth.Unknown;
     _revision = SvnRevision.None;
 }
Example #14
0
 public SvnGetPropertyArgs()
 {
     _depth    = SvnDepth.Empty;
     _revision = SvnRevision.None;
 }
Example #15
0
 public SvnCheckOutArgs()
 {
     _depth    = SvnDepth.Unknown;
     _revision = SvnRevision.None;
 }
Example #16
0
 public SvnAddArgs()
 {
     _depth = SvnDepth.Infinity;
 }
Example #17
0
 public SvnCommitArgs()
 {
     _depth = SvnDepth.Infinity;
 }
Example #18
0
 public SvnSetPropertyArgs()
 {
     _depth        = SvnDepth.Empty;
     _baseRevision = Constants.SVN_INVALID_REVNUM;
 }
Example #19
0
 public SvnListArgs()
 {
     _depth          = SvnDepth.Children;
     _revision       = SvnRevision.None;
     RetrieveEntries = SvnDirEntryItems.SvnListDefault;
 }