I started with todays CVS checkout of drush. And get a bunch of useful commands, but no mention of the CVS or SVN update tools that are mentioned in some threads here.

I roll back to DRUPAL-6--2-0-RC1 and still don't see them.
In my checkout directory (HEAD), I saw the folders drush_pm_cvs etc, but they were empty.
Looking at the repository, I see there used to be something there on a 6--1 branch

I can currently drush dl {module} but I thought there may have been provision under drush to drush co {module} to assist keeping up with CVS versions. Am I dreaming? Is this still only on a wish-list, or has it fallen into the cracks somewhere in the CVS branches?

I'm thinking the CVS is slightly borked... but I also see evidence of a code-dir refactoring (things have moved over to under drush/commands/pm ?)
Can anyone clarify what's up with the current release? Is it supposed to include some CVS help utilities? Are they abandoned, pending a rewrite, or just forgotten?

Comments

dman’s picture

Component: Installation » Documentation

Update to self and others with the same question...
I think but am not sure yet, that some clues about the cvs commands can be found in
drush help dl.
To quote:

Quickly download projects (modules, themes, profiles, translations) from drupal.org. Automatically figures out which module version you want based on
its latest release, or you may specify a particular version. Downloads drupal core as well.  If no destination is provided, defaults to a site
specific modules directory if available, then to sites/all/modules if available, then to the current working directory.

Examples:
 drush dl                                  Download latest version of Drupal core.
 drush dl drupal                           Download latest stable version of Drupal core
 drush dl drupal-7.x                       Download latest 7.x development version of Drupal core
 drush dl cck zen es                       Download latest versions of CCK, Zen and Spanish translations for my version of Drupal.
 drush dl og-1.3                           Download a specfic version of diff module for my version of Drupal.
 drush dl diff-6.x-2.x                     Download a specfic development branch of diff module for a specific Drupal version.
 drush dl cck                              Commit changes as the user 'joe' (Quotes are required).
 --svncommitparams=\"--username joe\"                                                                                                               
 drush dl cck --cvsparams=\"-C\"           Overwrite all local changes (Quotes are required).
 drush dl cck --cvsmethod=update           Will update the project, and try to merge changes, rather than overwriting them. Any conflicts will need to be resolved manually.

Arguments:
 projects                                  A space separated list of project names, with optional version. Defaults to 'drupal'

Options:
 --destination                             Path to which the project will be copied.
 --version-control=svn                     Quickly add/remove/commit your project changes to Subversion.
   --svnsync                               Automatically add new files to the SVN repository and remove deleted files. Caution.
   --svncommit                             Automatically commit changes to SVN repository. You must also using the --svnsync option.
   --svnmessage                            Override default commit message which is: Drush automatic commit: <the drush command line used>            
   --svnstatusparams                       Add options to the 'svn status' command
   --svnaddparams                          Add options to the `svn add` command
   --svnremoveparams                       Add options to the `svn remove` command
   --svncommitparams                       Add options to the `svn commit` command
 --package-handler=cvs                     Use CVS to checkout and update projects.
   --cvsparams                             Add options to the `cvs` program
   --cvsmethod                             force cvs updates or checkouts (checkout is default unless the directory is managed by a supported version control system).

If you already know that CVS utilities are tucked away under a thing called dl - the docs are incredibly good.
If you did not already know that, and didn't follow up with 20 minutes reading and tracing the source code... well? It's a bit hard to find...
Searching on drupal.org or this project did not provide the answer to this question. So maybe my reposting/exposing the docs here will help :-}

dman’s picture

