Page MenuHomePhabricator

CVS-REL1_5.diff

Authored By
bzimport
Nov 21 2014, 8:46 PM
Size
4 KB
Referenced Files
None
Subscribers
None

CVS-REL1_5.diff

? CVS-REL1_5.diff
Index: includes/DefaultSettings.php
===================================================================
RCS file: /cvsroot/wikipedia/phase3/includes/DefaultSettings.php,v
retrieving revision 1.365
diff -u -b -r1.365 DefaultSettings.php
--- includes/DefaultSettings.php 30 Jul 2005 20:57:15 -0000 1.365
+++ includes/DefaultSettings.php 11 Aug 2005 22:27:16 -0000
@@ -824,6 +824,9 @@
* view for watched pages with new changes */
$wgShowUpdatedMarker = true;
+/* whether on SpecialWatchlist the both pages are deleted together or not */
+$wgRemoveWatchedArticleAndTalkPageTogether = true;
+
$wgCookieExpiration = 2592000;
/** Clock skew or the one-second resolution of time() can occasionally cause cache
Index: includes/WatchedItem.php
===================================================================
RCS file: /cvsroot/wikipedia/phase3/includes/WatchedItem.php,v
retrieving revision 1.17
diff -u -b -r1.17 WatchedItem.php
--- includes/WatchedItem.php 14 May 2005 17:55:04 -0000 1.17
+++ includes/WatchedItem.php 11 Aug 2005 22:27:16 -0000
@@ -95,10 +95,11 @@
}
function removeWatch() {
+ global $wgRemoveWatchedArticleAndTalkPageTogether;
global $wgMemc;
$fname = 'WatchedItem::removeWatch';
- $success = false;
+ if ($wgRemoveWatchedArticleAndTalkPageTogether) {
$dbw =& wfGetDB( DB_MASTER );
$dbw->delete( 'watchlist',
array(
@@ -107,9 +108,6 @@
'wl_title' => $this->ti
), $fname
);
- if ( $dbw->affectedRows() ) {
- $success = true;
- }
# the following code compensates the new behaviour, introduced by the
# enotif patch, that every single watched page needs now to be listed
@@ -122,6 +120,16 @@
'wl_title' => $this->ti
), $fname
);
+ } else {
+ $dbw =& wfGetDB( DB_MASTER );
+ $dbw->delete( 'watchlist',
+ array(
+ 'wl_user' => $this->id,
+ 'wl_namespace' => $this->ns,
+ 'wl_title' => $this->ti
+ ), $fname
+ );
+ }
if ( $dbw->affectedRows() ) {
$success = true;
@@ -135,39 +143,59 @@
/**
* @static
*/
- function duplicateEntries( $ot, $nt ) {
- $fname = "WatchedItem::duplicateEntries";
+ function duplicateEntriesNs( $ot, $nt, $talkns ) {
+ $fname = "WatchedItem::duplicateEntriesNs";
global $wgMemc, $wgDBname;
+
+ if ( $talkns ) {
+ $oldnamespace = $ot->getNamespace() | 1;
+ $newnamespace = $nt->getNamespace() | 1;
+ } else {
$oldnamespace = $ot->getNamespace() & ~1;
$newnamespace = $nt->getNamespace() & ~1;
+ }
$oldtitle = $ot->getDBkey();
$newtitle = $nt->getDBkey();
$dbw =& wfGetDB( DB_MASTER );
$watchlist = $dbw->tableName( 'watchlist' );
- $res = $dbw->select( 'watchlist', 'wl_user',
- array( 'wl_namespace' => $oldnamespace, 'wl_title' => $oldtitle ),
+ $res = $dbw->select( 'watchlist',
+ array( 'wl_user',
+ 'wl_notificationtimestamp'
+ ),
+ array( 'wl_namespace' => $oldnamespace,
+ 'wl_title' => $oldtitle
+ ),
$fname, 'FOR UPDATE'
);
# Construct array to replace into the watchlist
$values = array();
- while ( $s = $dbw->fetchObject( $res ) ) {
+ if ( $s = $dbw->fetchObject( $res ) ) {
$values[] = array(
'wl_user' => $s->wl_user,
'wl_namespace' => $newnamespace,
- 'wl_title' => $newtitle
+ 'wl_title' => $newtitle,
+ 'wl_notificationtimestamp' => $s->wl_notificationtimestamp
);
- }
+
$dbw->freeResult( $res );
# Perform replace
# Note that multi-row replace is very efficient for MySQL but may be inefficient for
# some other DBMSes, mostly due to poor simulation by us
- $dbw->replace( 'watchlist', array(array( 'wl_user', 'wl_namespace', 'wl_title')), $values, $fname );
+ $dbw->replace( 'watchlist', array(array( 'wl_user', 'wl_namespace', 'wl_title' )), $values, $fname );
+ }
return true;
}
+ function duplicateEntries( $ot, $nt ) {
+ # duplicate watchlist entries for the target page
+ # When using ENotif, talkpages have distinct watchlist entries
+ # existing talkpage entries in the watchlist will be moved, too
+ WatchedItem::duplicateEntriesNs( $ot, $nt, false );
+ WatchedItem::duplicateEntriesNs( $ot, $nt, true );
+ }
}

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1818
Default Alt Text
CVS-REL1_5.diff (4 KB)

Event Timeline