r79296 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79295‎ | r79296 | r79297 >
Date:21:47, 30 December 2010
Author:demon
Status:reverted (Comments)
Tags:
Comment:
Using undocumented svn_info() in canConnect()
Modified paths:
  • /trunk/extensions/CodeReview/backend/Subversion.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/backend/Subversion.php
@@ -57,9 +57,18 @@
5858 */
5959 class SubversionPecl extends SubversionAdaptor {
6060
 61+ /**
 62+ * Using undocumented svn_info function. Looking at the source, this has
 63+ * existed since version 0.3 of the Pecl extension (per release notes).
 64+ * Nobody ever bothered filling in the documentation on php.net though.
 65+ * The function returns a big array of a bunch of info about the repository
 66+ * It throws a warning if the repository does not exist.
 67+ */
6168 function canConnect() {
62 - // TODO!
63 - return true;
 69+ wfSuppressWarnings();
 70+ $result = svn_info( $this->mRepo );
 71+ wfRestoreWarnings();
 72+ return (bool)$result;
6473 }
6574
6675 function getFile( $path, $rev = null ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r79787Fixme on r79296, use actual path not repo objectdemon01:50, 7 January 2011
r79788Revert r79787, r79296: just go back to defaulting true. svn_info() is painful...demon01:58, 7 January 2011

Comments

#Comment by Reedy (talk | contribs)   01:25, 1 January 2011

Marking fixme

It causes my local CR install to just hangs indefinately :(

reedy@ubuntu64-esxi:~/mediawiki/trunk/extensions/CodeReview$ php svnImport.php autowikibrowser Using SubversionPecl adaptor Last stored revision: 7463 Syncing repo autowikibrowser from r7464 to HEAD...

#Comment by Reedy (talk | contribs)   21:58, 2 January 2011
$result = svn_info( $this->mRepo->getPath() );

The above *should* fix it.. Can't verify just at the moment...

#Comment by 😂 (talk | contribs)   01:59, 7 January 2011

It wasn't the path's problem, it was that svn_info() is too slow to be useful here.

Status & tagging log