Topic on Extension talk:CodeReview

svnImport.php had troubles

8
173.212.64.192 (talkcontribs)

I recently setup a wiki with this extension, and while importing from an svn repository I got the following error

 PHP Fatal error:  Call to a member function getId() on a non-object in extensions/CodeReview/backend/CodeRevision.php on line 337

I was running this on the command line, how the walk through suggested, and it had difficulties when trying to find the of the commitAuthor from the wiki. Not sure if this error comes about because I am running it form the command line or not, also not sure if there is another way in which it is meant to be run.

This error originates the the public function save() after an if statement evaluated to true. Not sure if this piece of code is something that is triggered or not. I got around it by temporarily setting $commitAuthorID=$this->mAuthor. This should be OK?? as I am the only author on both the wiki and the repository.

Reedy (talkcontribs)

Hi, What version of MediaWiki are you using? As line 337 in trunk points to a comment.

If you're not running trunk CR, try updating to it, and it'll probably have been fixed...

We've got some strange boundary cases we have dealt with already.

			if ( $commitAuthor ) {
				$committer = $commitAuthor->getName();
				$commitAuthorId = $commitAuthor->getId();
			} else {
				$committer = htmlspecialchars( $this->author );
				$commitAuthorId = 0;
			}

Was your user account linked to your SVN account? I'm presuming probably not if you were doing your initial import....

Cgeroux (talkcontribs)

I am running version 1.17.0 of mediawiki, 5.3.2-1ubuntu4.9 (apache2handler) of PHP, 5.1.41-3ubuntu12.10 of MySQL, and CodeReview-MW1.17-r86547.tar.gz

I can't find lines like that in the version I am running, so perhaps it is an older version. I did try to get the newest stable version, but will look to see if I can find a newer (stable?) version.

I haven't automated anything yet, I am assuming that linking my wiki user account to my SVN account happens at a later point, I haven't gotten that far in the walk through yet, or didn't understand the instructions to do so. I do however have my svn repository imported (though I hacked the import code to do so), and it seems to be working, mostly? I will have to spend some time learning what it is supposed to do to make sure it is doing it all properly.

Thanks for your quick response.

P.S. I noticed that the current trunk version is r94951, perhaps this will fix things, as the version I chose was much older. I just chose the version that looked appropriate for the version of MediaWiki I was using.

I also tried to setup the automation as suggested in the instructions but haven't had any luck with my older version of CodeReview, perhaps the newer version will work? I will also do a bit of looking into setting hooks within an svn repository, as I haven't done that before, and make sure I am doing it right.

Cgeroux (talkcontribs)

Ok, I have tried to update to the newer version, but I couldn't find any instructions, so, I just dove in with what I thought seemed like something reasonable to do. I simply followed the install instructions. Not so lucky. Everything seemed mostly fine, until I tried to look at one of the Special:Code/<my_repository>. I got nothing but a blank white screen. Any suggestions, are there things I need to clean up from the old version, if so what?

Worst case scenario, is reinstall the whole wiki. I would prefer not as I have added some content, though it isn't much, as this is still just the early stages of setting things up.

Also, it seems like there are lots of new versions of this extension coming out all the time, shouldn't it be easier to update than this?

Reedy (talkcontribs)

You should be fine to use the SVN trunk version of CodeReview - "Development version (trunk)". The "easiest" way, is to just checkout the svn (see Subversion) trunk version of CodeReview, and then you can use svn update to bring it into line. After updating the files, you'll need to run a database update via update.php to add any new tables, columns and indexes as appropriate

Cgeroux (talkcontribs)

Ok, I completely wiped out my wiki database (using MySQL drop), and reinstalled the wiki. Dropped the latest trunk version of CodeReview (r94951) into the extension directory ran the update.php script in the maintiance folder of the mediaWiki install. I then setup the repository with the "create" command, and added an url to an svn repository, and clicked create. That seemed to work. I was able to browse to the page of the new repository on my wiki. The page showed all the options for the repository, and an empty list of revisions as I hadn't imported anything yet. I did my initial import (via php svnImport.php <my-repository>), and everything was blank when I went back to that page. I also noticed some weird messages while importing the repository (see bold lines below), not sure if this is has something to do with it?

 799 2011-07-29 03:02:31 cgeroux (54.2 revs/sec)
 svn: No such revision 1200
 svn: No such revision 900
 801 2011-07-29 20:23:53 cgeroux (49.2 revs/sec)
 813 2011-08-02 03:03:36 cgeroux (49.3 revs/sec)
 815 2011-08-02 22:20:30 cgeroux (49.3 revs/sec)
 817 2011-08-03 14:56:49 cgeroux (49.3 revs/sec)
 818 2011-08-03 14:57:46 cgeroux (49.4 revs/sec)
 819 2011-08-03 15:02:27 cgeroux (49.5 revs/sec)
 821 2011-08-04 02:59:41 cgeroux (49.6 revs/sec)
 822 2011-08-04 13:11:55 cgeroux (49.7 revs/sec)
 824 2011-08-05 02:59:23 cgeroux (49.7 revs/sec)
 825 2011-08-05 12:34:56 cgeroux (49.8 revs/sec)
 svn: No such revision 850
 830 2011-08-06 02:59:02 cgeroux (48.8 revs/sec)
 831 2011-08-06 18:29:26 cgeroux (48.9 revs/sec)
 835 2011-08-07 02:58:42 cgeroux (48.5 revs/sec)
 836 2011-08-08 23:16:17 cgeroux (48.6 revs/sec)
 840 2011-08-11 03:00:10 cgeroux (48.2 revs/sec)
 842 2011-08-12 20:13:52 cgeroux (48.3 revs/sec)
 svn: No such revision 849
 Pre-caching skipped.
 Done!


This is strange, as my current repository version is 847. What's this about?

It seems like CodeReview will be a really great project, but maybe I should just wait till some of this stuff gets worked out, and it is a bit more widely tested, and more stable. Thanks for your input on previous problems.

Cgeroux (talkcontribs)

It seems that my initial import problems had to do with the way in which I had svn configured, initially I was using the svn protocol, but changed to http protocol to use CodeReview, and I didn't have things correctly configured in apache for this. After fixing configuration problems in apache, and re-running svnImport.php, things seemed to be working again. With the old version of CodeReview (r86547) for mediawiki 1.17, instead of the trunk, development version (which still doesn't seem to be working for me, residual setup information??).

Cgeroux (talkcontribs)

Ok, so I have things mostly working. I used the trunk version of CodeReview to perform the initial import of my svn repository, and the 1.17x version of CodeReview to see pages. For some reason the trunk (development version) doesn't show special pages for the Special:Code/<my-project> they are just blank.

I have also got the automated updating work, so long as my svn repository is world readable. Though I am not sure I want this, as I would like to have control over when versions of my code are released. If I make my svn repository readable only by valid users, then I am not sure how to tell the CodeReview scripts how to become a "valid user". The diffs available through CodeReview don't really make it possible to get a complete version of the code, but are useful for those who are working on it.

Reply to "svnImport.php had troubles"