UserPreferences

cscvs


cscvs, Changesets in CVS

cscvs is a tool which implements an abstraction layer over CVS constraining it to operations which have atomic changeset semantics. If you need to maintain a project on both CVS and Arch, you should really have a look at it.

One of the major hilights of cscvs is the totla subcommand which import CVS changesets into Arch.

There are two mainline branches of cscvs. The preferred one is at:

robertc@squid-cache.org--misc/cscvs--experimental--1.0
robertc@squid-cache.org--misc
    http://people.initd.org/robertc/misc/public

Another branch (increasingly historical, as its maintainer is on hiatus indefinitely) can be found at:

cduffy@spamcop.net--2004/cscvs--experimental--1.2

cduffy@spamcop.net--2003
    http://quackerhead.com/~duff/{archive}/cduffy@spamcop.net--2003-quackerhead
cduffy@spamcop.net--2004
    http://quackerhead.com/~duff/{archive}/cduffy@spamcop.net--2004

Ignore the version number differences.

BE YE WARNED! There are severe bugs in CSCVS right now. They affect

A typical usage pattern for using cscvs to import a repository into Arch looks something like this:

~$ mkdir -p ~/arch/projectname; cd ~/arch/projectname
~/arch/projectname$ tla archive-setup projectname--branch--1.0
~/arch/projectname$ tla init-tree projectname--branch--1.0
~/arch/projectname$ tla id-tagging-method <whichever>
~/arch/projectname$ sensible-editor {arch}/=tagging-method ## edit as desired
~/arch/projectname$ cd ~/cvs/projectname
~/cvs/projectname$ cscvs cache -b ## construct changesets from the CVS repository's history
~/cvs/projectname$ cscvs totla -i 1 ~/arch/projectname
~/cvs/projectname$ cscvs totla -c 2: ~/arch/projectname

Some items to note:

<wildfire> lifeless: should I set a id-tagging method as per: http://wiki.gnuarch.org/moin.cgi/cscvs?action=show
<lifeless> wildfire: nope
<lifeless> the default is explicit which is fine.
<lifeless> (and appropriate)

Also notice that the usage pattern listed above is by no means the only one available. In particular, some users (most notably RobertCollins, who has been responsible for most of the better code addded to cscvs lately) have taken to keeping both the CVS and Arch repositories within the same directory. Tagging types other than explicit have not been tested to work in this configuration, which is documented somewhat inside the README.

Discussion

So, I started building a setup.py for this project, since it really needs one. And it worked out OK... except for the sub-command structure.

I wonder if it wouldn't be a good idea to put all the modules needed by cscvs into a single python package, like, oh, I dunno, cscvs. The commands could be in cscvs.command, the CVS stuff could be in cscvs.CVS, etc. That keeps the tool from polluting the fragile python namespace, and makes it easier to install "safely". A listing of the contents of the cscvs.command package could be used to find commands dynamically.

Questions

I'm having some problems merging the 527 changesets from a CVS project; I really dont need to have Arch know the entire history of my project anyways. How can I get arch to load just the most recent context, and hopefully avoid having to parse through all 527 previous changesets?

Updates

You can also script updates via Cron. Check these cron scripts

wishes

There's a separate page for wishes: /wishlist.

Bugs

~/src/os-CLEAN$ cscvs log -PMAIN | tee /tmp/MAIN.log
~/src/os-CLEAN$ grep  "^ChangeSet: 1$" /tmp/MAIN.log
ChangeSet: 1
~/src/os-CLEAN$ cscvs totla -S MAINLINE.1 $tla
CSCVS_LIBS: /home/dreed/cscvs
sys.path: ['/home/dreed/cscvs', '/home/dreed/python', '/home/dreed/install/lib/python23.zip', '/home/dreed/install/lib/python2.3', '/home/dreed/install/lib/python2.3/plat-linux2', '/home/dreed/install/lib/python2.3/lib-tk', '/home/dreed/install/lib/python2.3/lib-dynload', '/home/dreed/install/lib/python2.3/site-packages', '/home/dreed/cscvs/modules']
/home/dreed/src/os-tla
Traceback (most recent call last):
  File "/home/dreed/bin/cscvs", line 256, in ?
    retval = main(sys.argv)
  File "/home/dreed/bin/cscvs", line 242, in main
    try: callSubcommand()
  File "/home/dreed/bin/cscvs", line 95, in callSubcommand
    Runner.getRunner(config, module).run()
  File "/home/dreed/cscvs/modules/Runner.py", line 53, in run
    apply(self.target, self.args)
  File "/home/dreed/cscvs/cmds/totla.py", line 678, in totla
    for set in apply.getChangesetIterator():
  File "/home/dreed/cscvs/modules/RangeArgParser.py", line 122, in getChangesetIterator
    changeset = branch.getChangeset(int(entry))
  File "/home/dreed/cscvs/modules/StorageLayer.py", line 330, in getChangeset
    return ChangesetSQL(self.branchName, id)
  File "/home/dreed/cscvs/modules/StorageLayer.py", line 460, in __init__
    if result is None: raise KeyError, 'no such changeset %i in branch %s' % (csnum, branch)
