IPnom Home • Manuals • ClearCase

 Rational ClearCase Commands Reference

ClearCase Stuff:ClearCase LinksClearCase BooksClearCase Commands ReferenceClearCase ForumsClearCase News
Keyword Live Search (10 results max):
 Type in part of a ClearCase command in the search box.
 
Commands Index:
  intro
  annotate
  apropos
  catcr
  catcs
  cc.icon
  cc.magic
  cd
  chactivity
  chbl
  checkin
  checkout
  checkvob
  chevent
  chflevel
  chfolder
  chmaster
  chpool
  chproject
  chstream
  chtype
  chview
  clearaudit
  clearbug
  cleardescribe
  cleardiffbl
  cleardiff
  clearexport_ccase
  clearexport_cvs
  clearexport_pvcs
  clearexport_rcs
  clearexport_sccs
  clearexport_ssafe
  clearfsimport
  cleargetlog
  clearhistory
  clearimport
  clearjoinproj
  clearlicense
  clearmake
  clearmake.options
  clearmrgman
  clearprojexp
  clearprompt
  cleartool
  clearviewupdate
  clearvobadmin
  comments
  config_ccase
  config_spec
  cptype
  credmap
  creds
  deliver
  describe
  diffbl
  diffcr
  diff
  dospace
  edcs
  endview
  env_ccase
  events_ccase
  export_mvfs
  exports_ccase
  file
  find
  findmerge
  fmt_ccase
  getcache
  get
  getlog
  help
  hostinfo
  init_ccase
  ln
  lock
  lsactivity
  lsbl
  lscheckout
  lsclients
  lscomp
  lsdo
  lsfolder
  lshistory
  ls
  lslock
  lsmaster
  lspool
  lsprivate
  lsproject
  lsregion
  lsreplica
  lssite
  lsstgloc
  lsstream
  lstype
  lsview
  lsvob
  lsvtree
  makefile_aix
  makefile_ccase
  makefile_gnu
  makefile_pmake
  makefile_smake
  makefile_sun
  man
  merge
  mkactivity
  mkattr
  mkattype
  mkbl
  mkbranch
  mkbrtype
  mkcomp
  mkdir
  mkelem
  mkeltype
  mkfolder
  mkhlink
  mkhltype
  mklabel
  mklbtype
  mkpool
  mkproject
  mkregion
  mkstgloc
  mkstream
  mktag
  mktrigger
  mktrtype
  mkview
  mkvob
  mount_ccase
  mount
  msdostext_mode
  mvfslog
  mvfsstorage
  mvfstime
  mvfsversion
  mv
  omake
  pathnames_ccase
  permissions
  profile_ccase
  promote_server
  protect
  protectvob
  pwd
  pwv
  query_language
  quit
  rebase
  recoverview
  reformatview
  reformatvob
  register
  relocate
  rename
  reqmaster
  reserve
  rgy_backup
  rgy_check
  rgy_passwd
  rgy_switchover
  rmactivity
  rmattr
  rmbl
  rmbranch
  rmcomp
  rmdo
  rmelem
  rmfolder
  rmhlink
  rmlabel
  rmmerge
  rmname
  rmpool
  rmproject
  rmregion
  rmstgloc
  rmstream
  rmtag
  rmtrigger
  rmtype
  rmver
  rmview
  rmvob
  schedule
  schemes
  scrubber
  setactivity
  setcache
  setcs
  setplevel
  setsite
  setview
  shell
  snapshot.conf
  softbench_ccase
  space
  startview
  type_manager
  umount
  uncheckout
  unlock
  unregister
  unreserve
  update
  version_selector
  view_scrubber
  vob_restore
  vob_scrubber
  vob_sidwalk
  vob_snapshot
  vob_snapshot_setup
  wildcards_ccase
  winkin
  xclearcase
  xcleardiff
  xmldiffmrg

chmaster

Transfers mastership of an object

APPLICABILITY

ProductCommand type
ClearCasecleartool subcommand
MultiSitemultitool subcommand

Platform
UNIX
Windows

SYNOPSIS

chmaster [ –c·omment comment | –cfi·le comment-file-pname | –cq·uery
| –cqe·ach | –nc·omment ]
{ master-replica-selector object-selector ...
| [ –pname ] master-replica-selector branch-or-element-pname ...
| –str·eam [ –ove·rride ] master-replica-selector stream-selector ...
| –def·ault [ –pname ] branch-pname ... | –def·ault brtype-selector ...
| –all [ –obsolete_replica old-replica-selector ]
[ –l·ong ] [ –vie·w view-tag ] master-replica-selector
}

DESCRIPTION

This command transfers the mastership of one or more objects from one replica to another. Only the current replica is affected immediately; other replicas are notified of the mastership transfers through the normal exchange of update packets.

To limit use of this command to a certain set of users, you can create triggers. For more information, see Managing Software Projects.

Specifying a View Context

