Closed (fixed)
Project:
CVS integration
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
15 Jul 2007 at 02:26 UTC
Updated:
4 Sep 2007 at 04:42 UTC
Jump to comment: Most recent file
attached patch adds postgres support to the module. it's still a bit of a work in progress. some notes:
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | map.txt | 215 bytes | hunmonk |
| #9 | cvs_postgres_3.patch | 29.74 KB | dww |
| #8 | cvs_postgres_2.patch | 27.82 KB | hunmonk |
| #6 | cvs_postgres_1.patch | 27.78 KB | hunmonk |
| #4 | cvs_postgres_0.patch | 11.35 KB | hunmonk |
Comments
Comment #1
drewish commentedi don't think you need to bother capturing the results of db_query() in cvs_install().
bunch of tabs in cvs_update_7().
can't you quote 'user' to make it pgsql safe? username would be better than t_user...
Comment #2
dww@drewish: in that case, please set the status appropriately. ;)
@hunmonk: very cool, thanks for the start. haven't tested yet, but visual inspection of the patch revealed 1 other minor readability personal-preference thing, aside from the issues that drewish mentioned. in cvs_uninstall(), for the huge block of variables to delete, i'd rather just populate an array of variable names and then foreach() it, much like we do with the tables to drop. so, instead of:
I'd rather see:
That's just a personal preference, but I find it's nicer to just add something to an array than copy-paste a whole other variable_del() line. But, certainly all those tabs gotta go, if nothing else. ;)
Will test/review more closely once there's a new patch.
Thanks!
-Derek
Comment #3
hunmonk commenteddrupal=> create table foo ("user" text);
CREATE TABLE
so, yes we can, but i really don't like using reserved words -- seems like a prescription for future trouble. i'm ok with username, but have a question: why are we storing that in the first place? can't we just get that from the users table?
thoughts, anyone?
will fix the other issues shortly.
Comment #4
hunmonk commentedattached should fix all of the above concerns. i decided to change user -> username instead of overriding the reserved word for postgres -- i really think this is the better long-term solution.
Comment #5
dww{cvs_messages}.user is the account name of the CVS user who committed a given change. In general, this is the same as the drupal username, but not always. Furthermore, it's entirely possible that someone commits to a repo who doesn't have a drupal account at all, in which case the uid field is 0, but the user field is filled in.
Therefore, if we're going to rename the field anyway, maybe it should be called "cvs_user" to make it clear this is the username of the CVS account. While we're at it, perhaps we should rename {cvs_accounts}.name to also be "cvs_user" to match.
Thanks for the array-driven implementation for deleting variables in cvs_uninstall(). However, variable_del() does some other stuff, besides *just* removing the entry from the {variables} table. It also clears the entire 'variables' entry in the cache, and unsets the $conf entry for the particular variable. Not sure we need to do about clearing the $conf entry, since we're going to just reload the page after we hit the uninstall hook, so we'll bootstrap again and make a new $conf array. However, if you put the manual pruning of {variables} *before* any of the calls to variable_del() (like you had originally), then the cache will be appropriately cleared by the time we're rebuilding $conf.
Thanks for working on this!
-Derek
p.s. If you care about pgsql support for this module, I encourage you to take a look at http://drupal.org/node/136866.
Comment #6
hunmonk commentedok, we should be close now:
again, i'm pretty sure i got all the renames, but we really should test this in the real world a bit. :)
Comment #7
dwwvisual inspection reveals no problems. updating status accordingly. ;) agreed, this requires a more careful review and testing before we can commit, but it's certainly close.
Comment #8
hunmonk commentedmissed renaming the primary key for {cvs_accounts}. attached corrects.
Comment #9
dwwA) does
UNIQUE (name)automatically create an index in pgsql?B) tabs in cvs_uninstall()
otherwise, i tested cvs_update_7() on MySQL and it's working fine. altering the field for the primary key works, and the primary key is then on cvs_user, which is great. a clean install also works, once i patched the d.o testing profile to use the new field names. ;)
Attached patch includes the (trivial) changes for the test profile, and fixes the tabs in cvs_uninstall(). So, if you're happy with (A), I think this is RTBC.
Comment #10
hunmonk commentedyep.
committed to HEAD. won't backport this, since we've decided that postgres support will start w/ 5.x
NOTE: this is only a first step, postgres still is not fully supported for the module! the xcvs scripts are still mysql-specific. we'll be addressing that by having xcvs bootstrap the database.
Comment #11
drewish commentedso it turns out that the generate-cvs-passwd.php script wasn't updated for this change. nnewton showed up in IRC and helped up figure out what the problem is.
Comment #12
hunmonk commentedi'm confused. i don't see that file as part of this module -- are you thinking of another module perhaps? if so, please file an issue there and mark this fixed again.
Comment #13
hunmonk commentedwhoop. disregard that attachment -- it was in error...
Comment #14
drewish commentedyeah the script isn't in CVS, but this change affected it so i made a note on the issue. i'd forgotten that dww wasn't going to be back around to take care of it. i looks like nnewton got it fixed though.
Comment #15
(not verified) commented