subversion目录的大小

时间:2010-10-07 08:22:02

标签: c# svn visual-studio-2010 sharpsvn

我有一个项目,通过sharpsvn在subversion下的目录中进行结账。我现在要做的是在进度条中显示结帐流程,但为此我需要知道电路板的大小,库的属性或决定我将返回目录的大小?

提前致谢!

2 个答案:

答案 0 :(得分:0)

我设法通过结帐获取下载目录的大小以进行颠覆,因此我获得了一个变量“total_size”,其中包含下载的整体大小。现在要在进度条中显示下载过程,应该捕获下载的位以与总数进行比较并将它们分配给进度条,但不是如何获取此数据...有人做过类似的事吗?你能告诉我那个属性并使用过代码吗?

              //This collection will contain property collections for each node
              System.Collections.ObjectModel.Collection<SvnPropertyListEventArgs> proplist;

              //This is where we can specify arguments to svn proplist
              SvnPropertyListArgs args = new SvnPropertyListArgs();

              args.Depth = SvnDepth.Infinity;

              //This method is what executes svn proplist
              client.GetPropertyList(targetSource, args, out proplist);

              //Each SvnPropertyListEventArgs represents the prop. set for a node
              foreach (SvnPropertyListEventArgs node in proplist)
              {
                  //Each SvnPropertyValue represents a single name/value property pair
                  foreach (SvnPropertyValue propVal in node.Properties)
                  {
                      items.Items.Add(node.Path);
                  }
              }

              int total_items = items.Items.Count;
              long totalsize = 0;
              for (int i = 0; i < total_items; i++)
              {
                  client.GetInfo(new Uri(items.Items[i].ToString()), out info);
                  totalsize = totalsize + info.RepositorySize;

              }
              MessageBox.Show(string.Format("The total size of {0} is {1}", targetSource, totalsize));

由于

答案 1 :(得分:0)

TortoiseSVN与结帐进度条类似,您可以查看其源代码。