AcUtils
A high performance abstraction layer for AccuRev
|
Miscellaneous stuff that didn't fit in elsewhere. More...
Static Public Member Functions | |
static async Task< string > | getPrincipalAsync () |
Determines if the current user is logged into AccuRev and, if so, retrieves their principal name. More... | |
static async Task< string > | getCatFileAsync (int eid, AcDepot depot, string ver_spec) |
Use to retrieve the contents of a text file under version control. More... | |
static async Task< int[]> | getBackedVersionAsync (string realverspec, AcDepot depot, string depotrelpath) |
For the real version specified in the argument list, get the real stream/version for the version in the specified version's workspace backing stream. More... | |
static async Task< Tuple< string, int > > | getElementNameAsync (string stream, int EID) |
Get the depot-relative path for the element in stream with EID. Also returns the element's parent folder EID (folder where the element resides). More... | |
static T | getAppConfigSetting< T > (string key) |
Type safe way to retrieve values from <prog_name>.exe.config files. More... | |
static async Task< int[]> | getAccuRevVersionAsync () |
Retrieves the AccuRev program major, minor and patch version numbers. More... | |
static async Task< int > | getUsersCountAsync (bool includeDeactivated=false) |
Get the number of active users. More... | |
static async Task< int > | getDepotsCountAsync () |
Get the number of active depots in the repository. More... | |
static async Task< int > | getDynStreamsCountAsync () |
Get the number of dynamic streams in the repository that have a default group. More... | |
static async Task< int > | getTotalStreamsCountAsync () |
Get the total number of streams (including workspace streams) in the repository including those that are hidden. More... | |
static async Task< int > | getStreamsWithDefaultGroupCountAsync () |
Get the number of streams (including workspace streams) in the repository that have a default group. More... | |
static async Task< int > | getTotalWorkspaceCountAsync () |
Get the total number of workspaces in the repository including those that are hidden. More... | |
static bool | getAcGUIpath (out string path) |
Determine if acgui.exe is found in the Path and thus can be spawned. More... | |
static bool | getServerFromAcClientCnf (out string server) |
Get the default AccuRev server from acclient.cnf . The default server is the first line in the file. More... | |
static async Task< List< string > > | getDepotNameListAsync () |
Get the list of depot names in sorted order. More... | |
Static Private Member Functions | |
static bool | getAcClientCnfPath (out string path) |
Helper function for getServerFromAcClientCnf returns the full path to acclient.cnf on the host machine. More... | |
Miscellaneous stuff that didn't fit in elsewhere.
Definition at line 32 of file AcQuery.cs.
|
inlinestaticprivate |
Helper function for getServerFromAcClientCnf returns the full path to acclient.cnf
on the host machine.
path | Full path to acclient.cnf . |
Definition at line 589 of file AcQuery.cs.
Referenced by AcUtils.AcQuery.getServerFromAcClientCnf().
|
inlinestatic |
Retrieves the AccuRev program major, minor and patch version numbers.
xml -l <xmlfile>
AcUtilsException | caught and logged in %LOCALAPPDATA%\AcTools\Logs\<prog_name>-YYYY-MM-DD.log on xml command failure. |
Exception | caught and logged in same on failure to handle a range of exceptions. |
Definition at line 293 of file AcQuery.cs.
|
inlinestatic |
Determine if acgui.exe
is found in the Path and thus can be spawned.
path | The full path to acgui.exe on the host machine if found, otherwise null. |
Exception | caught and logged in %LOCALAPPDATA%\AcTools\Logs\<prog_name>-YYYY-MM-DD.log on failure to handle a range of exceptions. |
Definition at line 551 of file AcQuery.cs.
Referenced by AcUtils.AcQuery.getAcClientCnfPath().
|
inlinestatic |
Type safe way to retrieve values from <prog_name>.exe.config
files.
T | Data type for <prog_name>.exe.config file entry. |
key | Key name from <prog_name>.exe.config file entry. |
<prog_name>.exe.config
value for key.Definition at line 268 of file AcQuery.cs.
|
inlinestatic |
For the real version specified in the argument list, get the real stream/version for the version in the specified version's workspace backing stream.
diff
used here with the -i
option, not to run a diff but to get the EID's only.
realverspec | Real version specification in text format, for example PG_MAINT1_barnyrd\4 (numeric format won't work). |
depot | The depot. |
depotrelpath | Depot relative path, for example .\Bin\foo.java |
diff
command returns zero (0) for no differences found, one (1) for differences found, or two (2) on diff
program error.diff -fx -v <realverspec> -b -i -p <depot> <depotrelpath>
-v -b Compare the specified version (X) with the version in X's stream's backing stream. (Use -v -V instead if comparing elements of type text that are active in a time-based stream.)
-i Information only: Report the IDs of the two versions, but don't actually compare them. This option is valid only in a command that uses a -v/-V combination or a -v/-b combination. If an element appears only in the workspace stream, not in the workspace's backing stream, this option does not list it.
AcUtilsException | caught and logged in %LOCALAPPDATA%\AcTools\Logs\<prog_name>-YYYY-MM-DD.log on diff command failure. |
Exception | caught and logged in same on failure to handle a range of exceptions. |
Definition at line 167 of file AcQuery.cs.
|
inlinestatic |
Use to retrieve the contents of a text file under version control.
Puts the content of the specified file in a temporary file. The caller is responsible for deleting the file.
eid | The file's element ID. |
depot | The depot. |
ver_spec | The version specification in the numeric or text format, e.g. 32/1 or PG_MAINT1_barnyrd\4 . |
cat -v <ver_spec> -p <depot> -e <eid>
command on success, otherwise null on error. cat -v <ver_spec> -p <depot> -e <eid>
AcUtilsException | caught and logged in %LOCALAPPDATA%\AcTools\Logs\<prog_name>-YYYY-MM-DD.log on cat command failure. |
Exception | caught and logged in same on failure to handle a range of exceptions. |
cat
command fails on Windows for ptext files larger than 62,733 bytes. Fixed in 6.0. AccuRev defect 28177. name
, anc
and cat
commands, the validity of the results is guaranteed only if the commands are issued outside a workspace, or in a workspace whose backing stream is in the same depot for both workspace and the -v <ver_spec>
option used. If issued from a workspace that has a different backing stream than the -v <ver_spec>
, provided both workspace and ver_spec share the same depot, the command results can be deemed valid. However, if issued from a workspace whose backing stream is in a different depot than the -v <ver_spec>
, the command results are invalid. Applications should set the default directory to a non-workspace location prior to issuing these commands. AccuRev defects 18080, 21469, 1097778. Definition at line 119 of file AcQuery.cs.
|
inlinestatic |
Get the list of depot names in sorted order.
show -fx depots
AcUtilsException | caught and logged in %LOCALAPPDATA%\AcTools\Logs\<prog_name>-YYYY-MM-DD.log on show command failure. |
Definition at line 652 of file AcQuery.cs.
|
inlinestatic |
Get the number of active depots in the repository.
show -fx depots
AcUtilsException | caught and logged in %LOCALAPPDATA%\AcTools\Logs\<prog_name>-YYYY-MM-DD.log on show command failure. |
Exception | caught and logged in same on failure to handle a range of exceptions. |
Definition at line 382 of file AcQuery.cs.
|
inlinestatic |
Get the number of dynamic streams in the repository that have a default group.
show -fx -d streams
AcUtilsException | caught and logged in %LOCALAPPDATA%\AcTools\Logs\<prog_name>-YYYY-MM-DD.log on show command failure. |
Exception | caught and logged in same on failure to handle a range of exceptions. |
Definition at line 416 of file AcQuery.cs.
|
inlinestatic |
Get the depot-relative path for the element in stream with EID. Also returns the element's parent folder EID (folder where the element resides).
stream | Name of the stream where the element resides. |
EID | The element ID of the element on which to query. |
name -v <stream> -fx -e <EID>
AcUtilsException | caught and logged in %LOCALAPPDATA%\AcTools\Logs\<prog_name>-YYYY-MM-DD.log on name command failure. |
Exception | caught and logged in same on failure to handle a range of exceptions. |
name
, anc
and cat
commands, the validity of the results is guaranteed only if the commands are issued outside a workspace, or in a workspace whose backing stream is in the same depot for both workspace and the -v <ver_spec>
option used. If issued from a workspace that has a different backing stream than the -v <ver_spec>
, provided both workspace and ver_spec share the same depot, the command results can be deemed valid. However, if issued from a workspace whose backing stream is in a different depot than the -v <ver_spec>
, the command results are invalid. Applications should set the default directory to a non-workspace location prior to issuing these commands. AccuRev defects 18080, 21469, 1097778. Definition at line 233 of file AcQuery.cs.
|
inlinestatic |
Determines if the current user is logged into AccuRev and, if so, retrieves their principal name.
Implemented by extracting the user's principal name or string "(not logged in)" from the info
command results.
info
info
command (instead of from XML <serverInfo> results, which are not correct for replica) to use in titlebar, preferences.xml, and MQTT messages. 35934/17776122 (35921/17776020) AcUtilsException | caught and logged in %LOCALAPPDATA%\AcTools\Logs\<prog_name>-YYYY-MM-DD.log on info command failure. |
Exception | caught and logged in same on failure to handle a range of exceptions. |
AccuRev\bin
in their Path environment variable to run AccuRev commands issued by the AcUtils library. Since this method is often the first function called by a client application (in this case info
), a failure here usually means this entry is missing. Definition at line 49 of file AcQuery.cs.
|
inlinestatic |
Get the default AccuRev server from acclient.cnf
. The default server is the first line in the file.
server | The AccuRev server in the format hostname:port , otherwise null. |
Exception | caught and logged in %LOCALAPPDATA%\AcTools\Logs\<prog_name>-YYYY-MM-DD.log on failure to handle a range of exceptions. |
Definition at line 611 of file AcQuery.cs.
|
inlinestatic |
Get the number of streams (including workspace streams) in the repository that have a default group.
show -fx -d streams
AcUtilsException | caught and logged in %LOCALAPPDATA%\AcTools\Logs\<prog_name>-YYYY-MM-DD.log on show command failure. |
Exception | caught and logged in same on failure to handle a range of exceptions. |
Definition at line 484 of file AcQuery.cs.
|
inlinestatic |
Get the total number of streams (including workspace streams) in the repository including those that are hidden.
show -fix streams
AcUtilsException | caught and logged in %LOCALAPPDATA%\AcTools\Logs\<prog_name>-YYYY-MM-DD.log on show command failure. |
Exception | caught and logged in same on failure to handle a range of exceptions. |
Definition at line 450 of file AcQuery.cs.
|
inlinestatic |
Get the total number of workspaces in the repository including those that are hidden.
show -fix -a wspaces
AcUtilsException | caught and logged in %LOCALAPPDATA%\AcTools\Logs\<prog_name>-YYYY-MM-DD.log on show command failure. |
Exception | caught and logged in same on failure to handle a range of exceptions. |
Definition at line 518 of file AcQuery.cs.
|
inlinestatic |
Get the number of active users.
includeDeactivated | true to include deactivated (removed) users, otherwise false. |
show -fx users
AcUtilsException | caught and logged in %LOCALAPPDATA%\AcTools\Logs\<prog_name>-YYYY-MM-DD.log on show command failure. |
Exception | caught and logged in same on failure to handle a range of exceptions. |
Definition at line 348 of file AcQuery.cs.