AcUtils
A high performance abstraction layer for AccuRev
AcDepots.cs
Go to the documentation of this file.
1 
16 using System;
17 using System.Collections.Generic;
18 using System.Diagnostics;
19 using System.IO;
20 using System.Linq;
21 using System.Threading;
22 using System.Threading.Tasks;
23 using System.Xml.Linq;
24 
25 namespace AcUtils
26 {
27  #region enums
28 
29  public enum CaseSensitivity {
39  sensitive
40  };
42  #endregion
43 
47  [Serializable]
48  [DebuggerDisplay("{ToString(\"lv\")}")]
49  public sealed class AcDepot : IFormattable, IEquatable<AcDepot>, IComparable<AcDepot>, IComparable
50  {
51  #region class variables
52  private string _name; // depot name
53  private int _id; // depot ID number
54  private int _slice; // depot slice number
55  private bool _exclusiveLocking; // whether or not all workspaces created for this depot use exclusive file locking
56  private CaseSensitivity _case; // whether the depot is case sensitive or insensitive
57  private bool _dynamicOnly; // true if request is for dynamic streams only
58  private bool _includeHidden; // true if removed streams should be included in the list
59  internal AcStreams _streams; // list of streams in this depot as per constructor parameters
60  [NonSerialized] private Task<MultiValueDictionary<int, int>> _hierarchy; // [parent,children]
61  [NonSerialized] private object _hierSync = null;
62  [NonSerialized] private bool _hierInit;
63  #endregion
64 
65  #region object construction:
66 
68  internal AcDepot(bool dynamicOnly, bool includeHidden)
74  {
75  _dynamicOnly = dynamicOnly;
76  _includeHidden = includeHidden;
77  }
78 
85 
86  public AcDepot(string name, bool dynamicOnly = false, bool includeHidden = false)
87  : this(dynamicOnly, includeHidden)
88  {
89  _name = name;
90  }
91 
98 
99  public AcDepot(int id, bool dynamicOnly = false, bool includeHidden = false)
100  : this(dynamicOnly, includeHidden)
101  {
102  _id = id;
103  }
104 
112 
114  public async Task<bool> initAsync()
115  {
116  bool ret = false; // assume failure
117  try
118  {
119  AcResult r = await AcCommand.runAsync("show -fx depots").ConfigureAwait(false);
120  if (r != null && r.RetVal == 0)
121  {
122  XElement xml = XElement.Parse(r.CmdResult);
123  IEnumerable<XElement> filter = null;
124  if (_id > 0)
125  filter = from element in xml.Elements("Element")
126  where (int)element.Attribute("Number") == _id
127  select element;
128  else
129  filter = from element in xml.Elements("Element")
130  where (string)element.Attribute("Name") == _name
131  select element;
132 
133  XElement e = filter.SingleOrDefault();
134  if (e != null)
135  {
136  ID = (int)e.Attribute("Number");
137  Name = (string)e.Attribute("Name");
138  Slice = (int)e.Attribute("Slice");
139  ExclusiveLocking = (bool)e.Attribute("exclusiveLocking");
140  string temp = (string)e.Attribute("case");
141  Case = (CaseSensitivity)Enum.Parse(typeof(CaseSensitivity), temp);
142  _streams = new AcStreams(_dynamicOnly, _includeHidden);
143  ret = await _streams.initAsync(this, listFile()).ConfigureAwait(false);
144  }
145  }
146  }
147 
148  catch (AcUtilsException ecx)
149  {
150  AcDebug.Log($"AcUtilsException caught and logged in AcDepot.initAsync{Environment.NewLine}{ecx.Message}");
151  }
152 
153  catch (Exception ecx)
154  {
155  AcDebug.Log($"Exception caught and logged in AcDepot.initAsync{Environment.NewLine}{ecx.Message}");
156  }
157 
158  return ret;
159  }
161  #endregion
162 
163  #region Equality comparison
164 
166  public bool Equals(AcDepot other)
173  {
174  if (ReferenceEquals(other, null)) return false;
175  if (ReferenceEquals(this, other)) return true;
176  return ID == other.ID;
177  }
178 
183  public override bool Equals(object other)
184  {
185  if (ReferenceEquals(other, null)) return false;
186  if (ReferenceEquals(this, other)) return true;
187  if (GetType() != other.GetType()) return false;
188  return this.Equals(other as AcDepot);
189  }
190 
195  public override int GetHashCode()
196  {
197  return ID;
198  }
200  #endregion
201 
202  #region Order comparison
203 
205 
211  public int CompareTo(AcDepot other)
212  {
213  int result;
214  if (AcDepot.ReferenceEquals(this, other))
215  result = 0;
216  else
217  result = String.Compare(Name, other.Name);
218 
219  return result;
220  }
221 
228  int IComparable.CompareTo(object other)
229  {
230  if (!(other is AcDepot))
231  throw new ArgumentException("Argument is not an AcDepot", "other");
232  AcDepot o = (AcDepot)other;
233  return this.CompareTo(o);
234  }
236  #endregion
237 
241  public int ID
242  {
243  get { return _id; }
244  internal set { _id = value; }
245  }
246 
250  public string Name
251  {
252  get { return _name ?? String.Empty; }
253  internal set { _name = value; }
254  }
255 
259  public int Slice
260  {
261  get { return _slice; }
262  internal set { _slice = value; }
263  }
264 
268  public bool ExclusiveLocking
269  {
270  get { return _exclusiveLocking; }
271  internal set { _exclusiveLocking = value; }
272  }
273 
277  public CaseSensitivity Case
278  {
279  get { return _case; }
280  internal set { _case = value; }
281  }
282 
286  public IEnumerable<AcStream> Streams
287  {
288  get { return _streams; }
289  }
290 
296  public AcStream getStream(string name)
297  {
298  AcStream stream = _streams.SingleOrDefault(s => s.Name == name);
299  return stream;
300  }
301 
307  public AcStream getStream(int ID)
308  {
309  AcStream stream = _streams.SingleOrDefault(s => s.ID == ID);
310  return stream;
311  }
312 
318  public AcStream getBasis(string name)
319  {
320  AcStream basis = null;
321  // ignore root stream (1) since it has no parent
322  AcStream stream = _streams.Where(s => s.ID > 1).SingleOrDefault(s => s.Name == name);
323  if (stream != null)
324  basis = getStream(stream.BasisID);
325 
326  return basis;
327  }
328 
334  public AcStream getBasis(int ID)
335  {
336  AcStream basis = null;
337  // ignore root stream (1) since it has no parent
338  AcStream stream = _streams.Where(s => s.ID > 1).SingleOrDefault(s => s.ID == ID);
339  if (stream != null)
340  basis = getStream(stream.BasisID);
341 
342  return basis;
343  }
344 
352 
366  public async Task<bool> forStreamAndAllChildrenAsync(AcStream stream, Action<AcStream> cb, bool includeWSpaces = false)
367  {
368  cb(stream);
369  var children = await getChildrenAsync(stream, includeWSpaces).ConfigureAwait(false);
370  if (children == null) return false; // operation failed, check log file
371  if (children.Item1 == null) return false; // ..
372  if (children.Item1 == true) // if children exist
373  foreach (AcStream child in children.Item2)
374  await forStreamAndAllChildrenAsync(child, cb, includeWSpaces).ConfigureAwait(false);
375 
376  return true;
377  }
378 
385 
408  public async Task<Tuple<bool?, IList<AcStream>>> getChildrenAsync(AcStream stream, bool includeWSpaces = false)
409  {
410  IList<AcStream> children = null;
411  if (stream.Type == StreamType.workspace)
412  return Tuple.Create((bool?)false, children); // workspaces don't have children
413 
414  bool? ret = null;
415  // thread safe one-time stream hierarchy initialization
416  // see "C# Lazy Initialization && Race-to-initialize" http://stackoverflow.com/questions/11555755/c-sharp-lazy-initialization-race-to-initialize
417  await LazyInitializer.EnsureInitialized(ref _hierarchy, ref _hierInit, ref _hierSync,
418  async () => await getHierarchyAsync(includeWSpaces).ConfigureAwait(false)).ConfigureAwait(false);
419  if (_hierarchy == null)
420  return Tuple.Create(ret, children); // initialization failed, check log file
421 
422  IReadOnlyCollection<int> list = null;
423  ret = _hierarchy.Result.TryGetValue(stream.ID, out list);
424  if (ret == true)
425  {
426  children = new List<AcStream>(list.Count);
427  foreach (int id in list)
428  {
429  AcStream child = getStream(id);
430  children.Add(child);
431  }
432  }
433 
434  return Tuple.Create(ret, children);
435  }
436 
448 
453  private async Task<MultiValueDictionary<int, int>> getHierarchyAsync(bool includeWSpaces = false)
454  {
455  MultiValueDictionary<int, int> hierarchy = null;
456  try
457  {
458  AcResult r = await AcCommand.runAsync($@"show -p ""{this}"" {(_includeHidden ? " -fix" : " -fx")} -s 1 -r streams")
459  .ConfigureAwait(false);
460  if (r != null && r.RetVal == 0) // if command succeeded
461  {
462  XElement xml = XElement.Parse(r.CmdResult);
463  IEnumerable<XElement> filter;
464  if (includeWSpaces)
465  filter = from s in xml.Elements("stream")
466  select s;
467  else
468  filter = from s in xml.Elements("stream")
469  where (string)s.Attribute("type") != "workspace" // all except workspaces
470  select s;
471 
472  int capacity = filter.Count();
473  hierarchy = new MultiValueDictionary<int, int>(capacity);
474  foreach (XElement e in filter)
475  {
476  // XML attribute basisStreamNumber does not exist in the case of root streams
477  int parent = (int?)e.Attribute("basisStreamNumber") ?? -1;
478  int child = (int)e.Attribute("streamNumber");
479  hierarchy.Add(parent, child);
480  }
481  }
482  }
483 
484  catch (AcUtilsException ecx)
485  {
486  AcDebug.Log($"AcUtilsException caught and logged in AcDepot.getHierarchyAsync{Environment.NewLine}{ecx.Message}");
487  hierarchy = null;
488  }
489 
490  catch (Exception ecx)
491  {
492  AcDebug.Log($"Exception caught and logged in AcDepot.getHierarchyAsync{Environment.NewLine}{ecx.Message}");
493  hierarchy = null;
494  }
495 
496  return hierarchy;
497  }
498 
505 
506 
529  internal string listFile()
530  {
531  string listfile = null;
532  try
533  {
534  string appdata = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
535  string actools = Path.Combine(appdata, "AcTools");
536  string exeroot = String.Empty;
537  using (Process currentProcess = Process.GetCurrentProcess())
538  {
539  ProcessModule pm = currentProcess.MainModule;
540  exeroot = Path.GetFileNameWithoutExtension(pm.ModuleName);
541  }
542 
543  string progfolder = Path.Combine(actools, exeroot);
544  string temp = Path.Combine(progfolder, Name);
545  string file = Path.ChangeExtension(temp, "streams");
546  if (File.Exists(file))
547  listfile = file;
548  }
549 
550  catch (Exception ecx)
551  {
552  AcDebug.Log($"Exception caught and logged in AcDepot.listFile{Environment.NewLine}{ecx.Message}");
553  }
554 
555  return listfile;
556  }
557 
558  #region ToString
559  public string ToString(string format, IFormatProvider provider)
574  {
575  if (provider != null)
576  {
577  ICustomFormatter fmt = provider.GetFormat(this.GetType()) as ICustomFormatter;
578  if (fmt != null)
579  return fmt.Format(format, this, provider);
580  }
581 
582  if (String.IsNullOrEmpty(format))
583  format = "G";
584 
585  switch (format.ToUpperInvariant())
586  {
587  case "G": // Depot name (default when not using a format specifier).
588  return Name; // general format should be short since it can be called by anything
589  case "LV": // long version (verbose)
590  return $"{Name} ({ID}), slice {Slice}, {Case}{(ExclusiveLocking ? ", exclusive locking" : String.Empty)}";
591  case "I": // depot ID number
592  return ID.ToString();
593  case "S": // depot's slice number
594  return Slice.ToString();
595  case "E": // exclusive locking status
596  return ExclusiveLocking.ToString();
597  case "C": // whether the depot is case sensitive or insensitive
598  return Case.ToString();
599  default:
600  throw new FormatException($"The {format} format string is not supported.");
601  }
602  }
603 
604  // Calls ToString(string, IFormatProvider) version with a null IFormatProvider argument.
605  public string ToString(string format)
606  {
607  return ToString(format, null);
608  }
609 
610  // Calls ToString(string, IFormatProvider) version with the general format and a null IFormatProvider argument.
611  public override string ToString()
612  {
613  return ToString("G", null);
614  }
615  #endregion ToString
616  }
617 
621  [Serializable]
622  public sealed class AcDepots : List<AcDepot>
623  {
624  #region class variables
625  private AcPermissions _permissions;
626  [NonSerialized] private Task<bool> _depotPermObj;
627  [NonSerialized] private object _permSync = null;
628  [NonSerialized] private bool _permInit;
629  private bool _dynamicOnly; // true if request is for dynamic streams only
630  private bool _includeHidden; // true if removed streams should be included in the list
631  [NonSerialized] private readonly object _locker = new object(); // token for lock keyword scope
632  [NonSerialized] private int _counter; // used to report initialization progress back to the caller
633  #endregion
634 
635  #region object construction:
636 
638 
652  public AcDepots(bool dynamicOnly = false, bool includeHidden = false)
653  {
654  _dynamicOnly = dynamicOnly;
655  _includeHidden = includeHidden;
656  }
657 
667 
714  public async Task<bool> initAsync(DepotsCollection depotsCol = null, IProgress<int> progress = null)
715  {
716  bool ret = false; // assume failure
717  try
718  {
719  AcResult r = await AcCommand.runAsync("show -fx depots").ConfigureAwait(false);
720  if (r != null && r.RetVal == 0)
721  {
722  XElement xml = XElement.Parse(r.CmdResult);
723  IEnumerable<XElement> query = null;
724  if (depotsCol == null)
725  query = from e in xml.Elements("Element") select e;
726  else
727  query = from e in xml.Elements("Element")
728  where depotsCol.OfType<DepotElement>().Any(de => de.Depot == (string)e.Attribute("Name"))
729  select e;
730 
731  int num = query.Count();
732  List<Task<bool>> tasks = new List<Task<bool>>(num);
733  Func<Task<bool>, bool> cf = t =>
734  {
735  bool res = t.Result;
736  if (res && progress != null) progress.Report(Interlocked.Increment(ref _counter));
737  return res;
738  };
739 
740  foreach (XElement e in query)
741  {
742  AcDepot depot = new AcDepot(_dynamicOnly, _includeHidden);
743  depot.ID = (int)e.Attribute("Number");
744  depot.Name = (string)e.Attribute("Name");
745  depot.Slice = (int)e.Attribute("Slice");
746  depot.ExclusiveLocking = (bool)e.Attribute("exclusiveLocking");
747  string temp = (string)e.Attribute("case");
748  depot.Case = (CaseSensitivity)Enum.Parse(typeof(CaseSensitivity), temp);
749  depot._streams = new AcStreams(_dynamicOnly, _includeHidden);
750  lock (_locker) { Add(depot); }
751  Task<bool> t = depot._streams.initAsync(depot, depot.listFile()).ContinueWith(cf);
752  tasks.Add(t);
753  }
754 
755  bool[] arr = await Task.WhenAll(tasks).ConfigureAwait(false);
756  ret = (arr != null && arr.All(n => n == true)); // true if all succeeded
757  }
758  }
759 
760  catch (AcUtilsException ecx)
761  {
762  AcDebug.Log($"AcUtilsException caught and logged in AcDepots.initAsync{Environment.NewLine}{ecx.Message}");
763  }
764 
765  catch (Exception ecx)
766  {
767  AcDebug.Log($"Exception caught and logged in AcDepots.initAsync{Environment.NewLine}{ecx.Message}");
768  }
769 
770  return ret;
771  }
773  #endregion
774 
775  #pragma warning disable 0642
776 
785  public async Task<string> canViewAsync(AcUser user)
786  {
787  // create permissions object as a singleton (thread safe)
788  // see "C# Lazy Initialization && Race-to-initialize" http://stackoverflow.com/questions/11555755/c-sharp-lazy-initialization-race-to-initialize
789  await LazyInitializer.EnsureInitialized(ref _depotPermObj, ref _permInit, ref _permSync,
790  async () =>
791  {
792  _permissions = new AcPermissions(PermKind.depot);
793  return await _permissions.initAsync().ConfigureAwait(false);
794  }).ConfigureAwait(false);
795 
796  if (_depotPermObj.Result == false)
797  return null; // initialization failure, check log file
798 
799  // get the membership list for the user (includes explicit and implicit membership)
800  SortedSet<string> members = user.Principal.Members;
801  // list that will contain the depots this user has permission to view
802  List<string> canView = new List<string>();
803 
804  foreach (AcDepot depot in this)
805  {
806  bool isInheritable = false;
807  // Any() returns true if the collection contains one or more items that satisfy the condition defined by the predicate
808  // first, is an 'all' or 'none' permission explicitly set for this user on this depot?
809  if (_permissions.Any(p =>
810  {
811  bool all = (p.Type == PermType.user && p.Rights == PermRights.all &&
812  p.AppliesTo == user.Principal.Name && p.Name == depot.Name);
813  if (all)
814  isInheritable = (p.Inheritable == true && p.Type == PermType.user && p.Rights == PermRights.all &&
815  p.AppliesTo == user.Principal.Name && p.Name == depot.Name);
816  return all;
817  }))
818  {
819  canView.Add($"{depot.Name}{(isInheritable ? "+" : String.Empty)}");
820  }
821  else if (_permissions.Any(p =>
822  {
823  return (p.Type == PermType.user && p.Rights == PermRights.none &&
824  p.AppliesTo == user.Principal.Name && p.Name == depot.Name);
825  }))
826  {
827  ; // user does not have permission to this depot
828  }
829  else // check permissions based on user's group memberships
830  {
831  bool all = false;
832  bool none = _permissions.Any(p =>
833  {
834  return (p.Name == depot.Name && p.Rights == PermRights.none &&
835  p.Type == PermType.group && members.Any(m => p.AppliesTo == m));
836  });
837 
838  // by default everyone has access unless there's a "none" with no "all" override
839  if (none)
840  {
841  all = _permissions.Any(p =>
842  {
843  return (p.Name == depot.Name && p.Rights == PermRights.all &&
844  p.Type == PermType.group && members.Any(m => p.AppliesTo == m));
845  });
846  }
847 
848  if (none && !all)
849  ; // user does not have permission to this depot
850  else // no permission(s) set or an 'all' that overrides one or more 'none' permissions
851  {
852  isInheritable = _permissions.Any(p =>
853  {
854  return (p.Inheritable == true && p.Name == depot.Name &&
855  p.Type == PermType.group && members.Any(m => p.AppliesTo == m));
856  });
857 
858  canView.Add($"{depot.Name}{(isInheritable ? "+" : String.Empty)}");
859  }
860  }
861  }
862 
863  IEnumerable<string> e = canView.OrderBy(n => n);
864  string depots = String.Join(", ", e);
865  return depots;
866  }
867 
873  public AcDepot getDepot(string name)
874  {
875  return this.SingleOrDefault(n => n.Name == name);
876  }
877 
883  public AcDepot getDepot(int ID)
884  {
885  return this.SingleOrDefault(n => n.ID == ID);
886  }
887 
893  public AcDepot getDepotForStream(string name)
894  {
895  AcDepot depot = (from d in this
896  from s in d.Streams.Where(n => n.Name == name)
897  select d).SingleOrDefault();
898  return depot;
899  }
900 
906  public AcStream getStream(string name)
907  {
908  AcStream stream = (from d in this
909  from s in d.Streams.Where(n => n.Name == name)
910  select s).SingleOrDefault();
911  return stream;
912  }
913  }
914 }
AcDepot getDepot(string name)
Get the AcDepot object for depot name.
Definition: AcDepots.cs:873
int Slice
Depot's slice number.
Definition: AcDepots.cs:260
AcPrincipal Principal
AccuRev principal attributes name, ID, and status (active or inactive), and optionally their group me...
Definition: AcUsers.cs:157
AccuRev program return value and command result.
Definition: AcCommand.cs:29
int BasisID
Basis stream ID number.
Definition: AcStreams.cs:206
AcDepot(bool dynamicOnly, bool includeHidden)
Constructor used during AcDepots list construction. It is called internally and not by user code...
Definition: AcDepots.cs:73
async Task< bool > initAsync(AcDepot depot, string listfile=null)
Populate this container with AcStream objects as per constructor parameters. AcStream objects are ins...
Definition: AcStreams.cs:435
PermRights
Whether permission rights to Name in AppliesTo is all or none.
CaseSensitivity
Indicates whether the depot is case sensitive or insensitive (defined when the depot is created)...
Definition: AcDepots.cs:33
AcDepot getDepot(int ID)
Get the AcDepot object for depot ID number.
Definition: AcDepots.cs:883
The list of AccuRev depots from .exe.config.
AcStream getStream(int ID)
Get the AcStream object with stream ID number.
Definition: AcDepots.cs:307
A user's AccuRev principal attributes name, ID, and status (active or inactive). In addition...
Definition: AcUsers.cs:37
async Task< string > canViewAsync(AcUser user)
Get the list of depots user has permission to view based on their principal name and group membership...
Definition: AcDepots.cs:785
IEnumerable< AcStream > Streams
The list of streams in this depot.
Definition: AcDepots.cs:287
An AccuRev depot from the Depots section in .exe.config.
Definition: DepotElement.cs:25
async Task< Tuple< bool?, IList< AcStream > > > getChildrenAsync(AcStream stream, bool includeWSpaces=false)
Get the list of child streams that have stream as their immediate parent (basis) stream.
Definition: AcDepots.cs:408
async Task< bool > initAsync(DepotsCollection depotsCol=null, IProgress< int > progress=null)
Populate this container with AcDepot objects as per constructor parameters.
Definition: AcDepots.cs:714
A depot object that defines the attributes of an AccuRev depot.
Definition: AcDepots.cs:49
async Task< MultiValueDictionary< int, int > > getHierarchyAsync(bool includeWSpaces=false)
Get the depot's stream and workspace (optional) hierarchy relationship data from AccuRev. This method is called internally and not by user code.
Definition: AcDepots.cs:453
async Task< bool > forStreamAndAllChildrenAsync(AcStream stream, Action< AcStream > cb, bool includeWSpaces=false)
Run the specified action cb for stream and all child streams in its hierarchy.
Definition: AcDepots.cs:366
async Task< bool > initAsync()
Initialize this AcDepot object with data from AccuRev as per constructor parameter's depot name or ID...
Definition: AcDepots.cs:114
AcDepots(bool dynamicOnly=false, bool includeHidden=false)
A container of AcDepot objects that define AccuRev depots in the repository.
Definition: AcDepots.cs:652
PermKind
Whether permissions pertain to depots or streams. Set when the permission is created by the setacl co...
int ID
Depot ID number.
Definition: AcDepots.cs:242
A stream object that defines the attributes of an AccuRev stream. AcStream objects are instantiated d...
Definition: AcStreams.cs:74
string CmdResult
The command result (usually XML) emitted by AccuRev.
Definition: AcCommand.cs:70
int RetVal
The AccuRev program return value for the command, otherwise minus one (-1) on error.
Definition: AcCommand.cs:61
static void Log(string message, bool formatting=true)
Write the message text to STDOUT, to weekly log files located in %LOCALAPPDATA%\AcTools\Logs, and to trigger.log in the AccuRev server's ..storage\site_slice\logs folder in the case of triggers.
Definition: AcDebug.cs:378
AcStream getStream(string name)
Get the AcStream object for stream name.
Definition: AcDepots.cs:906
string Name
Depot name.
Definition: AcDepots.cs:251
StreamType Type
The kind of stream: unknown, normal, dynamic, regular, workspace, snapshot, passthru, passthrough, gated or staging.
Definition: AcStreams.cs:235
AcStream getStream(string name)
Get the AcStream object for stream name.
Definition: AcDepots.cs:296
AcDepot(string name, bool dynamicOnly=false, bool includeHidden=false)
Constructor for specifying the depot name.
Definition: AcDepots.cs:86
override bool Equals(object other)
Overridden to determine equality.
Definition: AcDepots.cs:183
AcStream getBasis(int ID)
Get the basis (parent) stream for stream ID number.
Definition: AcDepots.cs:334
Exception thrown when an AccuRev command fails. The AccuRev program return value is zero (0) on succe...
StreamType
The type of stream.
Definition: AcStreams.cs:33
AcStream getBasis(string name)
Get the basis (parent) stream for stream name.
Definition: AcDepots.cs:318
int ID
Stream ID number.
Definition: AcStreams.cs:188
AccuRev command processing.
Definition: AcCommand.cs:138
static async Task< AcResult > runAsync(string command, ICmdValidate validator=null)
Run the AccuRev command asynchronously with non-blocking I/O.
Definition: AcCommand.cs:184
int CompareTo(AcDepot other)
Generic IComparable implementation (default) for comparing AcDepot objects to sort by depot name...
Definition: AcDepots.cs:211
AcDepot(int id, bool dynamicOnly=false, bool includeHidden=false)
Constructor for specifying the depot ID number.
Definition: AcDepots.cs:99
Use to log and display error and general purpose text messages, and to save the XML param data sent b...
Definition: AcDebug.cs:100
override int GetHashCode()
Override appropriate for type AcDepot.
Definition: AcDepots.cs:195
A container of AcDepot objects that define AccuRev depots in the repository.
Definition: AcDepots.cs:622
string listFile()
When this file exists (created manually), it is used as the list-file to populate the depot with sele...
Definition: AcDepots.cs:529
AcDepot getDepotForStream(string name)
Get the AcDepot object for stream name.
Definition: AcDepots.cs:893
bool ExclusiveLocking
Whether or not all workspaces created for this depot use exclusive file locking.
Definition: AcDepots.cs:269
A container of AcPermission objects that define AccuRev access control list (ACL) entries...
SortedSet< string > Members
The list of groups a user has membership in, or the list of principals (users and groups) in a group...
Definition: AcPrincipal.cs:177
PermType
Whether AppliesTo is the principal name for a group, user, or builtin type.
A container of AcStream objects that define AccuRev streams. AcStream objects are instantiated during...
Definition: AcStreams.cs:375
string ToString(string format, IFormatProvider provider)
The ToString implementation.
Definition: AcDepots.cs:573
bool Equals(AcDepot other)
IEquatable implementation to determine the equality of instances of type AcDepot. Uses the depot ID n...
Definition: AcDepots.cs:172
CaseSensitivity Case
Whether the depot is case sensitive or insensitive.
Definition: AcDepots.cs:278