cvs.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Mon, 22 Feb 2016 12:41:52 +0200
changeset 1903 901e7394849f
parent 1830 b4a5c76521df
child 1905 fba288d59662
permissions -rw-r--r--
Decrease intent to increase space usage on mobile.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1334
9bf0d5a1f0cf Include common header with quick links.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1029
diff changeset
     1
.. -*- coding: utf-8; -*-
9bf0d5a1f0cf Include common header with quick links.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1029
diff changeset
     2
.. include:: HEADER.rst
1028
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     3
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     4
======
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     5
 CVS.
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     6
======
1029
6a3ddfb01763 Add contents.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1028
diff changeset
     7
.. contents::
1028
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     8
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     9
CVS via proxy server.
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    10
=====================
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    11
::
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    12
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    13
  $ cvs -d:pserver;proxy=$proxyhost;proxyport=$proxyport:$cvsuser@$cvsdomain:/$repo
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    14
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    15
Create CVS Repository.
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    16
======================
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    17
::
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    18
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    19
  $ export CVSROOT=/srv/cvsroot
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    20
  $ cvs init
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    21
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    22
  $ groupadd cvs
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    23
  $ useradd -m -g cvs -s /bin/sh -c "CVS Repository"  cvs
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    24
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    25
  $ chown -R cvs $CVSROOT
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    26
  $ chgrp -R cvs $CVSROOT
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    27
  $ chmod -R g+s $CVSROOT
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    28
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    29
  $ grep cvs /etc/services && echo OK
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    30
  cvspserver      2401/tcp              # CVS client/server operations
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    31
  cvspserver      2401/udp              # CVS client/server operations
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    32
  $ echo '# CVS server
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    33
  cvspserver  stream  tcp  nowait  root  /usr/bin/cvs cvs --allow-root=/usr/local/src/cvsroot pserver' \
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    34
      >/etc/inetd.conf
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    35
  $ killall -HUP inetd                  # signal inetd daemon to re-read the config file
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    36
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    37
  $ ls $CVSROOT/CVSROOT
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    38
  readers                   # list of pseudo usernames that can read via cvspserver
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    39
  writers                   # list of pseudo usernames can write via cvspserver
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    40
  passwd                    # encrypted passwd string with (htpasswd from apache)
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    41
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    42
CVS workflow.
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    43
=============
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    44
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    45
Check out sources::
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    46
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    47
  $ cvs co -P $proj
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    48
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    49
Status of changes::
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    50
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    51
  $ cvs status
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    52
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    53
Compare local changes::
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    54
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    55
  $ cvs diff -u $path
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    56
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    57
Creating patch::
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    58
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    59
  $ cvs diff -N -u -r >$patch
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    60
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    61
History of changes::
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    62
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    63
  $ cvs log $file
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    64
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    65
Remove a file::
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    66
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    67
  $ rm $file            # must first remove it locally
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    68
  $ cvs rm $file        # schedules it for removal
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    69
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    70
Add a file::
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    71
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    72
  $ cvs add $file
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    73
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    74
Check in local changes::
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    75
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    76
  $ cvs ci
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    77
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    78
Update local sources::
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    79
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    80
  $ cvs update
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    81
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    82
Move a file can not be done cleanly at the local level. The best way to do this
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    83
with CVS is to go to the cvsroot repository and move the file or directory
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    84
within the repository there. The cvsroot repository keeps all files in their RCS
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    85
form of filename,v . The next cvs update will manifest the file move.
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    86
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    87
Tagging sources::
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    88
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    89
  $ cvs tag $name
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    90
  $ cvs rtag $name
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    91
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    92
Revert file::
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    93
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    94
  $ rm $file            # remove it from local sources
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    95
  $ cvs update $file    # get a new copy from the repository
a4eafc97715b Fix mistype.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    96
1829
f001ff60c027 Working with CVS branches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1437
diff changeset
    97
Working with CVS branches.
f001ff60c027 Working with CVS branches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1437
diff changeset
    98
==========================
1436
b069e5cd5e90 List of CVS branches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
    99
1830
b4a5c76521df Fix typo.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1829
diff changeset
   100
There are no direct command to list symbolic names for branches but this command
b4a5c76521df Fix typo.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1829
diff changeset
   101
allow extract such info::
1436
b069e5cd5e90 List of CVS branches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
   102
b069e5cd5e90 List of CVS branches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
   103
  $ cd $CVS_PROJ
b069e5cd5e90 List of CVS branches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
   104
  $ cvs rlog -l -h -b $(cat CVS/Repository)
b069e5cd5e90 List of CVS branches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1334
diff changeset
   105
1830
b4a5c76521df Fix typo.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1829
diff changeset
   106
Switch to branch::
1829
f001ff60c027 Working with CVS branches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1437
diff changeset
   107
f001ff60c027 Working with CVS branches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1437
diff changeset
   108
  $ cvs up -r $BRANCH
f001ff60c027 Working with CVS branches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1437
diff changeset
   109
f001ff60c027 Working with CVS branches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1437
diff changeset
   110
Update to HEAD::
1437
caeb534c6e59 Update to HEAD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1436
diff changeset
   111
caeb534c6e59 Update to HEAD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1436
diff changeset
   112
  $ cvs up -A
caeb534c6e59 Update to HEAD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1436
diff changeset
   113
1829
f001ff60c027 Working with CVS branches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1437
diff changeset
   114
Replace head::
f001ff60c027 Working with CVS branches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1437
diff changeset
   115
f001ff60c027 Working with CVS branches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1437
diff changeset
   116
  $ cvs up -j$HEAD -j $NEWBRANCH
f001ff60c027 Working with CVS branches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1437
diff changeset
   117
f001ff60c027 Working with CVS branches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1437
diff changeset
   118
Replace branch::
f001ff60c027 Working with CVS branches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1437
diff changeset
   119
f001ff60c027 Working with CVS branches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1437
diff changeset
   120
  $ cvs up -j$OLD -j $NEW
f001ff60c027 Working with CVS branches.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1437
diff changeset
   121