KeyError: 'no such changeset 1 in branch MAINLINE'
~/src/os-CLEAN$ (cd ~/cscvs; tla changes)
* looking for cduffy@spamcop.net--2004/cscvs--experimental--1.2--patch-4 to compare with
* comparing to cduffy@spamcop.net--2004/cscvs--experimental--1.2--patch-4
~/src/os-CLEAN$ 
~/src/os-CLEAN$ cscvs totla -S MAIN.1 $tla
CSCVS_LIBS: /home/dreed/cscvs
sys.path: ['/home/dreed/cscvs', '/home/dreed/python', '/home/dreed/install/lib/python23.zip', '/home/dreed/install/lib/python2.3', '/home/dreed/install/lib/python2.3/plat-linux2', '/home/dreed/install/lib/python2.3/lib-tk', '/home/dreed/install/lib/python2.3/lib-dynload', '/home/dreed/install/lib/python2.3/site-packages', '/home/dreed/cscvs/modules']
/home/dreed/src/os-tla
N changeset 1
A a/b/c/d [1.1]
A a/b/c/e [1.1]
A a/b/c/f/g [1.1]
cvs [update aborted]: no such directory `a/b/c/f'
Performing undo due to exception: "cvs -Q update -r1.1 'arch/ia32/boot/loader/Makefile'" failed with exit status 256
undo: illegal revision name: dreed@nexwave-solutions.com--2004-test/os--CVS--0--
Traceback (most recent call last):
  File "/home/dreed/bin/cscvs", line 256, in ?
    retval = main(sys.argv)
  File "/home/dreed/bin/cscvs", line 242, in main
    try: callSubcommand()
  File "/home/dreed/bin/cscvs", line 95, in callSubcommand
    Runner.getRunner(config, module).run()
  File "/home/dreed/cscvs/modules/Runner.py", line 53, in run
    apply(self.target, self.args)
  File "/home/dreed/cscvs/cmds/totla.py", line 679, in totla
    apply_changeset(apply, config, set)
  File "/home/dreed/cscvs/cmds/totla.py", line 567, in apply_changeset
    undo(apply, config, changeset, e)
  File "/home/dreed/cscvs/cmds/totla.py", line 406, in undo
    runTla("undo")
  File "/home/dreed/cscvs/cmds/totla.py", line 118, in runTla
    if ret: raise TlaError('"tla %s" failed with exit status %s' % (command, ret))
totla.TlaError: "tla undo" failed with exit status 512

It seems that readonly CVS via filesystem breaks the rlog parser. -- GerdFlaig <gefla@pond.sub.org>

% CVSREADONLYFS=true cscvs cache -b
cvs: WARNING: Read-only repository access mode selected via `cvs -R'.
Using this option to access a repository which some users write to may
cause intermittent sandbox corruption.
cvs: WARNING: Read-only repository access mode selected via `cvs -R'.
Using this option to access a repository which some users write to may
cause intermittent sandbox corruption.
cvs [log aborted]: received broken pipe signal
cvs: WARNING: Read-only repository access mode selected via `cvs -R'.
Using this option to access a repository which some users write to may
cause intermittent sandbox corruption.
Set remote repository location to /afs/stacken.kth.se/src/SourceRepository/sip
Traceback (most recent call last):
  File "/usr/share/cscvs/cscvs", line 251, in ?
    retval = main(sys.argv)
  File "/usr/share/cscvs/cscvs", line 237, in main
    try: callSubcommand()
  File "/usr/share/cscvs/cscvs", line 90, in callSubcommand
    Runner.getRunner(config, module).run()
  File "/usr/share/cscvs/modules/Runner.py", line 53, in run
    apply(self.target, self.args)
  File "/usr/share/cscvs/cmds/cache.py", line 212, in cache
    if not mode == MODE_UNSET: update_cache(config, pipe)
  File "/usr/share/cscvs/cmds/cache.py", line 92, in update_cache
    parser = CVS.Parser.Parser(config, pipe)
  File "/usr/share/cscvs/modules/CVS/Parser.py", line 135, in __init__
    total_revs = self._parse_revs(filename, tags, branches, total_revs)
  File "/usr/share/cscvs/modules/CVS/Parser.py", line 271, in _parse_revs
    raise error, "bad rlog parser, no cookie!"
Parser error: bad rlog parser, no cookie!
cvs [rlog aborted]: received broken pipe signal

I had the same problems but managed to fix it by patching /usr/share/cscvs/modules/CVS/Parser.py as follows. The problem seemed to be because the CVS repository was originally created with a somewhat old version of CVS (1.11) from Caldera's Linux distribution which has a slightly different datestamp format. The following code isn't perfect: some of the log entries seem to have been made with a different CVS version which didn't put as many fields in (one of the "users" in an import was called "+0000"). Still, imported is better than not. -- Marek Isalski <marek.isalski@smtr.nhs.uk>

misalski@cymbeline:/usr/share/cscvs/modules/CVS$ diff Parser.py.orig Parser.py 83c83
<               "^date:\s+(\d+)/(\d+)/(\d+)\s+(\d+):(\d+):(\d+);\s+"\
---
>               "^date:\s+(\d+).(\d+).(\d+)\s+(\d+):(\d+):(\d+)(\s+\+(\d)+)?;\s+"\
89c89
<               "^date:\s+(\d+)/(\d+)/(\d+)\s+(\d+):(\d+):(\d+);\s+"\
---
>               "^date:\s+(\d+).(\d+).(\d+)\s+(\d+):(\d+):(\d+)(\s+\+(\d)+)?;\s+"\
271c271
<                       raise error, "bad rlog parser, no cookie!"
---
>                       raise error, "bad rlog parser, no cookie!  " + repr(line)
290,291c290,291
<                       pluscount = int(groups[8])
<                       minuscount = int(groups[9])
---
>                       pluscount = int(groups[10])
>                       minuscount = int(groups[11])