The chmaster command requires a view context. If you are not in a set view or working directory view on UNIX or in a view drive on Windows, you can specify a view on the command line, as shown in the following table. If you specify a dynamic view, it must be active on your host.

Note: A view you specify in the chmaster command takes precedence over your current set view, working directory view, or view drive.

ArgumentHow to specify a view
object-selector brtype-selector Use a view-extended pathname as the vob-selector portion of the argument. For example:

lbtype:LABEL1@/view/jtg/vobs/dev

brtype:v1.0_bugfix@/view/jtg/vobs/dev

lbtype:LABEL1@s:\dev

brtype:v1.0_bugfix@s:\dev

branch-pname element-pname Specify branch-pname or element-pname as a view-extended pathname. For example:

/view/jtg/vobs/dev/cmd.c@@

/view/jtg/vobs/dev/cmd.c@@/main

s:\dev\cmd.c@@

s:\dev\cmd.c@@\main

master-replica-selector (for the chmaster –all variant) Use the –view option or use a view-extended pathname as the vob-selector portion of the argument. For example:

–view jtg replica:boston_hub@\dev

replica:boston_hub@/view/jtg/vobs/dev

replica:boston_hub@s:\dev

RESTRICTIONS

Identities: For all UCM objects except baselines, no special identity is required. For baselines and all non-UCM objects, you must have one of the following identities:

  • Object creator (except for replicas)
  • Object owner (except for replicas)
  • VOB owner
  • root (UNIX)
  • Member of the ClearCase administrators group (Windows)
Locks: Restrictions depend on the kind of object:
Object whose mastership is changingLocks on these objects cause the chmaster command to fail
ElementElement, element type, VOB
BranchBranch, branch type, VOB
Type objectType object, VOB
Hyperlink Hyperlink type, VOB
BaselineBaseline, VOB, replica, components associated with the baseline
StreamStream, activity
ComponentComponent, VOB, replica

Mastership: Your current replica must master the object. Using both –all and –obsolete_replica overrides this restriction, but you must not use the –obsolete_replica option except in special circumstances. (See the description of the –all option.)

Other: You cannot transfer mastership of a branch if either of these conditions exist:

  • There are reserved checkouts on that branch.
  • There are unreserved checkouts on that branch made without the –nmaster option.

OPTIONS AND ARGUMENTS

Event Records and Comments

Default
 Creates one or more event records, with commenting controlled by your .clearcase_profile file (default: –nc). See the comments reference page. Comments can be edited with chevent.

–c·omment comment | –cfi·le comment-file-pname |–cq·uery | –cqe·ach | –nc·omment
Overrides the default with the option you specify. See the comments reference page.

Specifying the Objects

Default
  None.

master-replica-selector object-selector ...
Transfers mastership of objects specified with object-selector to the replica specified with master-replica-selector. Specify master-replica-selector in the form [replica:]replica-name[@vob-selector].
replica-name Name of the replica (displayed with lsreplica)
vob-selector VOB family of the replica; can be omitted if the current working directory is within the VOB.

Specify vob-selector in the form [vob:]pname-in-vob

 pname-in-vob Pathname of the VOB tag (whether or not the VOB is mounted) or of any file system object within the VOB (if the VOB is mounted)

Specify object-selector in one of the following forms:

vob-selector vob:pname-in-vob

where

pname-in-vob

  Pathname of the VOB tag (whether or not the VOB is mounted) or of any file system object within the VOB (if the VOB is mounted)
attribute-type-selector [attype:]type-name[@vob-selector]
branch-type-selector [brtype:]type-name[@vob-selector]
element-type-selector [eltype:]type-name[@vob-selector]
hyperlink-type-selector [hltype:]type-name[@vob-selector]
label-type-selector [lbtype:]type-name[@vob-selector]
hlink-selector [hlink:]hlink-id[@vob-selector]
oid-obj-selector oid:object-oid[@vob-selector]
replica-selector [replica:]replica-name[@vob-selector]
baseline-selector [baseline:]baseline-name[@vob-selector]
component-selector [component:]component-name[@vob-selector]
[ –pname ] master-replica-selector branch-or-element-pname ...
Transfers mastership of the specified branches or elements to the replica specified with master-replica-selector. A branch pathname takes the form element-name@@/branch..., for example, cmdsyn.c@@/main/bugfix, and an element pathname takes the form element-name@@, for example, cmdsyn.c@@. If branch-or-element-pname has the form of an object selector, you must include the –pname option to indicate that pname is a pathname.

–str·eam [ –ove·rride ] master-replica-selector stream-selector ...
Transfers mastership of the specified streams and their associated objects to the replica specified with master-replica-selector. Specify stream-selector in the following form:
stream-selector [stream:]stream-name[@vob-selector]

Use the –override option only if the chmaster –stream command fails. With –override, chmaster attempts to transfer mastership of objects whose mastership was not transferred during the original invocation of the command. For more information, see the Administrator's Guide for Rational ClearCase MultiSite.