To continue documenting my own confusions...
More code sleuthing leads me to believe that the magic words was looking for are:
drush -v dl backup_migrate-6.x-1.x-dev --package-handler=cvs
(I'm trying to checkout the current -dev version of backup_migrate - including the CVS info so I can eventually contribute a patch)

... but that line doesn't work.

Initialized Drupal 6.7-dev root directory at /var/www/drupal6                                                                                 [notice]
Initialized Drupal site test.drupal6.gadget at sites/test.drupal6.gadget                                                                      [notice]
PHP Warning:  ... [snip] ...
Including non-version specific file : sites/all/modules/contributions/drush/commands/pm/package_handler/cvs.inc                               [notice]
Including non-version specific file : sites/all/modules/contributions/drush/commands/pm/version_control/svn.inc                               [notice]
Calling chdir(/var/www/drupal6/sites/test.drupal6.gadget/modules/)
Downloading project backup_migrate ...                                                                                                        [notice]
Executing: cvs -z6  -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -d backup_migrate -r DRUPAL-6--1 contributions/modules/backup_migrate

... and ... the process freezes and stalls. It looks like I was getting closer, although ... -z6 is not something I'm used to using.

... Neither is cvs.drupal.org! Turning on trace and running the failed command:
cvs -z6 -t -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -d backup_migrate -r DRUPAL-6--1 contributions/modules/backup_migrate

  -> main: Session ID is 5B07KHGUeDPpOYPt
  -> main loop with CVSROOT=/cvs/drupal-contrib
  -> parse_tagdate ((null), (null), DRUPAL-6--1)
  -> safe_location( where=backup_migrate )
  -> open_connection_to_server (:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib)
  -> Connecting to cvs.drupal.org(140.211.166.46):2401.
cvs checkout: inflate: invalid distance too far back
cvs [checkout aborted]: reading from server: Input/output error

RIGHT... but running it without -z6 works just fine!
cvs -t -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -d backup_migrate -r DRUPAL-6--1 contributions/modules/backup_migrate

Clues.

It's looking to me like if I want drush/CVS to interact with cvs.d.o (um, yeah!) ... I need to patch drush cvs.inc

function drush_pm_cvs_checkout($project, $info, $cvsparams) {
..
...
  if (!drush_shell_exec('cvs -z6 '. $cvsparams .' -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/' . $repos . ' checkout -d '. $project .' -r '. $info['tag'] .' '. $cvsdir . $project)) {
    drush_set_error('DRUSH_PM_UNABLE_CHECKOUT', "Unable to checkout $project from cvs.drupal.org.");
  }
}

to take out that -z6 .

... YAY.
... Now I just need to figure out a good way to override the anonymous:anonymous setting :-B

Apologies for the stream-of-consciousness debugging here - but MAYBE it will bring to light some holes in the documentation, or intuitiveness of the system that could be fixed by making information more findable :-}. What is obvious to those that have worked on the code is still a black box to me as someone who is trying to get started with using the system.

What's the precise difference between -package-handler and -version-control BTW? Where would I look to find their valid options? Inspecting the code I see 'cvs', 'svn', 'wget'. These opts are almost-but-not-quite documented in drush help dl

moshe weitzman’s picture

Status: Active » Fixed

package handler determines how you download projects (CVS or wget/CURL). version control determines how you do backup of projects when upgrading. if you use SVN, drush doesn't make a backup directory because it lets you save changes in your SVN instead.

nothing else to do here AFAICT

dman’s picture

Yeah, 80% of it is just me researching out loud.
I'm trying that old d.o suggestion to "document things you don't don't understand" :-/ Well we can see how that turned out... :-\

OK, but arising from the innards of my confusions, can anyone please confirm that
drush -v dl backup_migrate-6.x-1.x-dev --package-handler=cvs
was expected to work?
Because it didn't. For Me. Until I patched the module as described in my experiment above.

So either I'm using it wrong, docs need to be updated, or some patch applied.

I vote for #1 of course, but would like feedback on what to do right instead...

moshe weitzman’s picture

Works for me. I am using 'Concurrent Versions System (CVS) 1.12.13 (client/server)'. No idea what -z6 is all about.

/tmp$ drush -v  dl backup_migrate-6.x-1.x-dev --package-handler=cvs
Including non-version specific file :                                                             [notice]
/Users/mw/contributions/modules/drush/commands/pm/package_handler/cvs.inc
Including non-version specific file :                                                             [notice]
/Users/mw/contributions/modules/drush/commands/pm/version_control/svn.inc
Calling chdir(/tmp/)
Downloading project backup_migrate ...                                                            [notice]
Executing: cvs -z6  -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -d backup_migrate -r DRUPAL-6--1 contributions/modules/backup_migrate
  cvs checkout: Updating backup_migrate
  U backup_migrate/README.txt
  U backup_migrate/backup_migrate.info
  U backup_migrate/backup_migrate.install
  U backup_migrate/backup_migrate.module
  cvs checkout: Updating backup_migrate/includes
  cvs checkout: Updating backup_migrate/po
  U backup_migrate/po/de.po
  U backup_migrate/po/fr.po
  U backup_migrate/po/sk.po
  cvs checkout: Updating backup_migrate/tests
  cvs checkout: Updating backup_migrate/translations
  U backup_migrate/translations/ja.po
Checking out backup_migrate was successful.                                                       [notice]
Project backup_migrate (6.x-1.x-dev) downloaded to /tmp/.                                      [success]
Command dispatch complete                                                                         [notice]
dman’s picture

Cool.
If nothing else that narrows it down somewhat to my cvs client handshaking with the cvs server - not the drush invocation that's happening around it, and not anything specific to cvs.drupal.org either.
Must just be my client "Concurrent Versions System (CVS) 1.12.13 (client/server)" also! Hm. But on OSX

Thanks for the clarification! It's just me.

-z6 is something about zipping the files for transmission over the network pipe and unzipping them at the other end. Very clever, but too clever for this terminal to handle it seems.

Cheers,
.dan.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.