sitehist

show transaction history of non-depot specific site information

Usage

sitehist [ -t <transaction-range> ] [ -c <comment>] [ -a ] [ -u <principal-name> ] 
    [ -k <transaction-kind> ] [ -f <format(s)> ]

Description

The sitehist command displays the transaction history of non-depot specific site information such as stream acls, users and group membership.

Options

-a

Return information about all site transactions.

-c <comment-string>

Display only transaction(s) whose comments contain the specified string. (The string matching is case-insensitive.) Enclose the string in quotes to ensure that sitehist interprets it as a single command-line argument.

-f <format(s)>

Use one or more of the following format letters:

t: ("transaction") Display just the header line, including the transaction number.

x: ("XML") Display results in XML format.

-k <transaction-kind>

Display only the transactions of the specified kind. Valid values are:

dbupgrade, set_acl, clear_acl, mkuser, chuser, chpasswd, remove_user, reactivate_user, mkgroup, chgroup, addmember, rmmember, remove_group, reactivate_group

-u <principal-name>

Display only the transactions for the specified AccuRev user.

-t <time-spec>[ .<count> ]

....

-t <time-spec> - <time-spec>[ .<count> ]

The first form specifies one transaction, or a specified number of transactions up to (i.e. preceding) and including a particular transaction.

The second form specifies transactions that took place in the specified interval; the optional suffix truncates the listing after the most recent <count> transactions. You may need to use quotes in composing the argument following -t; the entire argument must be interpreted by the command shell as a single token. The command output depends on the order of the time-specs; list the most recent time-spec first to show the results in order from most recent to least recent. Reverse the order of the time-specs to reverse the order of the output.

A time-spec can be any of the following:

  • Time in <"YYYY/MM/DD HH:MM:SS"> format, "2007/08/07 20:27:15", for example. Note that you must use quotes when specifying time-spec as YYYY/MM/DD HH:MM:SS to ensure that the entire argument is interpreted by the command shell as a single token.
  • Time keyword: now
  • Transaction number as a positive integer: e.g. 146 or 23965
  • Transaction number keyword: highest

When using the –t option, take into account the possibility of a timewarp. The AC_SYNC environment variable (see AccuRev User Preferences) determines how a timewarp will be handled. See also System Clock Synchronization in the AccuRev Admin Guide.

Specifying the Transactions

By default, sitehist displays the entire transaction history of the site. The various forms of the -t option restrict the display to a single transaction, or to a range of transactions. Each variant involves one or two time-specs. A single time-spec means "the transaction that took place at this time" or "the most recent transaction that took place before this time". Two time-specs define an interval; sitehist reports all the transactions in the interval.

Examples

Display the transaction history for the site:

> accurev sitehist

Display site transactions 145 through 176, inclusive:

> accurev sitehist -t "176-145"

Display the five most recent site transactions:

> accurev sitehist -t now.5

Display information on the most recent mkuser site transaction:

> accurev sitehist -t now -k mkuser
transaction 10; mkuser; 2016/03/15 16:14:09; user: u1
     new; id: 10; name: u5_nopass; kind: full

Note that the output of this command can be in XML format if you specify -fx at the command line:

> accurev sitehist -t now -k mkuser -fx
<?xml version="1.0" encoding="utf-8"?>
<AcResponse
    Command="sitehist"
    TaskId="1301"
  <transaction
      id="10"
      type="mkuser"
      time="1458072849"
      user="u1">
    <User
        Info="new"
        Number="10"
        Name="u5_nopass"
        Kind="full"/>
  </transaction>
</AcResponse>

 

The <User> element details the number, name and kind of user that was created by the mkuser transaction. A transaction's timestamp (time attribute of the XML element <transaction>) is reported as the number of seconds since Jan. 1, 1970 UTC. Special Field Types on page 264 describes a technique for converting this timestamp into a human-readable string.

The user attribute of the <transaction> element displays the name of the user who issued the mkuser transaction.

Display information on the most recent mkgroup site transaction:

> accurev sitehist -t now -k mkgroup -fx
<?xml version="1.0" encoding="utf-8"?>
<AcResponse
    Command="sitehist"
    TaskId="1302">
  <transaction
      id="29"
      type="mkgroup"
      time="1458072851"
      user="u1">
    <Group
        Info="new"
        Number="17"
        Name="gmeta2"/>
  </transaction>
</AcResponse>

 

Display information on the most recent chuser site transaction:

> accurev sitehist -t now -k chuser -fx
<?xml version="1.0" encoding="utf-8"?>
<AcResponse
    Command="sitehist"
    TaskId="1305">
  <transaction
      id="51"
      type="chuser"
      time="1458073304"
      user="u1">
    <User
        Info="old"
        Number="2"
        Name="u2"
        Kind="full"/>
    <User
        Info="new"
        Number="2"
        Name="testuser2"
        Kind="full"/>
  </transaction>
</AcResponse>

 

Notice that there are two user elements in the transaction. The record with the Info="old" attribute contains the number, name and kind of user before the changes made by the chuser command. The element with the Info="new" attribute contains the new number, name and kind. Notice that the name changed from "u2" to "testuser2".

 

Display information on the most recent set_acl transaction:

> accurev sitehist -t now -k set_acl -fx
<?xml version="1.0" encoding="utf-8"?>
<AcResponse
    Command="sitehist"
    TaskId="1306">
  <transaction
      id="50"
      type="set_acl"
      time="1458072889"
      user="u1">
    <Acl
        action="set"
        depot="d1"
        stream=""
        user="gmeta2"
        allow_access="yes"
        inheritable="yes"/>
  </transaction>
</AcResponse>