–a·ll [ –obsolete_replica old-replica-selector ] [ –l·ong ] [ –vie·w view-tag ] master-replica-selector

Caution: Incorrect use of the –obsolete_replica form of the command can lead to divergence among the replicas in a family.

Transfers to master-replica-selector mastership of all objects that are located in and mastered by the current replica. (The chmaster command determines the current replica by using the vob-selector that you specify as part of master-replica-selector. If you do not include a vob-selector, chmaster uses the replica containing the current working directory.)

If errors occur, the command continues, but after finishing, it reports that not all mastership changes succeeded.

With –long, chmaster lists the objects whose mastership is changing.

With –view, chmaster uses the specified view as the view context.

With –obsolete_replica, chmaster transfers mastership of all objects in the replica specified with old-replica-selector. Also, chmaster associates nonmastered checkouts with the new replica. Use this form of chmaster only when replica old-replica-selector is no longer available (for example, was deleted accidentally). Before entering this command, you must make sure that old-replica-selector masters itself or is mastered by the replica that it last updated. Then, enter the chmaster command at the last-updated replica. You must also send update packets from the last-updated replica to all other remaining replicas in the family. For more information, see the rmreplica reference page.

Returning Mastership of Branches to Default State

Default
  None.

–def·ault [ –pname ] branch-pname ...
Transfers mastership of branch-pname to the replica that masters the branch type. If branch-pname has the form of an object selector, you must include the –pname option to indicate that branch-pname is a pathname.

–def·ault brtype-selector ...
Removes explicit mastership of branches that are mastered explicitly by the current replica and are instances of the type specified by brtype-selector.

Note: You can use this command only at the replica that masters the branch type.

EXAMPLES

  • At replica boston_hub, transfer mastership of label type V1.0_BUGFIX to the sanfran_hub replica.

    multitool chmaster sanfran_hub lbtype:V1.0_BUGFIX 
    Changed mastership of "V1.0_BUGFIX" to "sanfran_hub"

  • At replica sanfran_hub, transfer mastership of element list.c to the sydney replica.

    multitool chmaster sydney list.c@@ 
    Changed mastership of "list.c" to "sydney"

  • At replica sanfran_hub, transfer mastership of the stream v2.1.bl5 and its associated objects to the boston_hub replica.

    multitool chmaster –stream boston_hub@/vobs/dev stream:v2.1.bl5@/vobs/dev 

  • At the replica that is the master of replica sanfran_hub, make sanfran_hub self-mastering.

    multitool chmaster sanfran_hub replica:sanfran_hub 
    Changed mastership of "sanfran_hub" to "sanfran_hub"

  • At replica buenosaires, transfer mastership of branch cache.c@@/main/v3_dev to boston_hub.

    multitool chmaster boston_hub cache.c@@/main/v3_dev 
    Changed mastership of branch "/vobs/dev/cache.c@@/main/v3_dev" to "boston_hub"

  • For all objects mastered by the current replica, transfer mastership to sanfran_hub.

    multitool chmaster –all sanfran_hub 
    Changed mastership of all objects

  • Same as the preceding example, but have chmaster list each object whose mastership is changing, and specify a view context.

    multitool chmaster –all –long sanfran_hub@/view/jtg/vobs/dev 
    Changed mastership of branch type sydney_main
    Changed mastership of label type SYDNEY_V2.0
    Changed mastership of replica sydney
    Changed mastership of all objects

  • Return mastership of a branch to the replica that masters the branch type and then remove its explicit mastership.

    At the replica that masters the branch:

    multitool describe –fmt "%[master]p\n" brtype:v3_bugfix 
    boston_hub@\dev 
    multitool chmaster boston_hub@\dev \dev\acc.c@@\main\v3_bugfix 
    Changed mastership of branch "\dev\acc.c@@\main\v3_bugfix" 
            to "boston_hub@\dev"

    multitool syncreplica –export –fship boston_hub@\dev 
    Generating synchronization packet 
    c:\Program Files\Rational\ClearCase\var
    \shipping\ms_ship\outgoing\sync_bangalore_19-Aug-02.09.33.02_3447_1
    ...

    At the replica that masters the branch type:

    multitool syncreplica –import –receive 
    Applied sync. packet /var/adm/rational/clearcase/shipping/ms_ship/incoming
    /sync_bangalore_19-Aug-02.09.33.02_3447_1
    to VOB /net/minuteman/vobstg/dev.vbs

    multitool chmaster –default brtype:v3_bugfix 
    Changed mastership of branch type "v3_bugfix" to "default"

SEE ALSO

chevent, lsreplica, multitool, reqmaster, rmreplica, syncreplica, Administrator's Guide for Rational ClearCase MultiSite.

SPONSORED LINKS



 

ClearCase Links • ClearCase Books • ClearCase Commands Reference • ClearCase Forums • ClearCase News